What are the commands that DCl uses in sql ?

The Data Control Language (DCL) has four commands that are COMMIT, ROLLBACK, GRANT, and REVOKE. These commands are used to protect the database from harm, both accidental or intentional.

Why do we use the numeric types like varchar, text ?

it all comes down to the database storage and efficiency. choosing the best matching data types for each coloumn in your table will reduce the size of table and make operations on your data faster.

What are the different index configurations a table can have?

A table can have one of the following index configurations:

  1. No indexes
  2. A clustered index
  3. A clustered index and many nonclustered indexes
  4. A nonclustered index
  5. Many nonclustered indexes
Why we not use BLOB for the text values ?

Because its a waste of space. char or text will use specific amount of space and not more than 256 characters. But a BLOB will use so much of space. So there is a possibility to a face out of space issue in future.

What are the qualities,that the table must have to be in First Normal Form ?

To be in first normal form (1NF), a table must have the following qualities:

  • The table is two-dimensional, with rows and columns
  • Each row contains data that pertains to some thing or portion of a thing.
  • Each column contains data for a single attribute of the thing itís describing.
  • Each cell (intersection of a row and a column) of the table must have only a single value
  • Entries in any column must all be of the same kind. If, for example, the entry in one row of a column contains an employee name, all the other rows must contain employee names in that column, too.
  • Each column must have a unique name
  • No two rows may be identical (that is, each row must be unique).
  • The order of the columns and the order of the rows are not significant.
Why the SELECT clause will not work without FROM clause?

The SELECT clause merely tells the database what data you want to see. The FROM clause tells the database where to get the data.

How are numeric characters treated when ordering based upon a character field?

They are sorted as ASCII characters. This means that numbers would be ordered like this: 1, 12, 2, 222, 22222, 3, 33.

Can multiple conditions be used in the WHERE clause?

Yes. Multiple conditions can be specified in the WHERE clause of SELECT, INSERT, UPDATE, and DELETE statements. Multiple conditions are used with the operators AND and OR,

What happens if you select from two different tables but fail to join the tables?

You receive a Cartesian product by not joining the tables and this is also called a cross join.

Should a column with a large percentage of NULL values be indexed?

No. A column with a large percentage of NULLvalues should not be indexed because the speed of accessing these rows degrades when the value of a large percentage of rows is the same.