Consider the following relations for a simple airport databas Hangars (hangNo, capacity, location, status) AirplaneTypes (Model, capacity, weight) Airplanes (regNo, model, hangNO) Owners (owner, name, address, phone, ssn) Owns (regNo, ownID, startedDate) There are four foreign keys for this database: 1. The attribute hangNo of the relation Airplanes that references the relation Hangars, 2. The attribute model of the relation Airplanes that references the relation AirplaneTypes, 3. The attribute regNo of the relation Owns that references the relation Airplanes, and 4. The attribute ownID of the relation Owns that references the relation Owner. Q1: Write SQL statements to define the above relation Hangars. You should choose a suitable data type and/or daya size for each column and be sure to declare appropriate integrity constraint(s). Q2. Which of the following SQL statements is used to define the above relation Airplanes? Ensure the data type and size for each attribute are appropriate and integrity constraint(s) are declared. A. CREATE TABLE Airplanes ( regNo VARCHAR(5), model VARCHAR(6), hangNo CHAR(5), FOREIGN KEY( model ) REFERENCES AirplaneTypes)Model, FOREIGN KEY( hangNo ) REFERENCES Hangars (hangNo)); B. CREATE TABLE Airplanes ( regNo VARCHAR(5), model CHAR(6), hangNo CHAR(5), UNIQUE KEY(regNo), FOREIGN KEY( model ) REFERENCES AirplaneTypes(model), FOREIGN KEY( hang no ) references Hangars (handNo)); C. CREATE TABLE Airplanes ( regNo VARCHAR(5), model CHAR(6), hangNo CHAR(5), PRIMARY KEY(regNo), FOREIGN KEY( model ) REFERENCES AirplaneTypes(model), FOREIGN KEY( hangNo ) REFERENCES Hangars (hangNo)); D. CREATE TABLE Airplanes ( regNo VARCHAR(5), model VARCHAR(6), hangNo CHAR(5), PRIMARY KEY(regNo)); Q3. Which of the following SQL statements is used to define the above relation Owns? Make sure that the data type and size for each attribute are appropriate and integrity constraint(s) are declared. Assume that no referential integrity constraints violations. A. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PRIMARY KEY(regNo), PRIMARY KEY(ownID), FOREIGN KEY( regNo) REFERENCES Airplanes(regNo), FOREIGN KEY( ownID) REFERENCES Owners (ownID)); B. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate INT, UNIQUE KEY(regNo, ownID)); C. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PRIMARY KEY(regNo, ownID), FOREIGN KEY( regNo) REFERENCES Airplanes(regNo), FOREIGN KEY(ownID) REFRRENCES Owners (ownID)); D. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PROMARY KEY(regNo, ownID)); RENCES Branches (branchName));

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Consider the following relations for a simple airport databas Hangars (hangNo, capacity, location, status) AirplaneTypes (Model, capacity, weight) Airplanes (regNo, model, hangNO) Owners (owner, name, address, phone, ssn) Owns (regNo, ownID, startedDate) There are four foreign keys for this database: 1. The attribute hangNo of the relation Airplanes that references the relation Hangars, 2. The attribute model of the relation Airplanes that references the relation AirplaneTypes, 3. The attribute regNo of the relation Owns that references the relation Airplanes, and 4. The attribute ownID of the relation Owns that references the relation Owner. Q1: Write SQL statements to define the above relation Hangars. You should choose a suitable data type and/or daya size for each column and be sure to declare appropriate integrity constraint(s). Q2. Which of the following SQL statements is used to define the above relation Airplanes? Ensure the data type and size for each attribute are appropriate and integrity constraint(s) are declared. A. CREATE TABLE Airplanes ( regNo VARCHAR(5), model VARCHAR(6), hangNo CHAR(5), FOREIGN KEY( model ) REFERENCES AirplaneTypes)Model, FOREIGN KEY( hangNo ) REFERENCES Hangars (hangNo)); B. CREATE TABLE Airplanes ( regNo VARCHAR(5), model CHAR(6), hangNo CHAR(5), UNIQUE KEY(regNo), FOREIGN KEY( model ) REFERENCES AirplaneTypes(model), FOREIGN KEY( hang no ) references Hangars (handNo)); C. CREATE TABLE Airplanes ( regNo VARCHAR(5), model CHAR(6), hangNo CHAR(5), PRIMARY KEY(regNo), FOREIGN KEY( model ) REFERENCES AirplaneTypes(model), FOREIGN KEY( hangNo ) REFERENCES Hangars (hangNo)); D. CREATE TABLE Airplanes ( regNo VARCHAR(5), model VARCHAR(6), hangNo CHAR(5), PRIMARY KEY(regNo)); Q3. Which of the following SQL statements is used to define the above relation Owns? Make sure that the data type and size for each attribute are appropriate and integrity constraint(s) are declared. Assume that no referential integrity constraints violations. A. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PRIMARY KEY(regNo), PRIMARY KEY(ownID), FOREIGN KEY( regNo) REFERENCES Airplanes(regNo), FOREIGN KEY( ownID) REFERENCES Owners (ownID)); B. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate INT, UNIQUE KEY(regNo, ownID)); C. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PRIMARY KEY(regNo, ownID), FOREIGN KEY( regNo) REFERENCES Airplanes(regNo), FOREIGN KEY(ownID) REFRRENCES Owners (ownID)); D. CREATE TABLE Owns ( regNo VARCHAR(5), ownID CHAR(7), startedDate DATE, PROMARY KEY(regNo, ownID)); RENCES Branches (branchName));
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Dataset
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education