SQL Basics: Medium Quiz
Eight medium-difficulty multiple-choice questions covering key SQL concepts, patterns, and consequences for querying and data design.
Try this quiz
Play through the questions and see your score instantly
Ready to test your knowledge?
8 questions · Quick play · Instant results
Make your own quiz videos
Turn any topic into a polished video quiz — with AI-powered questions, voiceover, and animations. No video editing skills needed.
Unlimited quizzes, free to start
Create as many quizzes as you want. Describe your topic and AI builds the questions, answers, and explanations for you.
Customise everything
Pick from stunning templates, tweak colours and fonts, add your branding, and choose between vertical or landscape formats.
Export-ready videos
Download HD videos optimised for TikTok, YouTube Shorts, Instagram Reels, or full-length YouTube — one click, no editing.
No credit card required
Quiz Questions & Answers
Review every prompt, the correct responses, and helpful context to prep for your own run-through.
Question 1: What is the primary purpose of an SQL PRIMARY KEY constraint?
To automatically back up table data
To enforce referential integrity on other tables
To uniquely identify each row in a table
To speed up text search across columns
Question 2: Which SQL clause filters rows after grouping results with GROUP BY?
WHERE
LIMIT
HAVING
ORDER BY
Question 3: Which JOIN returns only rows present in both tables based on a match condition?
INNER JOIN
FULL OUTER JOIN
LEFT JOIN
CROSS JOIN
Question 4: Why prefer parameterized queries over string concatenation when building SQL statements?
Because parameters compress data on disk
To automatically normalize the database
Because concatenation is slower for small tables
To prevent SQL injection and improve plan reuse
Question 5: Which statement correctly explains a correlated subquery?
A subquery that only returns aggregated values
A subquery that references columns from the outer query for each row
A subquery stored as a view
A subquery that always runs once before the main query
Question 6: When should you use an index on a column?
When you want automatic foreign key enforcement
When the column contains mostly NULL values to save space
When the table has fewer than ten rows
When the column is frequently used in WHERE, JOIN, or ORDER BY operations
Question 7: What is the effect of using SELECT DISTINCT on a query result?
Removes duplicate rows from the result set
Automatically groups results by the first column
Returns only rows with non-null values
Ensures result rows are returned in a stable order
Question 8: Which approach is usually best to calculate running totals efficiently in SQL?
Use window functions like SUM() OVER (ORDER BY ...)
Export to a spreadsheet and compute there
Use nested correlated subqueries for each row
Create many temporary tables for each prefix