SQL (Structured Query Language) MCQs in DBMS

MCQs on SQL in DBMS

  1. Which SQL statement is used to retrieve data from a database?
    • a) SELECT
    • b) INSERT
    • c) UPDATE
    • d) DELETE

    Answer: a) SELECT

  2. Which clause is used to filter records in a SQL query?
    • a) ORDER BY
    • b) GROUP BY
    • c) HAVING
    • d) WHERE

    Answer: d) WHERE

  3. 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

  4. 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

  5. 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

  6. What is the default sorting order of the ORDER BY clause?
    • a) Descending
    • b) Ascending
    • c) Random
    • d) Alphabetical

    Answer: b) Ascending

  7. 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()

  8. 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

  9. Which SQL statement is used to update existing records in a table?
    • a) MODIFY
    • b) UPDATE
    • c) INSERT INTO
    • d) CHANGE

    Answer: b) UPDATE

  10. 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

  11. Which SQL clause is used to aggregate data in a query?
    • a) WHERE
    • b) HAVING
    • c) JOIN
    • d) GROUP BY

    Answer: d) GROUP BY

  12. 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

  13. Which SQL function is used to find the maximum value in a column?
    • a) MAX()
    • b) MIN()
    • c) SUM()
    • d) AVG()

    Answer: a) MAX()

  14. 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.

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  1. Database Models MCQs in DBMS
    1. Hierarchical model MCQs in DBMS
    2. Network model MCQs in DBMS
    3. Relational model MCQs in DBMS
    4. Object-oriented model MCQs in DBMS
    5. NoSQL databases MCQs in DBMS
  2. Relational Database Model MCQs in DBMS
    1. tables, attributes, tuples, and relations MCQs in DBMS
    2. Primary keys and foreign keys MCQs in DBMS
    3. Integrity constraints MCQs in DBMS
  3. SQL (Structured Query Language) MCQs in DBMS
    1. Data Definition Language (DDL) MCQs in DBMS
    2. Data Manipulation Language (DML) MCQs in DBMS
    3. Data Control Language (DCL) MCQs in DBMS
    4. Transaction Control Language (TCL) MCQs in DBMS
    5. Advanced SQL queries and functions MCQs in DBMS
  4. Database Design MCQs in DBMS
    1. Entity-Relationship (ER) modeling MCQs in DBMS
    2. Extended ER modeling MCQs in DBMS
    3. Normalization and normal forms (1NF, 2NF, 3NF, BCNF) MCQs in DBMS
    4. Denormalization MCQs in DBMS
  5. Database Management System Architecture MCQs in DBMS
    1. Three-schema architecture (external, conceptual, internal) MCQs in DBMS
    2. Data independence MCQs in DBMS
    3. DBMS components and functions MCQs in DBMS
  6. Storage and File Structure MCQs in DBMS
    1. Data storage on physical media MCQs in DBMS
    2. File organization and access methods MCQs
    3. Indexing (B-trees, hash indexing) MCQs in DBMS
    4. RAID technology MCQs in DBMS
  7. Query Processing and Optimization MCQs in DBMS
  8. Database Transaction Management MCQs in DBMS
    1. ACID properties (Atomicity, Consistency, Isolation, Durability) MCQs in DBMS
    2. Transaction states and lifecycle MCQs in DBMS
    3. Concurrency control techniques (locking, timestamping, multiversion) MCQs in DBMS
    4. Deadlock detection and resolution MCQs in DBMS
  9. Database Security and Authorization MCQs in DBMS
    1. Authentication and authorization mechanisms MCQs in DBMS
    2. Data encryption techniques MCQs in DBMS
    3. Role-based access control MCQs in DBMS
    4. SQL injection prevention MCQs in DBMS
  10. Backup and Recovery MCQs in DBMS
    1. Backup types and strategies MCQs in DBMS
    2. Recovery techniques (log-based, shadow paging) MCQs in DBMS
    3. Disaster recovery planning MCQs in DBMS
  11. Distributed Databases MCQs in DBMS
    1. Distributed database architecture MCQs MCQs in DBMS
    2. Data fragmentation, replication, and allocation in DBMS
    3. Distributed query processing MCQs in DBMS
    4. Consistency models and protocols MCQs in DBMS
  1. SET 1: database design mcqs (database design mcqs )
  2. SET 2: database mcqs with answers pdf (database mcqs with answers pdf )
  3. SET 3: modern database management 12th edition mcqs (modern database management 12th edition mcqs)
  4. SET 4: database systems mcqs (database systems mcqs)
  5. SET 5: dbms mcqs (dbms mcqs )
  6. SET 6: dbms mcqs with answers (dbms mcqs with answers)
  7. SET 7: solved mcqs of dbms (solved mcqs of dbms)
  8. SET 8: dbms mcqs with answers pdf(dbms mcqs with answers pdf)
  9. SET 9: relational database management system mcqs(relational database management system mcqs)
  10. SET 10: solved mcqs of database management system(solved mcqs of database management system)
  11. SET 11: basic database mcqs pdf (basic database mcqs pdf)
  12. SET 12: relational database management system mcqs (relational database management system mcqs )
  13. SET 13: database mcqs online test (database mcqs online test)
  14. SET 14: database interview questions mcqs (database interview questions mcqs)
  15. SET 15: database developer mcqs (database developer mcqs)
  16. SET 16: database Repeated mcqs (database Repeated mcqs)
  17. SET 17: Database mcqs PPSC (Database mcqs PPSC)
  18. SET 18: Database mcqs FPSC (Database mcqs FPSC)
  19. SET 19: DBMS mcqs FPSC (DBMS mcqs FPSC)

New Arrival

Database interview questions