Write a script to create the following tables with attributes
as specified(SQL)
Customer table with Customer’s...
Write a script to create the following tables with attributes
as specified(SQL)
Customer table with Customer’s id, name, address, city as
varchar, customer’s date of birth as date type and zip code number
where the customers id is the primary key in the table, name and
date of birth are mandatory. Id has a 10-character limit, name,
address and city have a 50-character limit, zip has a 5-character
limit
Product Table with Product id, description and finish as
varchar, price...
Space X Bank
CREATE TABLE Branch(BranchIDNumber VARCHAR(15) PRIMARY KEY NOT
NULL, BranchName VARCHAR(6) NOT NULL, Address...
Space X Bank
CREATE TABLE Branch(BranchIDNumber VARCHAR(15) PRIMARY KEY NOT
NULL, BranchName VARCHAR(6) NOT NULL, Address VARCHAR(50) NOT NULL,
City TEXT NULL,
State CHAR(2) NULL, ZipCode INT(11) NOT NULL, OfficeNum VARCHAR(15)
NOT NULL, FaxNum VARCHAR(15) NOT NULL);
CREATE TABLE Employee(EmployeeIDNumber VARCHAR(15) NOT
NULL,FirstName VARCHAR(35) NOT NULL, LastName VARCHAR(35) NOT
NULL,
Email VARCHAR(100) NOT NULL, BranchIDNumber VARCHAR(11) NOT NULL,
FOREIGN KEY(BranchIDNumber) REFERENCES
Branch(BranchIDNumber),
JobTitle ENUM("Manager","Staff") NOT NULL, Salary DECIMAL(8, 2) NOT
NULL, HomeNumber VARCHAR(13) NULL, CellNumber VARCHAR(13) NOT
NULL);
CREATE TABLE...
1. Suppose StudentID is the primary key of one table (e.g., the
Students table) and the...
1. Suppose StudentID is the primary key of one table (e.g., the
Students table) and the foreign key of another table (e.g., the
Top10DesiredJobs table). If you can’t enforce the referential
integrity relationship between these two tables, what might be the
cause?
Select one:
a. The values of the primary key column are referenced by the
values of the foreign key column.
b. The foreign key contains duplicate data.
c. The foreign key column contains values that do not exist...
The Horse table has the following columns:
ID - integer, primary key
RegisteredName - variable-length string...
The Horse table has the following columns:
ID - integer, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Write a SELECT statement to select the registered name, height,
and birth date for only horses that have a height between 15.0 and
16.0 (inclusive) or have a birth date on or after January 1,
2020.
CREATE TABLE Customers
(Customer# NUMBER(4),
LastName VARCHAR2(10) NOT NULL,
FirstName VARCHAR2(10) NOT NULL,
Address VARCHAR2(20),
City...
CREATE TABLE Customers
(Customer# NUMBER(4),
LastName VARCHAR2(10) NOT NULL,
FirstName VARCHAR2(10) NOT NULL,
Address VARCHAR2(20),
City VARCHAR2(12),
State VARCHAR2(2),
Zip VARCHAR2(5),
Referred NUMBER(4),
Region CHAR(2),
Email VARCHAR2(30),
CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#),
CONSTRAINT customers_region_ck
CHECK (region IN ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E'))
);
CREATE TABLE Orders
(Order# NUMBER(4),
Customer# NUMBER(4),
OrderDate DATE NOT NULL,
ShipDate DATE,
ShipStreet VARCHAR2(18),
ShipCity VARCHAR2(15),
ShipState VARCHAR2(2),
ShipZip VARCHAR2(5),
ShipCost NUMBER(4,2),
CONSTRAINT orders_order#_pk PRIMARY KEY(order#),
CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#)
REFERENCES customers(customer#));
In...
The Movie table has the following columns:
ID - integer, primary key
Title - variable-length string...
The Movie table has the following columns:
ID - integer, primary key
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
Year - integer
Write a SELECT statement to select the year and the total number
of movies for that year.
Hint: Use the COUNT() function and GROUP BY clause.
You are hired to design a database for
a fitness center. As the fitness center is...
You are hired to design a database for
a fitness center. As the fitness center is expanding with more than
one branch, they want to create a database to keep track of its
customers, facilities and employees. Each branch has a unique id
and address (building number, street, district, and city). A branch
may have more than one facility (e.g. swimming pool, spa, etc.).
Each facility must belong to only one branch, and the information
for a facility is name...