Row counts for every join type

An online shop imported its reviews table from an old system without a foreign-key constraint, so one review refers to a product that no longer exists.


products


product_id

name

P1

Kettle

P2

Toaster

P3

Blender

P4

Mixer

P5

Juicer


reviews


review_id

product_id

rating

R1

P1

5

R2

P1

4

R3

P3

2

R4

P4

5

R5

P4

3

R6

P4

4

R7

P9

1


Each query in the table lists products first and, except for the cross join, uses the condition ON products.product_id = reviews.product_id. Enter the number of rows each query returns as a whole number.

QueryRows returned
products INNER JOIN reviews
products LEFT JOIN reviews
products RIGHT JOIN reviews
products FULL OUTER JOIN reviews
products CROSS JOIN reviews

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Multiple Table Queries Questions: