SQL (Structured Query Language) MCQs in DBMS
MCQs on SQL in DBMS
- Which SQL statement is used to retrieve data from a database?
- a) SELECT
- b) INSERT
- c) UPDATE
- d) DELETE
Answer: a) SELECT
- Which clause is used to filter records in a SQL query?
- a) ORDER BY
- b) GROUP BY
- c) HAVING
- d) WHERE
Answer: d) WHERE
- What is the purpose of the JOIN operation in SQL?
- a) To combine data from multiple tables
- b) To update existing records
- c) To delete records from a table
- d) To create new tables
Answer: a) To combine data from multiple tables
- Which SQL keyword is used to sort the result set?
- a) SORT BY
- b) ORDER BY
- c) GROUP BY
- d) FILTER BY
Answer: b) ORDER BY
- Which SQL statement is used to insert new records into a table?
- a) UPDATE
- b) INSERT INTO
- c) SELECT
- d) DELETE
Answer: b) INSERT INTO
- What is the default sorting order of the ORDER BY clause?
- a) Descending
- b) Ascending
- c) Random
- d) Alphabetical
Answer: b) Ascending
- Which function is used to calculate the total number of rows in a table?
- a) COUNT()
- b) SUM()
- c) AVG()
- d) MAX()
Answer: a) COUNT()
- What is the purpose of the GROUP BY clause in SQL?
- a) To filter records based on aggregate functions
- b) To sort the result set
- c) To group rows that have the same values in specified columns
- d) To join multiple tables
Answer: c) To group rows that have the same values in specified columns
- Which SQL statement is used to update existing records in a table?
- a) MODIFY
- b) UPDATE
- c) INSERT INTO
- d) CHANGE
Answer: b) UPDATE
- Which SQL keyword is used to remove all records from a table, but not the table itself?
- a) DELETE
- b) DROP
- c) TRUNCATE
- d) REMOVE
Answer: c) TRUNCATE
- Which SQL clause is used to aggregate data in a query?
- a) WHERE
- b) HAVING
- c) JOIN
- d) GROUP BY
Answer: d) GROUP BY
- What is the purpose of the HAVING clause in SQL?
- a) To filter groups of rows based on a specified condition
- b) To filter individual rows based on a specified condition
- c) To sort the result set
- d) To combine data from multiple tables
Answer: a) To filter groups of rows based on a specified condition
- Which SQL function is used to find the maximum value in a column?
- a) MAX()
- b) MIN()
- c) SUM()
- d) AVG()
Answer: a) MAX()
- What does the DISTINCT keyword do in a SQL query?
- a) It orders the result set.
- b) It ensures that the result set contains only unique values.
- c) It calculates the average value of a column.
- d) It groups the result set by specified columns.
Answer: b) It ensures that the result set contains only unique values.
- Which SQL clause is used to specify the columns to be retrieved in a SELECT statement?
- a) FROM
- b) SELECT
- c) WHERE
- d) ORDER BY
Answer: b) SELECT
- What is the function of the UNION operator in SQL?
- a) To combine rows from two or more SELECT queries into a single result set
- b) To join two tables based on a related column
- c) To update records in a table
- d) To delete records from a table
Answer: a) To combine rows from two or more SELECT queries into a single result set
- Which of the following SQL statements will create a new table?
- a) ALTER TABLE
- b) CREATE TABLE
- c) DROP TABLE
- d) MODIFY TABLE
Answer: b) CREATE TABLE
- What does the SQL command
ALTER TABLE
do?- a) Deletes a table
- b) Creates a new table
- c) Modifies an existing table structure
- d) Inserts data into a table
Answer: c) Modifies an existing table structure
- Which SQL clause is used to specify the table from which to retrieve data?
- a) SELECT
- b) FROM
- c) WHERE
- d) ORDER BY
Answer: b) FROM
- What does the SQL command
DROP TABLE
do?- a) Deletes all records in the table but keeps the table structure
- b) Deletes the table structure and all records in the table
- c) Modifies the structure of the table
- d) Creates a new table
Answer: b) Deletes the table structure and all records in the table
More MCQs Of Database Systems
- Database Models MCQs in DBMS
- Relational Database Model MCQs in DBMS
- SQL (Structured Query Language) MCQs in DBMS
- Database Design MCQs in DBMS
- Database Management System Architecture MCQs in DBMS
- Storage and File Structure MCQs in DBMS
- Query Processing and Optimization MCQs in DBMS
- Database Transaction Management MCQs in DBMS
- Database Security and Authorization MCQs in DBMS
- Backup and Recovery MCQs in DBMS
- Distributed Databases MCQs in DBMS
- SET 1: database design mcqs (database design mcqs )
- SET 2: database mcqs with answers pdf (database mcqs with answers pdf )
- SET 3: modern database management 12th edition mcqs (modern database management 12th edition mcqs)
- SET 4: database systems mcqs (database systems mcqs)
- SET 5: dbms mcqs (dbms mcqs )
- SET 6: dbms mcqs with answers (dbms mcqs with answers)
- SET 7: solved mcqs of dbms (solved mcqs of dbms)
- SET 8: dbms mcqs with answers pdf(dbms mcqs with answers pdf)
- SET 9: relational database management system mcqs(relational database management system mcqs)
- SET 10: solved mcqs of database management system(solved mcqs of database management system)
- SET 11: basic database mcqs pdf (basic database mcqs pdf)
- SET 12: relational database management system mcqs (relational database management system mcqs )
- SET 13: database mcqs online test (database mcqs online test)
- SET 14: database interview questions mcqs (database interview questions mcqs)
- SET 15: database developer mcqs (database developer mcqs)
- SET 16: database Repeated mcqs (database Repeated mcqs)
- SET 17: Database mcqs PPSC (Database mcqs PPSC)
- SET 18: Database mcqs FPSC (Database mcqs FPSC)
- SET 19: DBMS mcqs FPSC (DBMS mcqs FPSC)
New Arrival