MADRIDANO Lab-1
MADRIDANO Lab-1
MADRIDANO Lab-1
Task 1.1
Task 1.2
Task 1.3
Task 1.4
Script: CREATE TABLE sales (salesNum int NOT NULL, ParkCode VarChar(100) NOT
NULL, salesDate DATE,
Primary Key(salesNum),
Foreign Key(ParkCode) REFERENCES themepark(ParkCode));
Script: CREATE TABLE employee( empNum int NOT NULL, ParkCode VarChar(100) NOT NUll,
empTitle VarChar(100),empLName VarChar(100), empFName VarChar(100), empDateOfBirth
DATE, empHireDate DATE, empAreaCode int, empPhoneNum VarChar(100),
Primary Key(empNum),
Foreign Key(ParkCode) REFERENCES themepark(ParkCode));
Script: CREATE TABLE ticket(ticketNum int NOT NULL, ParkCode VarChar(100) NOT
NULL, ticketPrice DOUBLE, tikcetType VarChar(100),
Primary Key(ticketNum),
Foreign Key(ParkCode) REFERENCES themepark(ParkCode));
Script: CREATE TABLE sales_line(lineNum int NOT NULL, salesNum int NOT NULL, ticketNum
int NOT NULL, lineQty VarChar(100), linePrice DOUBLE,
Primary Key(lineNum),
Foreign Key(salesNum) REFERENCES sales(salesNum),
Foreign Key(ticketNum) REFERENCES ticket(ticketNum)
);
Script: CREATE TABLE hours( hrNum int NOT NULL, attNum int NOT NULL, empNum int NOT
NULL, hrsPerAttract TIME, hrRate DOUBLE, hrDateWorked DATETIME, Primary Key(hrNum),
Foreign Key(attNum) REFERENCES attraction(attNum),
Foreign Key(empNum) REFERENCES employee(empNum));
Task 1.5
Task 1.7
Task 1.8
Task 1.10
Script: CREATE TABLE hours( hrNum int NOT NULL,attNum int NOT NULL, empNum int NOT
NULL, hrsPerAttract TIME, hrRate DOUBLE, hrDateWorked DATETIME,
Primary Key(hrNum),
Foreign Key(attNum) REFERENCES attraction(attNum),
Foreign Key(empNum) REFERENCES employee(empNum));