Question:Large Perimeters
Let's create a picture using this basic JOIN.
Write a query to select the shapes that have a perimeter greater than 400.
answer code:
SELECT *
FROM shapes
JOIN perimeters ON shapes.id = perimeters.shape_id
WHERE perimeters.perimeter > 400;
by the code giving error--> Try using ON id = shape_id
now please help me to solve this code.

MD NAYEEMPosted Mar 22, 2025, 7:26 PM
I execute the code again but the same error occuring after the code execution.
SELECT * FROM shapes JOIN perimeters ON shapes.id = perimeters.shape_id WHERE perimeters.perimeter > 400;
error: Try using ON id = shape_id
MD NAYEEMPosted Mar 22, 2025, 7:15 PM
I run that code:
SELECT * FROM shapes JOIN perimeters ON shapes.id = perimeters.shape_id WHERE perimeters.perimeter > 400;
but the problem has not solved yet.
Try using ON id = shape_id
Eliana BlakePosted Mar 22, 2025, 7:04 PM
It seems like the error you encountered is related to the way you specified the join condition in your SQL query. The error message is suggesting that you try using "ON id = shape_id" instead of "ON shapes.id = perimeters.shape_id". Let's correct that for you.
Here's the updated SQL query to select the shapes with a perimeter greater than 400:
By specifying the join condition correctly as "ON id = shape_id", you ensure that the query properly links the shapes table with the perimeters table based on their respective IDs. This adjustment should help you retrieve the desired data where the perimeter is greater than 400.
Feel free to execute this revised query, and let me know if you encounter any further issues or if you need more assistance with SQL queries.