0% found this document useful (0 votes)
10 views3 pages

Essential SQL Commands and Functions

The document contains a series of multiple-choice questions related to SQL commands and concepts. It covers topics such as data retrieval, filtering records, table management, and SQL functions. Each question provides four options, with one correct answer for each.

Uploaded by

mahaswaruprkpm
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)
10 views3 pages

Essential SQL Commands and Functions

The document contains a series of multiple-choice questions related to SQL commands and concepts. It covers topics such as data retrieval, filtering records, table management, and SQL functions. Each question provides four options, with one correct answer for each.

Uploaded by

mahaswaruprkpm
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 retrieve data from a database?

A. GET
B. FETCH
C. SELECT
D. EXTRACT
2. Which clause is used to filter records in SQL?
A. ORDER BY
B. WHERE
C. GROUP BY
D. HAVING
3. Which SQL function returns the number of rows?
A. SUM()
B. COUNT()
C. TOTAL()
D. NUMBER()
4. Which command is used to remove a table permanently?
A. DELETE
B. REMOVE
C. DROP
D. TRUNCATE
5. What does the PRIMARY KEY do?
A. Allows NULL values
B. Identifies unique records
C. Sorts data
D. Filters rows
6. Which join returns matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. FULL JOIN
D. INNER JOIN
7. Which SQL statement is used to update data?
A. SAVE
B. MODIFY
C. UPDATE
D. CHANGE
8. What is the default sort order of ORDER BY?
A. DESC
B. ASC
C. RANDOM
D. NONE
9. Which clause is used with aggregate functions?
A. WHERE
B. GROUP BY
C. ORDER BY
D. DISTINCT
10. Which constraint ensures no duplicate values?
A. NOT NULL
B. UNIQUE
C. CHECK
D. DEFAULT
11. Which command removes all rows but keeps table structure?
A. DROP
B. DELETE
C. TRUNCATE
D. REMOVE
12. Which operator is used to check a range?
A. LIKE
B. BETWEEN
C. IN
D. EXISTS
13. Which SQL keyword is used to sort results?
A. SORT BY
B. ORDER
C. ORDER BY
D. GROUP BY
14. Which function returns the highest value?
A. TOP()
B. MAX()
C. HIGH()
D. GREATEST()
15. Which join returns all records from left table?
A. INNER JOIN
B. RIGHT JOIN
C. LEFT JOIN
D. FULL JOIN
16. What does NULL represent?
A. Zero
B. Empty string
C. Missing value
D. False
17. Which command adds new records?
A. ADD
B. INSERT INTO
C. APPEND
D. UPDATE
18. Which clause filters grouped data?
A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY
19. Which function returns current date?
A. NOW()
B. GETDATE()
C. CURRENT_DATE
D. All of the above
20. Which keyword removes duplicate rows?
A. UNIQUE
B. DISTINCT
C. FILTER
D. REMOVE
21. Which operator matches a pattern?
A. IN
B. BETWEEN
C. LIKE
D. EXISTS
22. What does FOREIGN KEY do?
A. Ensures uniqueness
B. Links tables
C. Sorts data
D. Filters rows
23. Which SQL statement creates a table?
A. MAKE TABLE
B. CREATE TABLE
C. ADD TABLE
D. NEW TABLE
24. Which command changes table structure?
A. MODIFY
B. UPDATE
C. ALTER
D. CHANGE
25. Which clause limits number of rows?
A. LIMIT
B. TOP
C. ROWNUM
D. All of the above

You might also like