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 the ER Diagram by using the following information.
Department Information
A department has a name,...
Create the ER Diagram by using the following information.
Department Information
A department has a name, a web address, a main phone number, an
email address and a main mailing address. The address contains
street number, street name, city, zip code and state. The entire
department address can also be retrieved as a unit.
Building Information
A building of a campus has a name, number of rooms, number of
floors, and a mailing address (similar in format to department
address)....
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.