-- Backup til genopbygning af databasen: -- MsSQL syntax -- Create the database and tables create database h6projekt; use h6projekt; create table Person ( PersonID int identity (1,1) primary key, Initialer varchar(4) NOT NULL, Navn varchar(50) NOT NULL, Pass varchar(32), Admin int ); create table Udstyr ( Stregkode bigint primary key NOT NULL, Navn varchar(20) NOT NULL, Beskrivelse varchar(200), Placering varchar(20) NOT NULL, Status int NOT NULL ); create table Udlån ( Udlånid int identity(1,1) primary key, Personid int NOT NULL, Stregkode bigint NOT NULL, Startdato datetime NOT NULL, Afleveringsdato datetime, Antaldage int NOT NULL ); create table Resevation ( resevationid int identity(1,1) primary key, Personid int NOT NULL, Stregkode bigint NOT NULL, Startdato datetime NOT NULL, ); create table Status ( Statusid int identity(1,1) primary key, Beskrivelse varchar(40) NOT NULL ); -- ----------------------------------------------- -- Basic data INSERT INTO Person (Initialer,Navn,Pass,Admin) VALUES ("ADM", 'Systems administrator', 'Admin', 1); INSERT INTO Status (Statusid, Beskrivelse) VALUES (1,'Udlånt'); INSERT INTO Status (Statusid, Beskrivelse) VALUES (2,'Reserveret'); INSERT INTO Status (Statusid, Beskrivelse) VALUES (3,'Ledig'); -- ----------------------------------------------- -- Testdata insert into Person (Initialer, Navn) values ('JFRE', 'Jytte Fredriksen'); insert into Udstyr (Stregkode, Navn, Beskrivelse, Placering) values (5709068802148, 'Projektor', 'VGA Projektor', 'LM01');