Menu For Bytes Of China step 12

Hi

I am doing Build A Menu For Bytes Of China exercise and I am stuck with step 12

https://www.codecademy.com/paths/design-databases-with-postgresql/tracks/how-do-i-make-and-populate-my-own-database/modules/designing-a-database-schema/projects/restaurant-database-project-with-postgresql

My definitions for tables are:

CREATE TABLE category (

id char(2) PRIMARY KEY,

name varchar(20),

description varchar(200)

);

CREATE TABLE dish (

id integer PRIMARY KEY,

name char(50),

description varchar(200),

hot_and_spicy boolean

);

CREATE TABLE review (

id integer PRIMARY KEY,

rating decimal,

description varchar(100),

date date,

restaurant_id integer REFERENCES restaurant(id)

);

CREATE TABLE categories_dishes (

category_id char(2) REFERENCES category(id),

dish_id integer REFERENCES dish(id),

price money,

PRIMARY KEY (category_id, dish_id)

);

And query for step 12 is :
SELECT
dish.name as dish_name, category.name as category, categories_dishes.price as price
FROM dish, categories_dishes, category
WHERE
category.id = categories_dishes.category_id AND
categories_dishes.dish_id = dish_id
ORDER BY dish.name;

But for some reason instead of 8 rows I get like over 20 rows with different combinations

Thank you for help in advance

It’s because in your WHERE statement you have categories_dishes.dish_id = dish_id instead of categories_dishes.dish_id = dish.id.