Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table recipe ( recipe_id serial, name varchar ); insert into recipe (name) values ('Pasta'), ('Pizza '), ('Fish'); create table ingredient ( ingredient_id serial, name varchar ); insert into ingredient (name) values ('Spaghetti'), ('Salmon '), ('Tomato sauce'); create table recipe_ingredient ( id serial, recipe_id int, ingredient_id int ); insert into recipe_ingredient (recipe_id, ingredient_id) select recipe_id, ingredient_id from recipe, ingredient where recipe.name = 'Pasta' and ingredient.name in ('Spaghetti', 'Tomato sauce'); select * from recipe_ingredient;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear