MySQL Database

← 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?

  1. Only customers with orders
  2. Every customer, with matching orders and NULL order columns when none match
  3. Every order, even without a customer
  4. 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?

  1. LEFT JOIN sorts ascending; RIGHT JOIN sorts descending
  2. RIGHT JOIN only works with primary keys
  3. LEFT JOIN preserves the left table; RIGHT JOIN preserves the right table
  4. 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?

  1. It can express a preferred table order, but an equivalent LEFT JOIN can swap the tables
  2. It is always faster than LEFT JOIN
  3. It is required to join more than two tables
  4. 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