clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591652 fiddles created (45709 in the last week).

select version();
version
PostgreSQL 12.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit
 hidden batch(es)


CREATE TABLE meal ( mname TEXT NOT NULL );
 hidden batch(es)


CREATE TABLE drink ( dname TEXT NOT NULL )
 hidden batch(es)


INSERT INTO meal (mname) VALUES ('Omlette'), ('Fried Egg'), ('Sausage');
3 rows affected
 hidden batch(es)


INSERT INTO drink (dname) VALUES ('Coffee'), ('Tea'), ('Orange Juice');
3 rows affected
 hidden batch(es)


SELECT * FROM meal, drink;
mname dname
Omlette Coffee
Omlette Tea
Omlette Orange Juice
Fried Egg Coffee
Fried Egg Tea
Fried Egg Orange Juice
Sausage Coffee
Sausage Tea
Sausage Orange Juice
 hidden batch(es)


SELECT * FROM meal CROSS JOIN drink;
mname dname
Omlette Coffee
Omlette Tea
Omlette Orange Juice
Fried Egg Coffee
Fried Egg Tea
Fried Egg Orange Juice
Sausage Coffee
Sausage Tea
Sausage Orange Juice
 hidden batch(es)


SELECT m.mname, d.dname FROM meal m CROSS JOIN drink d;
mname dname
Omlette Coffee
Omlette Tea
Omlette Orange Juice
Fried Egg Coffee
Fried Egg Tea
Fried Egg Orange Juice
Sausage Coffee
Sausage Tea
Sausage Orange Juice
 hidden batch(es)


SELECT m.mname, d.dname FROM meal m JOIN drink d ON TRUE; -- or 1 = 1;
mname dname
Omlette Coffee
Omlette Tea
Omlette Orange Juice
Fried Egg Coffee
Fried Egg Tea
Fried Egg Orange Juice
Sausage Coffee
Sausage Tea
Sausage Orange Juice
 hidden batch(es)