SQL Commands MCQs – CBSE Class 10 Computer Science Online Quiz
SQL Commands MCQs – CBSE Class 10 Computer Science Online Quiz
Course: CBSE Class 10 Computer Science – MCQs with Answers and Explanations
Unit 3: Database Management System (DBMS)
Topic: SQL Commands
Examination Board: CBSE Board Examinations
Unit 3: Database Management System (DBMS)
Topic: SQL Commands
Examination Board: CBSE Board Examinations
1. Which SQL command is used to create a new table?
Answer: B. CREATE TABLE
Explanation: The CREATE TABLE command is a DDL (Data Definition Language) command used to define a new table structure including columns, data types, and constraints.
Explanation: The CREATE TABLE command is a DDL (Data Definition Language) command used to define a new table structure including columns, data types, and constraints.
2. Which command is used to display data from a table?
Answer: C. SELECT
Explanation: SELECT is a DML command used to retrieve data from one or more tables. It can filter, sort, and group records.
Explanation: SELECT is a DML command used to retrieve data from one or more tables. It can filter, sort, and group records.
3. Which clause is used to filter records?
Answer: B. WHERE
Explanation: WHERE clause filters records based on specified conditions.
Explanation: WHERE clause filters records based on specified conditions.
4. Which command adds new records?
Answer: A. INSERT INTO
Explanation: INSERT INTO is used to add new rows into a table.
Explanation: INSERT INTO is used to add new rows into a table.
5. SQL stands for:
Answer: A. Structured Query Language
Explanation: SQL is the standard language for managing relational databases.
Explanation: SQL is the standard language for managing relational databases.
6. Which command modifies existing data?
Answer: C. UPDATE
Explanation: UPDATE changes existing records using SET and WHERE clauses.
Explanation: UPDATE changes existing records using SET and WHERE clauses.
7. Which command deletes records?
Answer: B. DELETE
Explanation: DELETE removes selected rows from a table.
Explanation: DELETE removes selected rows from a table.
8. Which command removes a table permanently?
Answer: C. DROP
Explanation: DROP deletes the entire table structure and data.
Explanation: DROP deletes the entire table structure and data.
9. Which clause sorts data?
Answer: A. ORDER BY
Explanation: ORDER BY arranges records in ascending or descending order.
Explanation: ORDER BY arranges records in ascending or descending order.
10. Default sorting order is:
Answer: B. ASC
Explanation: ASC (Ascending) is default sorting order.
Explanation: ASC (Ascending) is default sorting order.
11. Which command changes table structure?
Answer: B. ALTER
Explanation: ALTER modifies table structure like adding columns.
Explanation: ALTER modifies table structure like adding columns.
12. Primary key uniquely identifies:
Answer: B. Row
Explanation: Primary key uniquely identifies each record.
Explanation: Primary key uniquely identifies each record.
13. Which symbol selects all columns?
Answer: B. *
Explanation: * retrieves all columns from a table.
Explanation: * retrieves all columns from a table.
14. Which clause groups records?
Answer: B. GROUP BY
Explanation: GROUP BY groups rows with similar values.
Explanation: GROUP BY groups rows with similar values.
15. Which function counts records?
Answer: B. COUNT()
Explanation: COUNT() returns number of rows.
Explanation: COUNT() returns number of rows.
16. Which command removes all rows but keeps table?
Answer: C. TRUNCATE
Explanation: TRUNCATE clears data but keeps structure.
Explanation: TRUNCATE clears data but keeps structure.
17. Which keyword avoids duplicate results?
Answer: B. DISTINCT
Explanation: DISTINCT removes duplicate values.
Explanation: DISTINCT removes duplicate values.
18. Which clause limits output rows?
Answer: A. LIMIT
Explanation: LIMIT restricts number of records displayed.
Explanation: LIMIT restricts number of records displayed.
19. Which operator searches patterns?
Answer: B. LIKE
Explanation: LIKE is used with wildcards to search patterns.
Explanation: LIKE is used with wildcards to search patterns.
20. Which command renames a table?
Answer: A. RENAME
Explanation: RENAME command changes table name.
Explanation: RENAME command changes table name.
