/[H6]/docs/mysql.txt
ViewVC logotype

Contents of /docs/mysql.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42 - (show annotations) (download)
Tue Sep 5 15:58:06 2006 UTC (17 years, 7 months ago) by torben
File MIME type: text/plain
File size: 1632 byte(s)
added database descriptions docs/mysql.txt & docs/mssql.txt
1 -- MySQL syntax
2
3 -- Create the database and tables
4 create database h6projekt;
5 use h6projekt;
6
7 create table Person (
8 PersonID int auto_increment primary key,
9 Initialer varchar(4) NOT NULL,
10 Navn varchar(50) NOT NULL,
11 Pass varchar(32),
12 Admin int
13 );
14
15 create table Udstyr (
16 Stregkode bigint primary key NOT NULL,
17 Navn varchar(20) NOT NULL,
18 Beskrivelse varchar(200),
19 Placering varchar(20) NOT NULL,
20 Status int NOT NULL
21 );
22
23 create table Udlån (
24 Udlånid int auto_increment primary key,
25 Personid int NOT NULL,
26 Stregkode bigint NOT NULL,
27 Startdato datetime NOT NULL,
28 Afleveringsdato datetime,
29 Antaldage int NOT NULL
30 );
31
32 create table Resevation (
33 resevationid int auto_increment primary key,
34 Personid int NOT NULL,
35 Stregkode bigint NOT NULL,
36 Startdato datetime NOT NULL,
37 );
38
39 create table Status (
40 Statusid int primary key,
41 Beskrivelse varchar(40) NOT NULL
42 );
43
44 -- -----------------------------------------------
45 -- Basic data
46 INSERT INTO Person (Initialer,Navn,Pass,Admin)
47 VALUES ("ADM", 'Systems administrator', 'Admin', 1);
48
49 INSERT INTO Status (Statusid, Beskrivelse)
50 VALUES (1,'Udlånt');
51
52 INSERT INTO Status (Statusid, Beskrivelse)
53 VALUES (2,'Reserveret');
54
55 INSERT INTO Status (Statusid, Beskrivelse)
56 VALUES (3,'Ledig');
57
58 -- -----------------------------------------------
59 -- Testdata
60
61 insert into Person (Initialer, Navn)
62 values ('JFRE', 'Jytte Fredriksen');
63
64 insert into Udstyr (Stregkode, Navn, Beskrivelse, Placering)
65 values (5709068802148, 'Projektor', 'VGA Projektor', 'LM01');
66

  ViewVC Help
Powered by ViewVC 1.1.20