Q) Wrong statement about ORDER BY keyword is
- Used to sort the result-set in ascending or descending order
- The ORDER BY keyword sorts the records in ascending order by default.
- To sort the records in ascending order, use the ASC keyword.
- To sort the records in descending order, use the DECENDING keyword.
Answer: 4
To sort the records in descending order DESC keyword is used.
Q) Correct syntax query syntax to drop a column from a table is
- DELETE COLUMN column_name;
- DROP COLUMN column_name;
- ALTER TABLE table_name DROP COLUMN column_name;
- None is correct.
Answer: 3
To drop a column from an existing table, first table should be altered using ALTER TABLE statement.
Q) If you want to allow age of a person > 18 in the column Age of table Person, then which constraint will be applied to AGE column.
- Default
- Check
- NOT NULL
- None
Answer: 2
CHECK constraint is used to limit the value range placed in a column
Q) In a table, a column contains duplicate value, if you want to list all different value only, then which SQL clause is used?
- SQL DISTINCT
- SQL UNIQUE
- SQL BETWEEN
- SQL Exists
Answer: 1
DISTINCT keyword is used to fetch different (unique) value. UNIQUE keyword is known as constraint that is applied to a table, e.g. if UNIQUE is applied to a column, that column will allow only unique records to store and will not accept duplicate record.
Q) To give a temporary name to a table, or a column in a table for more readability, what is used?
- SQL Wildcards
- SQL aliases
- SQL LIKES
- SQL Comments
Answer: 2