Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago