← All exam tracks
MySQL 8.4 · Interview Preparation
MySQL Database
Practice original scenario-based MySQL Database questions. Take a timed mock, focus on a topic, and learn from detailed explanations. These are independent practice materials, not official exam questions or a guarantee of certification readiness.
32 questions · 48 minutes · 70% practice target
Create an account to practice
Already a member? Sign in
Topics you will practice
- Joins & SQL
- Storage Engines & Schema
- ACID & Isolation Levels
- Deadlocks & Performance
Try a sample
Think through each question, then reveal the explanation. Full attempts save your answers and scores to your account.
What does customers c LEFT JOIN orders o ON o.customer_id = c.id return?
- Only customers with orders
- Every customer, with matching orders and NULL order columns when none match
- Every order, even without a customer
- One row per customer regardless of how many orders match
Show answer and explanation
Correct answer: Every customer, with matching orders and NULL order columns when none match
LEFT JOIN preserves the left table. A customer with two matching orders produces two rows; one with no match produces a row with NULL values for the order columns.
How does LEFT JOIN differ from RIGHT JOIN in MySQL?
- LEFT JOIN sorts ascending; RIGHT JOIN sorts descending
- RIGHT JOIN only works with primary keys
- LEFT JOIN preserves the left table; RIGHT JOIN preserves the right table
- RIGHT JOIN removes unmatched rows from both tables
Show answer and explanation
Correct answer: LEFT JOIN preserves the left table; RIGHT JOIN preserves the right table
Both are outer joins. The keyword identifies which side keeps its unmatched rows; columns from the other side become NULL. Neither keyword guarantees result ordering.
Why use RIGHT JOIN when LEFT JOIN is available?
- It can express a preferred table order, but an equivalent LEFT JOIN can swap the tables
- It is always faster than LEFT JOIN
- It is required to join more than two tables
- It includes unmatched rows from both sides
Show answer and explanation
Correct answer: It can express a preferred table order, but an equivalent LEFT JOIN can swap the tables
RIGHT JOIN offers another way to express the preserved side. A RIGHT JOIN B ON A.id = B.a_id can be written B LEFT JOIN A ON A.id = B.a_id. Preserve the explicit SELECT list because SELECT * column order can change; performance is not inherently better.
Study references