Design a set of database tables to store people and cars. A person has a name, a
ID: 3921514 • Letter: D
Question
Design a set of database tables to store people and cars. A person has a name, a unique driver license number, and an address. Every car has a unique vehicle identification number, manufacturer, type, and year. Every car has one owner, but one person can own multiple cars. Show the CREATE TABLE statements that could be used to create these two tables. Give SQL commands to create a Book table, with columns for the ISBN, author, and title, and to insert all textbooks that you are using this semester. Using the tables for the invoice database used as an example in chapter 24, give a SQL query that lists all customers who have an unpaid invoice (the amount paid on the invoice is zero).Explanation / Answer
CREATE TABLE Persons
{
Name varchar(255),
License varchar(255) NOT NULL PRIMARY KEY,
Address varchar(255)
};
CREATE TABLE Cars
{
VehicleID int NOT NULL PRIMARY KEY,
Manufacturer varchar(255),
Type varchar(255),
Year int,
owner varchar(255)
};
Explanation
CREATE TABLE table_name
(
column1 type(size),
column2 type(size),
column3 type(size),
....
);
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.