Question: Write SQL quries based on the following schema and tables. CREATE TABLE Person( Id INTEGER PRIMARY KEY, name VARCHAR (20) UNIQUE NOT NULL CREATE TABLE
Write SQL quries based on the following schema and tables. CREATE TABLE Person( Id INTEGER PRIMARY KEY, name VARCHAR (20) UNIQUE NOT NULL CREATE TABLE Beer( Id INTEGER PRIMARY KEY name VARCHAR (20) UNIQUE NOT NULL CREATE TABLE Bar ( Id INTEGER PRIMARY KEY name VARCHAR (20) UNIQUE NOT NULL CREATE TABLE Likes ( PersonId INTEGER NOT NULL REFERENCES Person (Id) BeerId INTEGER NOT NULL REFERENCES Beer (Id) CONSTRAINT LikesPK PRIMARY KEY (PersonId, Beerla) CREATE TABLE Serves BarId INTEGER NOT NULL REFERENCES Bar(Id) BeerId INTEGER NOT NULL REFERENCES Beer (d) CONSTRAINT ServesPK PRIMARY KEY (Barid, Beerid) CREATE TABLE Goes( Personid INTEGER NOT NULL REFERENCES Person (Id), Barid INTEGER NOT NULL REFERENCES Bar (Id), CONSTRAINT GoesPK PRIMARY KEY (PersonId, Barid) BE RSO BAR ld Name ld Name Name SERVES GOES Personid Barld Barld Beerld LIKES erson Boend
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
