Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PART II - Relational Algebra Queries Consider the relational schema below and answer the next 6 questions. PK stands for primary key, and FK for

image text in transcribedimage text in transcribed

PART II - Relational Algebra Queries Consider the relational schema below and answer the next 6 questions. PK stands for primary key, and FK for foreign key. Not all the schema is shown, but you do not need the parts not seen. Make natural assumptions about what the relation attributes mean. ToyCar Collector CID PK cname fav_colour tID tname cost olD tID cID colour Owned PK FK to ToyCar (tID) FK to Collector (CID) tID Available_Colours PK, FK to ToyCar(tID) PK colour Question 3 40 pt Write a relational algebra query for each of the following questions: A) [5 points] List the names of collectors whose favorite car colour is either 'black' or 'red' B) [5 points] List the names of collectors who own 'black' toy cars. C) [5 points] List the names of collectors who own 'red' toy cars (reporting the name of the toy car). D) (7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that come in the collector's favourite colour. E) (7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that do not come in the collector's favourite colour. F) [BONUS 10 points] List collectors who own toy cars in all the available colours. That is, for every available colour, the collector owns a toy car in that colour. PART II - Relational Algebra Queries Consider the relational schema below and answer the next 6 questions. PK stands for primary key, and FK for foreign key. Not all the schema is shown, but you do not need the parts not seen. Make natural assumptions about what the relation attributes mean. ToyCar PK Collector CID PK chame fav_colour tID tname cost old tID CID colour tID Available_Colours PK, FK to ToyCar(tID) PK colour Question 3 40 pts Write a relational algebra query for each of the following questions: A) [5 points] List the names of collectors whose favorite car colour is either 'black' or 'red' B) [5 points] List the names of collectors who own 'black' toy cars. C) [5 points] List the names of collectors who own 'red' toy cars (reporting the name of the toy car). D) [7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that come in the collector's favourite colour. E) [7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that do not come in the collector's favourite colour F) [BONUS 10 points] List collectors who own toy cars in all the available colours. That is, for every available colour, the collector owns a toy car in that colour. PART II - Relational Algebra Queries Consider the relational schema below and answer the next 6 questions. PK stands for primary key, and FK for foreign key. Not all the schema is shown, but you do not need the parts not seen. Make natural assumptions about what the relation attributes mean. ToyCar Collector CID PK cname fav_colour tID tname cost olD tID cID colour Owned PK FK to ToyCar (tID) FK to Collector (CID) tID Available_Colours PK, FK to ToyCar(tID) PK colour Question 3 40 pt Write a relational algebra query for each of the following questions: A) [5 points] List the names of collectors whose favorite car colour is either 'black' or 'red' B) [5 points] List the names of collectors who own 'black' toy cars. C) [5 points] List the names of collectors who own 'red' toy cars (reporting the name of the toy car). D) (7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that come in the collector's favourite colour. E) (7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that do not come in the collector's favourite colour. F) [BONUS 10 points] List collectors who own toy cars in all the available colours. That is, for every available colour, the collector owns a toy car in that colour. PART II - Relational Algebra Queries Consider the relational schema below and answer the next 6 questions. PK stands for primary key, and FK for foreign key. Not all the schema is shown, but you do not need the parts not seen. Make natural assumptions about what the relation attributes mean. ToyCar PK Collector CID PK chame fav_colour tID tname cost old tID CID colour tID Available_Colours PK, FK to ToyCar(tID) PK colour Question 3 40 pts Write a relational algebra query for each of the following questions: A) [5 points] List the names of collectors whose favorite car colour is either 'black' or 'red' B) [5 points] List the names of collectors who own 'black' toy cars. C) [5 points] List the names of collectors who own 'red' toy cars (reporting the name of the toy car). D) [7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that come in the collector's favourite colour. E) [7.5 points] Show, for each collector (reporting the collector's name), the toy cars by name that do not come in the collector's favourite colour F) [BONUS 10 points] List collectors who own toy cars in all the available colours. That is, for every available colour, the collector owns a toy car in that colour

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_2

Step: 3

blur-text-image_3

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

b. Will new members be welcomed?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago

Question

b. Will there be one assigned leader?

Answered: 1 week ago