CodeStudy.net
Toggle Menu
Home
Online Java Compiler
Tutorials
Java Tutorial
Python Tutorial
SQL Database Design
Blog
All Posts
SQL Basics and Queries
Test your knowledge of SELECT,WHERE,and ORDER BY clauses.
1. Which SQL clause is used to filter records based on a condition?
WHERE
HAVING
GROUP BY
ORDER BY
2. What does SQL stand for?
Structured Query Language
Simple Query Language
Standard Query Language
Sequential Query Language
3. Which SQL statement is used to retrieve data from one or more tables?
SELECT
GET
RETRIEVE
FETCH
4. Which keyword is used to add a new row of data into a table?
INSERT
ADD
NEW
CREATE
5. What is the purpose of the GROUP BY clause in SQL?
Sort results in ascending/descending order
Group rows with identical values in specified columns
Filter rows based on a condition
Join two or more tables
6. Which type of JOIN returns only the rows that have matching values in both tables?
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL JOIN
7. Which SQL data type is suitable for storing variable-length character strings?
CHAR
VARCHAR
TEXT
STRING
8. What constraint ensures a column (or set of columns) uniquely identifies each row?
PRIMARY KEY
UNIQUE
FOREIGN KEY
INDEX
9. Which of the following are SQL aggregate functions? (Select all that apply)
COUNT()
SUM()
AVG()
CONCAT()
10. Which clauses can be used with the SELECT statement? (Select all that apply)
FROM
WHERE
GROUP BY
LOOP
11. Which are valid standard SQL data types? (Select all that apply)
INT
VARCHAR
BOOLEAN
ARRAY
12. Which statements are Data Manipulation Language (DML)? (Select all that apply)
INSERT
UPDATE
DELETE
ALTER
13. Which JOIN types return only matching rows from both tables? (Select all that apply)
INNER JOIN
EQUIJOIN
LEFT JOIN
CROSS JOIN
14. SELECT DISTINCT returns only unique values from a column.
True
False
15. The ORDER BY clause filters rows based on a condition.
True
False
16. NULL in SQL is equivalent to an empty string or zero.
True
False
17. DELETE without a WHERE clause deletes all rows but keeps the table structure.
True
False
18. Abbreviation for Data Definition Language (used to create/modify database structures):
19. Name the SQL clause to sort results in ascending/descending order:
20. SQL function to count rows in a table (full name or abbreviation):
Reset
Answered 0 of 0 — 0 correct