Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I -2 (4 points) Write an SQL statement to add an attribute difficultyLevel to the relation raceLap . Add an attribute name to the relation

image text in transcribed

I -2 (4 points) Write an SQL statement to add an attribute difficultyLevel to the relation raceLap. Add an attribute name to the relation race and set name, location to be a foreign key in the relation race references the relation raceLap. In case of lap record is removed from the raceLap, this will reflect on the race table and remove. Note values of difficultyLevel are 1,2,3

When writing a query, write the query in a way that it would work over all possible database instances and not just for the given example instance! Consider the following database schema and example instance for a race car database: Good luck Racer A id Name 1 Sam 2 Suzan 3 Alice gender Birth year M 1984 IF 1982 IF 1980 Manufacturer Hourse power Mercedes 1000 Ferrari 5000 Mercedes 700 Race Result result id id rid Aid Time R1_1 C1R1 11 400 R1_2 c2 R12 600 R13c3R13 375 Rid Type Location R1 F1 UK R2 RallyCross Portugal R3F1 USA Sponsor Rid CID R1 C1 R13 R2 04 Sponsor Motorola Pepsi Michelin Schema: Racer: (A id, Name, gender, birth year) Race (Lid type.location) Result (result id, uid, Aid.R.id, time).id is a foreign key for car and Aid is foreign key for Racer and R.id is a foreign key for Race Sponsor (R.id. C ID. Sponsor) Car (sid, make, horsepower) When writing a query, write the query in a way that it would work over all possible database instances and not just for the given example instance! Consider the following database schema and example instance for a race car database: Good luck Racer A id Name 1 Sam 2 Suzan 3 Alice gender Birth year M 1984 IF 1982 IF 1980 Manufacturer Hourse power Mercedes 1000 Ferrari 5000 Mercedes 700 Race Result result id id rid Aid Time R1_1 C1R1 11 400 R1_2 c2 R12 600 R13c3R13 375 Rid Type Location R1 F1 UK R2 RallyCross Portugal R3F1 USA Sponsor Rid CID R1 C1 R13 R2 04 Sponsor Motorola Pepsi Michelin Schema: Racer: (A id, Name, gender, birth year) Race (Lid type.location) Result (result id, uid, Aid.R.id, time).id is a foreign key for car and Aid is foreign key for Racer and R.id is a foreign key for Race Sponsor (R.id. C ID. Sponsor) Car (sid, make, horsepower)

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

More Books

Students also viewed these Databases questions