Learn
Practice
Projects
Free datasets
Resources
Toolkit
Pricing
Log in
Start free
Loading…
SQL Quiz (200 Questions)
← All topics
SQL Quiz (200 Questions)
199 exercises
·
10 free
01
What Does SQL Stand For?
Free
→
02
Which Part Of SQL Is Primarily Used To Retrieve Data?
Free
→
03
SQL Is Programming Language For Storing And Processing Information In?
Free
→
04
Which Keyword Begins A Query That Retrieves Data From A Table?
Free
→
05
SQL Is Considered What Type Of Language?
Free
→
06
Which Of The Following Is A Common Relational Database System?
Free
→
07
Which Keyword Removes Duplicates In A SELECT Statement?
Free
→
08
Which Statement Changes Data In A Database?
Free
→
09
n SQL, Which Symbol Is Commonly Used As A Wildcard In Strings?
Free
→
10
Which Command Is Used To Remove Rows From A Table?
Free
→
11
Which Clause Specifies The Source Table(S) In A Query?
Locked
→
12
Which Keyword Selects All Columns From A Table?
Locked
→
13
To Select A Literal String “Hello”, You Can Write:
Locked
→
14
To Rename A Column In The Result Set, Use:
Locked
→
15
If You Omit FROM, Selecting From Where Is Possible In Standard SQL?
Locked
→
16
To Choose Columns “Name” And “Age” From Table “Persons”:
Locked
→
17
A SELECT Statement Without A WHERE Clause Returns:
Locked
→
18
To Avoid Specifying A Table Alias, You Can:
Locked
→
19
Which Of These Is A Valid SELECT Syntax?
Locked
→
20
Using SELECT Without Specifying Columns Returns:
Locked
→
21
The WHERE Clause Is Used To:
Locked
→
22
To Select Rows Where Age > 18:
Locked
→
23
To Match Rows Where Name Starts With ‘A’:
Locked
→
24
To Select Rows Where City Is Either ‘Paris’ Or ‘London’:
Locked
→
25
The WHERE Clause Is Placed:
Locked
→
26
To Find Rows Where Salary Is NOT 5000:
Locked
→
27
Which Operator Checks For NULL Values?
Locked
→
28
To Exclude Rows With Age = 30:
Locked
→
29
To Use A Pattern To Filter Rows Containing ‘Abc’ Anywhere In Name:
Locked
→
30
To Filter Rows Where Price Is Between 10 And 20 Inclusive:
Locked
→
31
Which Function Returns The Number Of Rows?
Locked
→
32
SUM() Function Is Used To:
Locked
→
33
MIN() Function Returns:
Locked
→
34
MAX() Function Returns:
Locked
→
35
AVG() Function Returns:
Locked
→
36
COUNT(*) Differs From COUNT(Column) By:
Locked
→
37
To Get Total Sales From ‘Orders’ Table With ‘Amount’ Column:
Locked
→
38
To Find The Lowest Salary In Employees Table:
Locked
→
39
To Count Rows Ignoring NULL In Column ‘Age’:
Locked
→
40
Which Function Can Remove Duplicates When Counting Distinct Values?
Locked
→
41
GROUP BY Is Used To:
Locked
→
42
GROUP BY Must Be Used With:
Locked
→
43
HAVING Clause Filters Rows After:
Locked
→
44
To Find Total Sales Per Department:
Locked
→
45
HAVING Is Used To Filter Groups, For Example Groups With SUM(Sales)>1000:
Locked
→
46
If A SELECT Uses GROUP BY, Columns Not Aggregated Must Be:
Locked
→
47
Average Salary By Job_title But Only Show Groups With Avg>5000:
Locked
→
48
Without GROUP BY, HAVING Acts Like WHERE, But Standard SQL Requires:
Locked
→
49
Count Employees Per Department And Only Show Departments With Count>10:
Locked
→
50
You Cannot Use HAVING Without What?
Locked
→
51
ORDER BY Is Used To:
Locked
→
52
By Default ORDER BY Sorts In:
Locked
→
53
To Sort By Name Ascending And Age Descending:
Locked
→
54
ORDER BY Must Come:
Locked
→
55
To Sort By A Column Not In SELECT, Generally:
Locked
→
56
To Sort By Multiple Columns, Separate By:
Locked
→
57
To Get Alphabetical Order On ‘Name’:
Locked
→
58
To Reverse The Sorting Order:
Locked
→
59
If No ORDER BY Specified, Order Of Rows Is:
Locked
→
60
ORDER BY Can Sort By Column Position Using:
Locked
→
61
INNER JOIN Returns:
Locked
→
62
LEFT JOIN Returns:
Locked
→
63
RIGHT JOIN Returns:
Locked
→
64
FULL OUTER JOIN Returns:
Locked
→
65
To Join ‘Orders’ And ‘Customers’ Where Orders.cust_id=Customers.id:
Locked
→
66
INNER JOIN Is Also Called:
Locked
→
67
To Get All Customers Even If They Have No Orders:
Locked
→
68
CROSS JOIN Returns:
Locked
→
69
To Filter Joined Results, Use Conditions In:
Locked
→
70
If You Want All Rows From Both Tables With No Match Replaced By NULLs:
Locked
→
71
A Subquery Is:
Locked
→
72
Subqueries Are Often Used In:
Locked
→
73
A Scalar Subquery Returns:
Locked
→
74
To Find Rows With Value Greater Than The Average, Use:
Locked
→
75
A Derived Table Is A Subquery Used:
Locked
→
76
A Subquery Returning Multiple Values Can Be Used With:
Locked
→
77
Correlated Subqueries:
Locked
→
78
To Use A Subquery As A Column List:
Locked
→
79
Subqueries Can Appear In:
Locked
→
80
A Derived Table Must Have:
Locked
→
81
UNION Combines:
Locked
→
82
UNION Requires:
Locked
→
83
UNION By Default Removes Duplicates. To Keep Duplicates Use:
Locked
→
84
INTERSECT Returns:
Locked
→
85
EXCEPT Returns:
Locked
→
86
Set Operations Typically Require:
Locked
→
87
UNION ALL Vs UNION Differs By:
Locked
→
88
INTERSECT And EXCEPT Might Not Be Supported By All SQL Dialects. A Common Replacement For INTERSECT Is:
Locked
→
89
Set Operators Combine Results Of Multiple SELECTs. The Correct Syntax Usually Is:
Locked
→
90
EXCEPT Is Sometimes Known As:
Locked
→
91
CREATE TABLE Is Used To:
Locked
→
92
B. Removes table structure and data
Locked
→
93
ALTER TABLE Is Used To:
Locked
→
94
To Remove A Column From A Table:
Locked
→
95
CREATE TABLE Syntax Generally Includes:
Locked
→
96
To Rename A Table:
Locked
→
97
To Add A New Column:
Locked
→
98
DDL Statements Like CREATE, DROP, ALTER Usually:
Locked
→
99
To Completely Remove A Table And Its Data:
Locked
→
100
To Remove All Rows But Keep Table Structure:
Locked
→
101
INSERT Is Used To:
Locked
→
102
UPDATE Changes:
Locked
→
103
DELETE Removes:
Locked
→
104
INSERT INTO Table (Col1, Col2) VALUES (Val1, Val2):
Locked
→
105
To Update A Row’s Salary In Employees:
Locked
→
106
DELETE FROM Table WHERE Condition:
Locked
→
107
To Insert Multiple Rows At Once (Some Dialects Allow):
Locked
→
108
Without WHERE In UPDATE Or DELETE:
Locked
→
109
INSERT Can Be Combined With SELECT To:
Locked
→
110
TRUNCATE TABLE Differs From DELETE Because:
Locked
→
111
PRIMARY KEY Ensures:
Locked
→
112
FOREIGN KEY Enforces:
Locked
→
113
UNIQUE Constraint Ensures:
Locked
→
114
NOT NULL Ensures:
Locked
→
115
CHECK Constraint Allows:
Locked
→
116
A Table Can Have How Many PRIMARY KEY Constraints?:
Locked
→
117
FOREIGN KEY References:
Locked
→
118
UNIQUE Differs From PRIMARY KEY In That:
Locked
→
119
To Ensure Age > 0 In A Column, Use:
Locked
→
120
Constraints Are Defined Usually In:
Locked
→
121
A VIEW Is:
Locked
→
122
CREATE VIEW Syntax Includes:
Locked
→
123
A MATERIALIZED VIEW Is:
Locked
→
124
Views Can Be Used To:
Locked
→
125
To Refresh A Materialized View (In Systems That Support It):
Locked
→
126
Dropping A View:
Locked
→
127
Some Views Are Updatable If:
Locked
→
128
A View Does Not Physically Store Data Except:
Locked
→
129
To Ensure View Runs A Complex Query Efficiently Without Recalculating Each Time, Use:
Locked
→
130
Views Can Be Used For Security By:
Locked
→
131
An Index Is Used To:
Locked
→
132
A Primary Key Usually Creates:
Locked
→
133
Adding Too Many Indexes Can:
Locked
→
134
A Clustered Index:
Locked
→
135
Non-Clustered Index Stores:
Locked
→
136
To Analyze Query Performance, One Might Use:
Locked
→
137
Indexes Help SELECT Queries But Can Slow Down:
Locked
→
138
A Good Candidate For Indexing Is:
Locked
→
139
Removing Unused Indexes Can:
Locked
→
140
Indexes Are Created By:
Locked
→
141
A Window Function Is Defined Using:
Locked
→
142
Window Functions Allow Calculations:
Locked
→
143
PARTITION BY In Window Functions:
Locked
→
144
ROW_NUMBER() Function:
Locked
→
145
RANK() Vs ROW_NUMBER():
Locked
→
146
LAG() And LEAD() Functions Allow:
Locked
→
147
NTILE(N) Divides Rows Into:
Locked
→
148
To Use Window Functions, OVER Clause Is Mandatory Because:
Locked
→
149
Window Functions Do Not Collapse Rows Like GROUP BY. They:
Locked
→
150
ORDER BY Inside OVER(…) Defines:
Locked
→
151
A CTE Starts With:
Locked
→
152
A CTE Is Defined For:
Locked
→
153
CTEs Can Be Used To:
Locked
→
154
A CTE Resembles A Derived Table, But:
Locked
→
155
Recursive CTEs Allow:
Locked
→
156
Syntax Of A Basic CTE:
Locked
→
158
CTEs Are Not Stored Persistently; They Are:
Locked
→
159
Recursive CTEs Need:
Locked
→
160
CTEs Improve Readability Compared To:
Locked
→
161
String Functions Like LENGTH() Or CHAR_LENGTH() Return:
Locked
→
162
SUBSTRING(String, Start, Length) Extracts:
Locked
→
163
UPPER() And LOWER() Functions Change String Case To:
Locked
→
164
Date Functions Like NOW() Or CURRENT_DATE():
Locked
→
165
EXTRACT(YEAR FROM Date) Returns:
Locked
→
166
DATEADD Or ADD_MONTHS Are Used To:
Locked
→
167
CASE Expression Allows:
Locked
→
168
CASE WHEN Condition THEN Value ELSE Other END:
Locked
→
169
String Functions Like CONCAT(S1,S2):
Locked
→
170
COALESCE(Expr1, Expr2, …) Returns:
Locked
→
171
A Stored Procedure Is:
Locked
→
172
A Stored Function Differs From A Procedure By:
Locked
→
173
CREATE PROCEDURE Syntax Varies By Dialect, But Generally Includes:
Locked
→
174
Stored Procedures Can Improve Performance By:
Locked
→
175
Functions Are Often Used In SELECT Statements Because:
Locked
→
176
Stored Procedures Can Accept IN, OUT Parameters To:
Locked
→
177
In PL/SQL Or T-SQL, You Can Write:
Locked
→
178
To Drop A Stored Procedure:
Locked
→
179
Stored Functions Must:
Locked
→
180
Procedures And Functions Enhance:
Locked
→
181
A Transaction Is:
Locked
→
182
COMMIT Saves Changes Made During A Transaction:
Locked
→
183
ROLLBACK Undoes:
Locked
→
184
BEGIN Or START TRANSACTION Begins:
Locked
→
185
Isolation Levels Define:
Locked
→
186
A Common Isolation Level Is:
Locked
→
187
Locking Is Used To Prevent:
Locked
→
188
Deadlocks Occur When:
Locked
→
189
COMMIT Ends A Transaction And Makes Changes:
Locked
→
190
SAVEPOINT Allows:
Locked
→
191
Partitioning A Table Means:
Locked
→
192
Horizontal Partitioning Splits Data By:
Locked
→
193
Vertical Partitioning Splits Data By:
Locked
→
194
Sharding Is A Form Of Partitioning Where:
Locked
→
195
Caching Query Results In Memory Can:
Locked
→
196
vertical Partitioning Splits Data By:
Locked
→
197
Table Partitioning Can Improve Performance By:
Locked
→
198
Parallel Query Execution Means:
Locked
→
199
Compression In Databases Can:
Locked
→
200
Advanced Partitioning Strategies And Indexing Can Lead To:
Locked
→