3 of 3
Paper No: 1
Question 1:
[2] Create one database and then write SQL statements to create, in this database, all tables
derived from the ERD given in the following picture with appropriate attributes, primary keys
and foreign keys.
NOTE that when creating the SQL commands as request, you MUST keep the name of
tables, relationship, attributes and data type of attributes as SAME as given in the given
ERD.
Attributes with underline belong to the Primary Key of each entity.
Attributes which reference to the primary key of another table must have the same name as
the attributes in the primary key of the referencing table.
When submitting the responses for this question, submit only SQL statements for creating
tables with corresponding keys and foreign keys. Do not use "create database", "Alter
database", "use database_name" or any statements using database's name i your
submission.
contractID:
varchar(50)
Contracts
quantity:
int
M
Cust-of
Room-of
Customers
CustID
varchar(50)
custName:
nvarchar(100)
Zoom
100%
custAddress
nvarchar(200)
Rooms
roomID
varchar(50)
roomPrice:
money
Picture 1.1
serviceID
varchar(50)
Service-of
Services
serviceName:
avarchar(100)
servicePrice:
money
Close