Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL POSTGRES you got the following tables: 1. Players (ID, name, gender, height) 2 PK-Primary key Z FR-Foreign key 2. Scores (player ID, competitions, sport

image text in transcribed
image text in transcribed
SQL POSTGRES you got the following tables: 1. Players (ID, name, gender, height) 2 PK-Primary key Z FR-Foreign key 2. Scores (player ID, competitions, sport b, result) -Pk , and players is also a Fk that references to Players fable (ID), while sportid is also a FK that references to sports table (ID) - see table 3 below: 3. Sports (10, name, record) Note: name is UNIQUE. 4. Competition (IV), place, held) PK the competition ID on Scores table is a Fk that references to table & above. Based on these 4 tables, write a singe query (as simple as you possibly can) in order to retrieve the following info: -Select the ID and name of players who have the worst result in some sport and have only competel in one other sport (2 sports total) SQL POSTGRES you got the following tables: 1. Players (ID, name, gender, height) 2 PK-Primary key Z FR-Foreign key 2. Scores (player ID, competitions, sport b, result) -Pk , and players is also a Fk that references to Players fable (ID), while sportid is also a FK that references to sports table (ID) - see table 3 below: 3. Sports (10, name, record) Note: name is UNIQUE. 4. Competition (IV), place, held) PK the competition ID on Scores table is a Fk that references to table & above. Based on these 4 tables, write a singe query (as simple as you possibly can) in order to retrieve the following info: -Select the ID and name of players who have the worst result in some sport and have only competel in one other sport (2 sports total)

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

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

More Books

Students also viewed these Databases questions