comparison Data/Create Scripts/DB2.sql @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 DROP TABLE "Doctor"
2 GO
3
4 DROP TABLE "Patient"
5 GO
6
7 DROP TABLE "Person"
8 GO
9
10 CREATE TABLE "Person"
11 (
12 "PersonID" INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY NOT NULL,
13 "FirstName" VARCHAR(50) NOT NULL,
14 "LastName" VARCHAR(50) NOT NULL,
15 "MiddleName" VARCHAR(50),
16 "Gender" CHAR(1) NOT NULL
17 )
18 GO
19
20 INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('John', 'Pupkin', 'M')
21 GO
22 INSERT INTO "Person" ("FirstName", "LastName", "Gender") VALUES ('Tester', 'Testerson', 'M')
23 GO
24
25 -- Doctor Table Extension
26
27 CREATE TABLE "Doctor"
28 (
29 "PersonID" INTEGER NOT NULL,
30 "Taxonomy" VARCHAR(50) NOT NULL
31 )
32 GO
33
34 INSERT INTO "Doctor" ("PersonID", "Taxonomy") VALUES (1, 'Psychiatry')
35 GO
36
37 -- Patient Table Extension
38
39 CREATE TABLE "Patient"
40 (
41 "PersonID" INTEGER NOT NULL,
42 "Diagnosis" VARCHAR(256) NOT NULL
43 )
44 GO
45
46 INSERT INTO "Patient" ("PersonID", "Diagnosis") VALUES (2, 'Hallucination with Paranoid Bugs'' Delirium of Persecution')
47 GO
48
49
50 DROP TABLE "Parent"
51 GO
52 DROP TABLE "Child"
53 GO
54 DROP TABLE "GrandChild"
55 GO
56
57 CREATE TABLE "Parent" ("ParentID" int, "Value1" int)
58 GO
59 CREATE TABLE "Child" ("ParentID" int, "ChildID" int)
60 GO
61 CREATE TABLE "GrandChild" ("ParentID" int, "ChildID" int, "GrandChildID" int)
62 GO
63
64
65 DROP TABLE "LinqDataTypes"
66 GO
67
68 CREATE TABLE "LinqDataTypes"
69 (
70 "ID" int,
71 "MoneyValue" decimal(10,4),
72 "DateTimeValue" timestamp,
73 "DateTimeValue2" timestamp NULL,
74 "BoolValue" smallint,
75 "GuidValue" char(16) for bit DATA,
76 "BinaryValue" blob(5000) NULL,
77 "SmallIntValue" smallint,
78 "IntValue" int NULL,
79 "BigIntValue" bigint NULL
80 )
81 GO
82
83 DROP TABLE "TestIdentity"
84 GO
85
86 CREATE TABLE "TestIdentity" (
87 "ID" INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY NOT NULL
88 )
89 GO