yudisentosa / SBDProjectSchool

0 stars 0 forks source link

Table - facility_details #29

Closed BastiaanMatt closed 3 years ago

BastiaanMatt commented 3 years ago

CREATE TABLE facility_details( facility_id VARCHAR(6) NOT NULL ,effective_date DATE NOT NULL ,property VARCHAR(17) NOT NULL ,quantity INTEGER NOT NULL ,PRIMARY KEY(facility_id,effective_date,property) ); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC001','2020-07-20','basketball rims',2); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC001','2020-07-27','basket balls',5); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC002','2020-07-20','soccer goalpost',2); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC002','2020-07-27','soccer balls',5); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-21','badminton net',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-27','badminton rackets',4); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-27','shuttle cocks',2); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC004','2020-07-23','scientific kits',10); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC006','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC006','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC007','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC007','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC008','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC008','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC009','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC009','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC010','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC010','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC011','2020-07-20','chairs+desks',20); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC011','2020-07-20','projector+screen',1);

yudisentosa commented 3 years ago

CREATE TABLE facility_details(
facility_id VARCHAR(6) NOT NULL
,effective_date DATE NOT NULL
,property VARCHAR(17) NOT NULL
,quantity INTEGER NOT NULL
,PRIMARY KEY(facility_id,effective_date,property),
FOREIGN KEY(facility_id) REFERENCES facility(facility_id)
);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC001','2020-07-20','basketball rims',2); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC001','2020-07-27','basket balls',5);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC002','2020-07-20','soccer goalpost',2); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC002','2020-07-27','soccer balls',5);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-21','badminton net',1);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-27','badminton rackets',4) INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC003','2020-07-27','shuttle cocks',2);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC004','2020-07-23','scientific kits',10); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC006','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC006','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC007','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC007','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC008','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC008','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC009','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC009','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC010','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC010','2020-07-20','projector+screen',1); INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC011','2020-07-20','chairs+desks',20);
INSERT INTO facility_details(facility_id,effective_date,property,quantity) VALUES ('FAC011','2020-07-20','projector+screen',1);