0% found this document useful (0 votes)
1 views4 pages

MCQ SQL

The document contains a series of SQL-related questions and answers covering various commands, clauses, and functions. Topics include data manipulation, data definition, sorting, filtering, and joining tables. It also addresses SQL constraints, data types, and aggregate functions.

Uploaded by

491 suraj Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views4 pages

MCQ SQL

The document contains a series of SQL-related questions and answers covering various commands, clauses, and functions. Topics include data manipulation, data definition, sorting, filtering, and joining tables. It also addresses SQL constraints, data types, and aggregate functions.

Uploaded by

491 suraj Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. Which SQL command is used to remove a table and all its data permanently?

A) DELETE
B) DROP
C) TRUNCATE
D) REMOVE

2. Which of the following is a DDL command?


A) UPDATE
B) DELETE
C) CREATE
D) SELECT

3. What does the TRUNCATE command do?


A) Deletes rows one by one and logs each deletion
B) Removes all rows but keeps the structure
C) Drops the table permanently
D) Removes specific rows with a condition

4. Which SQL clause is used to group rows that have the same values?
A) ORDER BY
B) HAVING
C) GROUP BY
D) WHERE

5. Which of the following is used to filter groups in SQL?


A) WHERE
B) GROUP BY
C) HAVING
D) ORDER BY

6. Which of the following is the correct order of SQL clauses in a SELECT query?
A) SELECT → WHERE → GROUP BY → HAVING → ORDER BY
B) SELECT → HAVING → WHERE → GROUP BY → ORDER BY
C) SELECT → ORDER BY → GROUP BY → HAVING → WHERE
D) SELECT → GROUP BY → HAVING → WHERE → ORDER BY

7. What type of JOIN returns all rows from both tables, with NULLs where there is no match?
A) INNER JOIN
B) LEFT JOIN
C) RIGHT JOIN
D) FULL OUTER JOIN

8. Which keyword is used to remove duplicate rows in SQL?


A) UNIQUE
B) DISTINCT
C) NODUPLICATE
D) PRIMARY

+91 6305693431, 9154641231, 8790732332


MIG 214, 2ND FLOOR, KPHB KUKATPALLY, HYDERABAD, 500072 | SRA EDUTECH PVT LTD
9. What is the default sorting order of the ORDER BY clause?
A) Ascending
B) Descending
C) Random
D) Depends on the column

10. Which of the following constraints ensures that a column cannot have NULL values?
A) UNIQUE
B) CHECK
C) NOT NULL
D) PRIMARY KEY

11. Which of the following is NOT a valid SQL data type?


A) VARCHAR
B) INT
C) DATE
D) STRING

12. Which SQL command is used to change data in a table?


A) UPDATE
B) MODIFY
C) CHANGE
D) ALTER

13. Which command is used to delete all rows in a table without logging each row deletion?
A) DELETE
B) DROP
C) TRUNCATE
D) REMOVE

14. Which SQL statement is used to extract data from a database?


A) GET
B) SELECT
C) EXTRACT
D) SHOW

15. Which of the following is a valid constraint in SQL?


A) FOREIGN KEY
B) DEFAULT
C) CHECK
D) All of the above

16. Which function is used to count the number of rows in SQL?


A) SUM()
B) COUNT()
C) NUMBER()
D) ROWS()

+91 6305693431, 9154641231, 8790732332


MIG 214, 2ND FLOOR, KPHB KUKATPALLY, HYDERABAD, 500072 | SRA EDUTECH PVT LTD
19. Which JOIN returns only the rows where there is a match in both tables?
A) LEFT JOIN
B) RIGHT JOIN
C) FULL JOIN
D) INNER JOIN

20. Which operator is used to search for a pattern in SQL?


A) LIKE
B) BETWEEN
C) IN
D) MATCH

21. Which symbol is used for a single character wildcard in SQL LIKE clause?
A) %
B) *
C) _
D) #

22. Which of the following commands is used to add a new column in an existing table?
A) UPDATE
B) ADD COLUMN
C) ALTER TABLE
D) MODIFY

23. Which of the following creates a virtual table in SQL?


A) View
B) Index
C) Trigger
D) Procedure

24. Which aggregate function is used to find the largest value?


A) SUM()
B) MAX()
C) BIG()
D) LARGE()

25. Which SQL statement is used to remove duplicates from the result set?
A) REMOVE DUPLICATES
B) UNIQUE
C) DISTINCT
D) CLEAN

27. What is the default value of the ORDER BY clause if no ASC/DESC is specified?
A) DESC
B) ASC
C) RANDOM
D) NULL

+91 6305693431, 9154641231, 8790732332


MIG 214, 2ND FLOOR, KPHB KUKATPALLY, HYDERABAD, 500072 | SRA EDUTECH PVT LTD
28. Which keyword is used to rename a column or table in SQL?
A) RENAME
B) CHANGE
C) AS
D) ALTER

29. Which SQL clause is used to filter rows before grouping?


A) HAVING
B) WHERE
C) ORDER BY
D) GROUP BY

30. Which of the following SQL keywords is used to check multiple values in a condition?
A) BETWEEN
B) ANY
C) IN
D) ALL

+91 6305693431, 9154641231, 8790732332


MIG 214, 2ND FLOOR, KPHB KUKATPALLY, HYDERABAD, 500072 | SRA EDUTECH PVT LTD

You might also like