1 / 7

Opgaver

Opgaver. Design tabeller Kvalitetscheck af (3NF) tabeldesignet Skriv CREATE TABLE-sætninger. ER-diagram. Id tilføjet på alle entiteter Andre attributter ikke vist. id. Kunde. 1. n. n. 1. id. Reservation. Transportabel-Feriebolig. id. n. 1. m. n. id. Ekstraudstyr. id.

hosea
Download Presentation

Opgaver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Opgaver • Design tabeller • Kvalitetscheck af (3NF) tabeldesignet • Skriv CREATE TABLE-sætninger

  2. ER-diagram • Id tilføjet på alle entiteter • Andre attributter ikke vist id Kunde 1 n n 1 id Reservation Transportabel-Feriebolig id n 1 m n id Ekstraudstyr id Standardudstyr

  3. 3NF Tabelskemaer: fk PnrBy: [pNr, byNavn] Kunde: [id, navn, gade, pnr, byNavn, tel] Feriebolig: [id,type, beskr, prisPrDag, prisPrUge, stand] Reservation: [id, fraDato, tilDato, depositum,…, kId, bId] fk fk Standarudstyr: [id, type, antal, beskr, stkPris, bId] fk Ekstraudstyr: [id, type, beskr, prisPrUge, prisPrDag] Ekstraudstyr_Res: [eUdstId, resId] fk fk

  4. Opgave: Skriv CREATE TABLE sætninger:

  5. CREATE TABLE CREATE TABLE Kunde( id INT, navn VARCHAR(30) NOT NULL, gade VARCHAR(20), pNr CHAR(4), tel CHAR(8), CONSTRAINT KundePK PRIMARY KEY(id), CONSTRAINT PnrByFK FOREIGN KEY(pNr) REFERENCES PnrBy(pNr)) CREATE TABLE PnrBy( pNr CHAR(4), byNavn VARCHAR(20) NOT NULL, CONSTRAINT PnrByPK PRIMARY KEY(pNr))

  6. CREATE TABLE TransFerieBolig( id INT, type VARCHAR(20) NOT NULL, beskr VARCHAR(80), prisPrDag FLOAT, prisPrUge FLOAT, stand VARCHAR(10), CONSTRAINT TransFerieBoligPK PRIMARY KEY(id)) CREATE TABLE Reservation( id INT, /* alle de andre attributter*/ kId INT NOT NULL, TFBId INT NOT NULL, CONSTRAINT Reservation PK PRIMARY KEY(id), CONSTRAINT KundeFK FOREIGN KEY(kId) REFERENCES Kunde(id) CONSTRAINT TransFBoligFK FOREIGN KEY(TFBId) REFERENCES TransFerieBolig(id))

  7. CREATE TABLE Ekstraudstyr( id INT, type VARCHAR(20) NOT NULL, beskr VARCHAR(80), prisPrDag FLOAT, prisPrUge FLOAT, CONSTRAINT TransFerieBoligPK PRIMARY KEY(id)) CREATE TABLE Ekstraudstyr_Res( eUdstId INT, resId INT, CONSTRAINT Ekstraudstyr_Res PK PRIMARY KEY(eUdstId,resId), CONSTRAINT EkstraUdstyrFK FOREIGN KEY(eUdstId) REFERENCES Ekstraudstyr(id) CONSTRAINT ReservationFK FOREIGN KEY(resId) REFERENCES Reservation(id))

More Related