Question paper (build 07.05.20.19)
the attributes in the primary key of the referencing table.
If a table must be created for representing a relationship, the name of the table must be the
same as the name of the relationship.
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 in your
submission.
You must use ER style conversions for subclasses in this diagram if exists.
The table represents the multi-values attribute must have the name which is the
concatenation of the table name and the attribute name. For example, if table named
Student has the multi-values attribute named Phone, the name of the corresponding table
must be StudentPhone.
name
nvarchar(100)
phone:
nvarchar(20)
restauranti
int
Restaurants
has
street
nvarchar(50)
city
nvarchar(50)
address
nvarchar(100)
N
N
N
Employees
works
Shifts
empID: int
FullName:
nvarchar(60)
gender
char(1)
Picture 1.1
shiftD int
shiftDate: date
startTime:
time
endTime: time
Question 2:
Write an SQL query to display all employees who are chefs or managers and were hired in
2021, as shown in the following figure: