SQL - Multiple Choice Questions (MCQ)
1. Which SQL statement is used to create a new table in a database?
a. SELECT
b. INSERT
c. DELETE
d. CREATE
2. Which SQL statement is used to update the values of existing rows in a table?
a. SELECT
b. INSERT
c. UPDATE
d. DELETE
3. Which SQL statement is used to delete rows from a table?
a. SELECT
b. INSERT
c. DELETE
d. UPDATE
4. Which SQL statement is used to retrieve data from a table?
a. SELECT
b. INSERT
c. DELETE
d. UPDATE
5. Which SQL statement is used to join two or more tables based on a common column?
a. JOIN
b. SELECT
c. INSERT
d. DELETE
6. Which SQL statement is used to sort the results of a SELECT statement in ascending order?
a. ORDER BY ASC
b. SORT ASCENDING
c. ORDER BY +ASCENDING
d. SORT +ASCENDING
7. Which SQL statement is used to sort the results of a SELECT statement in descending order?
a. ORDER BY DESCENDING
b. SORT DESCENDING
c. ORDER BY -DESCENDING
d. SORT -DESCENDING
8. Which SQL statement is used to select distinct values from a column in a table?
a. DISTINCT SELECT * FROM tablename;
b. UNIQUE SELECT * FROM tablename;
c. DISTINCT FROM tablename;
d. UNIQUE FROM tablename;
9) What is the name of the SQL clause that is used to specify the conditions for selecting rows from a table?
WHERE
10) What is the name of the SQL clause that is used to specify the columns that should be included in the result set of a SELECT statement?
SELECT
Answers:
1. D) CREATE
2. C) UPDATE
3. D) DELETE
4. A) SELECT
5. A) JOIN
6. A) ORDER BY ASC
7. A) ORDER BY DESC
8. A) SELECT DISTINCT * FROM tablename;
Note: The syntax for SELECT DISTINCT and SELECT with column names may vary depending on the specific SQL dialect being used, but the concepts remain the same.