We need to build a database for a race track about horse races: Races have a Nam
ID: 3776842 • Letter: W
Question
We need to build a database for a race track about horse races: Races have a Name and Length Horses are described by Horse Name, Age, and Owner Name Jockeys are described by Jockey Name and Age A jockey is affiliated with a particular club. For clubs we need to store their Names and Addresses. A club has one or more jockeys. The same race can take place multiple times. Jockeys and horses can participate in different races; a jockey can ride different horses and a horse can be handled by different jockeys. For each race we need to record the date of the race, participating jockeys and horses they ride, and also jockeys' results.Explanation / Answer
CREATE TABLE Horses
(
name varchar(256),
age int NOT NULL,
hourse_ID int
PRIMARY KEY (name),
owner_name varchar(255)
)
CREATE TABLE Race
(
name varchar(256),
length int NOT NULL,
PRIMARY KEY(name)
FOREIGN KEY (name) REFERENCES Horses(P_Id)
FOREIGN KEY (P_Id) REFERENCES jockey(P_Id)
)
CREATE TABLE Jockey
(
name varchar(256),
age int NOT NULL,
PRIMARY KEY (p_id)
)
CREATE TABLE Club
(
name varchar(256),
address int NOT NULL,
FOREIGN KEY (P_Id) REFERENCES jockey(P_Id)
)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.