summaryrefslogtreecommitdiffstats
path: root/db_demo/sql/tables
diff options
context:
space:
mode:
Diffstat (limited to 'db_demo/sql/tables')
-rw-r--r--db_demo/sql/tables/cr_const_agegroup.sql4
-rw-r--r--db_demo/sql/tables/cr_const_block.sql4
-rw-r--r--db_demo/sql/tables/cr_const_boxsize.sql4
-rw-r--r--db_demo/sql/tables/cr_const_gametype.sql7
-rw-r--r--db_demo/sql/tables/cr_tbl_person.sql8
-rw-r--r--db_demo/sql/tables/cr_tbl_test.sql7
-rw-r--r--db_demo/sql/tables/cr_tbl_turn.sql9
7 files changed, 43 insertions, 0 deletions
diff --git a/db_demo/sql/tables/cr_const_agegroup.sql b/db_demo/sql/tables/cr_const_agegroup.sql
new file mode 100644
index 0000000..b27217a
--- /dev/null
+++ b/db_demo/sql/tables/cr_const_agegroup.sql
@@ -0,0 +1,4 @@
+CREATE TABLE const_agegroup (
+ key integer PRIMARY KEY, -- primary key
+ description text NOT NULL -- group description
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_const_block.sql b/db_demo/sql/tables/cr_const_block.sql
new file mode 100644
index 0000000..4b86667
--- /dev/null
+++ b/db_demo/sql/tables/cr_const_block.sql
@@ -0,0 +1,4 @@
+CREATE TABLE const_block (
+ key integer PRIMARY KEY, -- primary key
+ description text NOT NULL -- block description
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_const_boxsize.sql b/db_demo/sql/tables/cr_const_boxsize.sql
new file mode 100644
index 0000000..5f5be90
--- /dev/null
+++ b/db_demo/sql/tables/cr_const_boxsize.sql
@@ -0,0 +1,4 @@
+CREATE TABLE const_boxsize (
+ key integer PRIMARY KEY, -- primary key
+ description text NOT NULL -- size description
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_const_gametype.sql b/db_demo/sql/tables/cr_const_gametype.sql
new file mode 100644
index 0000000..d9e9a99
--- /dev/null
+++ b/db_demo/sql/tables/cr_const_gametype.sql
@@ -0,0 +1,7 @@
+CREATE TABLE const_gametype (
+ key integer PRIMARY KEY, -- primary key
+ boxsizeid integer NOT NULL REFERENCES const_boxsize(key), -- boxsize foreign key
+ headtracking boolean NOT NULL, -- headtracking on / off
+ stereo boolean NOT NULL, -- stereo vision on / off
+ shadow boolean NOT NULL -- shadow on / off
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_tbl_person.sql b/db_demo/sql/tables/cr_tbl_person.sql
new file mode 100644
index 0000000..95e01b7
--- /dev/null
+++ b/db_demo/sql/tables/cr_tbl_person.sql
@@ -0,0 +1,8 @@
+CREATE SEQUENCE seq_person START 1;
+
+CREATE TABLE tbl_person (
+ key integer PRIMARY KEY, -- primary key
+ agegroupid integer NOT NULL REFERENCES const_agegroup(key), -- age group foreign key
+ c_experience boolean NOT NULL, -- computer experience
+ w_experience boolean NOT NULL -- wiimote experience
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_tbl_test.sql b/db_demo/sql/tables/cr_tbl_test.sql
new file mode 100644
index 0000000..15e94d0
--- /dev/null
+++ b/db_demo/sql/tables/cr_tbl_test.sql
@@ -0,0 +1,7 @@
+CREATE SEQUENCE seq_test START 1;
+
+CREATE TABLE tbl_test (
+ key integer PRIMARY KEY, -- primary key
+ personid integer NOT NULL REFERENCES tbl_person(key), -- person foreign key
+ gametypeid integer NOT NULL REFERENCES const_gametype(key) -- gametype foreign key
+); \ No newline at end of file
diff --git a/db_demo/sql/tables/cr_tbl_turn.sql b/db_demo/sql/tables/cr_tbl_turn.sql
new file mode 100644
index 0000000..f0b7cc3
--- /dev/null
+++ b/db_demo/sql/tables/cr_tbl_turn.sql
@@ -0,0 +1,9 @@
+CREATE SEQUENCE seq_turn START 1;
+
+CREATE TABLE tbl_turn (
+ key integer PRIMARY KEY, -- primary key
+ testid integer NOT NULL REFERENCES tbl_test(key), -- test foreign key
+ blockid integer NOT NULL REFERENCES const_block(key), -- block foreign key
+ elapsedtime time NOT NULL, -- time in ms.
+ holeposition integer NOT NULL -- position of the hole
+); \ No newline at end of file