Chinastark commited on
Commit
489d5fd
·
verified ·
1 Parent(s): 4a77e0b

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. test_database/academic/schema.sql +108 -0
  2. test_database/allergy_1/allergy_1.sqlite +0 -0
  3. test_database/architecture/architecture.sqlite +0 -0
  4. test_database/art_1/link.txt +1 -0
  5. test_database/art_1/q.txt +9 -0
  6. test_database/bakery_1/annotation.json +58 -0
  7. test_database/bakery_1/bakery_1.json +126 -0
  8. test_database/bakery_1/bakery_1.sql +30 -0
  9. test_database/bakery_1/bakery_1.sqlite +0 -0
  10. test_database/bakery_1/data_csv/receipts.csv +201 -0
  11. test_database/bakery_1/link.txt +1 -0
  12. test_database/bakery_1/q.txt +25 -0
  13. test_database/bike_1/schema.sql +0 -0
  14. test_database/car_1/car_1.json +216 -0
  15. test_database/car_1/data_csv/car-makers.csv +24 -0
  16. test_database/city_record/city_record.sqlite +0 -0
  17. test_database/club_1/club_1.sqlite +0 -0
  18. test_database/club_leader/club_leader.sqlite +0 -0
  19. test_database/club_leader/schema_old.sql +61 -0
  20. test_database/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite +0 -0
  21. test_database/cre_Doc_Tracking_DB/schema.sql +164 -0
  22. test_database/cre_Students_Information_Systems/schema.sql +381 -0
  23. test_database/customer_deliveries/schema.sql +333 -0
  24. test_database/customers_and_products_contacts/customers_and_products_contacts.sqlite +0 -0
  25. test_database/customers_and_products_contacts/schema.sql +176 -0
  26. test_database/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite +0 -0
  27. test_database/decoration_competition/decoration_competition.sqlite +0 -0
  28. test_database/department_store/department_store.sqlite +0 -0
  29. test_database/department_store/schema.sql +348 -0
  30. test_database/driving_school/driving_school.sqlite +0 -0
  31. test_database/election_representative/election_representative.sqlite +0 -0
  32. test_database/entertainment_awards/entertainment_awards.sqlite +0 -0
  33. test_database/entertainment_awards/schema.sql +54 -0
  34. test_database/epinions_1/epinions_1.sqlite +0 -0
  35. test_database/flight_2/data_csv/airports100.csv +101 -0
  36. test_database/flight_4/link.txt +1 -0
  37. test_database/flight_4/sql.txt +1 -0
  38. test_database/icfp_1/q.txt +9 -0
  39. test_database/institution_sports/institution_sports.sqlite +0 -0
  40. test_database/journal_committee/journal_committee.sqlite +0 -0
  41. test_database/journal_committee/schema.sql +54 -0
  42. test_database/performance_attendance/schema.sql +60 -0
  43. test_database/roller_coaster/schema.sql +35 -0
  44. test_database/school_finance/schema.sql +64 -0
  45. test_database/school_finance/school_finance.sqlite +0 -0
  46. test_database/vehicle_rent/schema.sql +77 -0
  47. test_database/voter_2/schema.sql +75 -0
  48. test_database/voter_2/voter_2.sqlite +0 -0
  49. test_database/warehouse_1/q.txt +19 -0
  50. test_database/warehouse_1/warehouse_1.sqlite +0 -0
test_database/academic/schema.sql ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+ CREATE TABLE "author" (
3
+ "aid" int,
4
+ "homepage" text,
5
+ "name" text,
6
+ "oid" int,
7
+ primary key("aid")
8
+ );
9
+ CREATE TABLE "conference" (
10
+ "cid" int,
11
+ "homepage" text,
12
+ "name" text,
13
+ primary key ("cid")
14
+ );
15
+ CREATE TABLE "domain" (
16
+ "did" int,
17
+ "name" text,
18
+ primary key ("did")
19
+ );
20
+ CREATE TABLE "domain_author" (
21
+ "aid" int,
22
+ "did" int,
23
+ primary key ("did", "aid"),
24
+ foreign key("aid") references `author`("aid"),
25
+ foreign key("did") references `domain`("did")
26
+ );
27
+
28
+ CREATE TABLE "domain_conference" (
29
+ "cid" int,
30
+ "did" int,
31
+ primary key ("did", "cid"),
32
+ foreign key("cid") references `conference`("cid"),
33
+ foreign key("did") references `domain`("did")
34
+ );
35
+ CREATE TABLE "journal" (
36
+ "homepage" text,
37
+ "jid" int,
38
+ "name" text,
39
+ primary key("jid")
40
+ );
41
+ CREATE TABLE "domain_journal" (
42
+ "did" int,
43
+ "jid" int,
44
+ primary key ("did", "jid"),
45
+ foreign key("jid") references "journal"("jid"),
46
+ foreign key("did") references "domain"("did")
47
+ );
48
+ CREATE TABLE "keyword" (
49
+ "keyword" text,
50
+ "kid" int,
51
+ primary key("kid")
52
+ );
53
+ CREATE TABLE "domain_keyword" (
54
+ "did" int,
55
+ "kid" int,
56
+ primary key ("did", "kid"),
57
+ foreign key("kid") references "keyword"("kid"),
58
+ foreign key("did") references "domain"("did")
59
+ );
60
+ CREATE TABLE "publication" (
61
+ "abstract" text,
62
+ "cid" text,
63
+ "citation_num" int,
64
+ "jid" int,
65
+ "pid" int,
66
+ "reference_num" int,
67
+ "title" text,
68
+ "year" int,
69
+ primary key("pid"),
70
+ foreign key("jid") references "journal"("jid"),
71
+ foreign key("cid") references "conference"("cid")
72
+ );
73
+ CREATE TABLE "domain_publication" (
74
+ "did" int,
75
+ "pid" int,
76
+ primary key ("did", "pid"),
77
+ foreign key("pid") references "publication"("pid"),
78
+ foreign key("did") references "domain"("did")
79
+ );
80
+
81
+ CREATE TABLE "organization" (
82
+ "continent" text,
83
+ "homepage" text,
84
+ "name" text,
85
+ "oid" int,
86
+ primary key("oid")
87
+ );
88
+
89
+ CREATE TABLE "publication_keyword" (
90
+ "pid" int,
91
+ "kid" int,
92
+ primary key ("kid", "pid"),
93
+ foreign key("pid") references "publication"("pid"),
94
+ foreign key("kid") references "keyword"("kid")
95
+ );
96
+ CREATE TABLE "writes" (
97
+ "aid" int,
98
+ "pid" int,
99
+ primary key ("aid", "pid"),
100
+ foreign key("pid") references "publication"("pid"),
101
+ foreign key("aid") references "author"("aid")
102
+ );
103
+ CREATE TABLE "cite" (
104
+ "cited" int,
105
+ "citing" int,
106
+ foreign key("cited") references "publication"("pid"),
107
+ foreign key("citing") references "publication"("pid")
108
+ );
test_database/allergy_1/allergy_1.sqlite ADDED
Binary file (20.5 kB). View file
 
test_database/architecture/architecture.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/art_1/link.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://www.classes.cs.uchicago.edu/archive/2015/spring/23500-1/hw3.html
test_database/art_1/q.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ q0. Retrieve the title of each painting, the artist's last name, its height in inches and its width in inches in descending order of surface area.
2
+
3
+ q1. Retrieve the artistID, first name, last name, and age at death of the artist(s) who was/were youngest at the time of death. (Note that since the birth and death dates are given as years only, any age computation is approximate, accurate plus or minus one.)
4
+
5
+ q2. Retrieve the titles of all paintings and sculptures, with the artists' last names, in the database and the age the artist was at the time the work was produced, in order of youngest to oldest such age.
6
+
7
+ q3. Retrieve the artist's last name and the title of all the undisplayed works.
8
+
9
+ q4. Write a query to display the artistID, last name and all (distinct) media used by all artists in all paintings. Order the query result by last name, ascending. Your results should include not just the medium ("oil") but the surface the medium is on ("oil on canvas"). Use GROUP_CONCAT to denormalize the data and produce comma-delimited results like this:
test_database/bakery_1/annotation.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "label_id": null,
3
+ "data": [
4
+ {
5
+ "nl": "Find all chocolate-flavored items on the menu whose price is under $5.00. For each item output the flavor, the name (food type) of the item, and the price.\n",
6
+ "id": 0
7
+ },
8
+ {
9
+ "nl": "Report the prices of any lemon-flavored items. Output the flavor, the name (food type) and the price of each pastry.\n",
10
+ "id": 1
11
+ },
12
+ {
13
+ "nl": "Find all customers who made a purchase on October 3, 2007. Report the name of the customer (first, last).\n",
14
+ "id": 2
15
+ },
16
+ {
17
+ "nl": "Find all types of cookies purchased by KIP ARNN during the month of October of 2007. Report each cookie type (flavor, food type) exactly once.\n",
18
+ "id": 3
19
+ },
20
+ {
21
+ "nl": "Report the total amount of money NATACHA STENZ spent at the bakery during the month of October, 2007.\n",
22
+ "id": 4
23
+ },
24
+ {
25
+ "nl": "Find all customers who purchased, during the same trip to the bakery, two different Croissants. Report first and last names of the customers.\n",
26
+ "id": 5
27
+ },
28
+ {
29
+ "nl": "Find the total amount of money the bakery earned in October 2007 from selling eclairs. Report just the amount.\n",
30
+ "id": 6
31
+ },
32
+ {
33
+ "nl": "Report all days on which more than ten tarts were purchased.\n",
34
+ "id": 7
35
+ },
36
+ {
37
+ "nl": "For each purchase made by NATACHA STENZ output the receipt number, the date of purchase, the total number of items purchased and the amount paid.\n",
38
+ "id": 8
39
+ },
40
+ {
41
+ "nl": "Find the customer(s) who spent the most on pastries in October of 2007. Report first and last name.\n",
42
+ "id": 9
43
+ },
44
+ {
45
+ "nl": "Find the type of baked good (food type, flavor) responsible for highest total revenue.\n",
46
+ "id": 10
47
+ },
48
+ {
49
+ "nl": "Find the day of the highest revenue in the month of October, 2007.\n",
50
+ "id": 11
51
+ },
52
+ {
53
+ "nl": "Find the best-selling item (by number of purchases) on the day of the highest revenue in October of 2007.\n",
54
+ "id": 12
55
+ }
56
+ ],
57
+ "review_id": null
58
+ }
test_database/bakery_1/bakery_1.json ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "col_data": [
4
+ {
5
+ "column_name": "id",
6
+ "data_type": "INTEGER",
7
+ "default_column_name": "Id",
8
+ "default_value": null,
9
+ "not_null": 0,
10
+ "primary_key": 1
11
+ },
12
+ {
13
+ "column_name": "last_name",
14
+ "data_type": "TEXT",
15
+ "default_column_name": "LastName",
16
+ "default_value": null,
17
+ "not_null": 0,
18
+ "primary_key": 0
19
+ },
20
+ {
21
+ "column_name": "first_name",
22
+ "data_type": "TEXT",
23
+ "default_column_name": "FirstName",
24
+ "default_value": null,
25
+ "not_null": 0,
26
+ "primary_key": 0
27
+ }
28
+ ],
29
+ "table": "customers"
30
+ },
31
+ {
32
+ "col_data": [
33
+ {
34
+ "column_name": "id",
35
+ "data_type": "TEXT",
36
+ "default_column_name": "Id",
37
+ "default_value": null,
38
+ "not_null": 0,
39
+ "primary_key": 1
40
+ },
41
+ {
42
+ "column_name": "flavor",
43
+ "data_type": "TEXT",
44
+ "default_column_name": "Flavor",
45
+ "default_value": null,
46
+ "not_null": 0,
47
+ "primary_key": 0
48
+ },
49
+ {
50
+ "column_name": "food",
51
+ "data_type": "TEXT",
52
+ "default_column_name": "Food",
53
+ "default_value": null,
54
+ "not_null": 0,
55
+ "primary_key": 0
56
+ },
57
+ {
58
+ "column_name": "price",
59
+ "data_type": "REAL",
60
+ "default_column_name": "Price",
61
+ "default_value": null,
62
+ "not_null": 0,
63
+ "primary_key": 0
64
+ }
65
+ ],
66
+ "table": "goods"
67
+ },
68
+ {
69
+ "col_data": [
70
+ {
71
+ "column_name": "reciept_number",
72
+ "data_type": "INTEGER",
73
+ "default_column_name": "RecieptNumber",
74
+ "default_value": null,
75
+ "not_null": 0,
76
+ "primary_key": 1
77
+ },
78
+ {
79
+ "column_name": "date",
80
+ "data_type": "TEXT",
81
+ "default_column_name": "Date",
82
+ "default_value": null,
83
+ "not_null": 0,
84
+ "primary_key": 0
85
+ },
86
+ {
87
+ "column_name": "customer_id",
88
+ "data_type": "INTEGER",
89
+ "default_column_name": "CustomerId",
90
+ "default_value": null,
91
+ "not_null": 0,
92
+ "primary_key": 0
93
+ }
94
+ ],
95
+ "table": "receipts"
96
+ },
97
+ {
98
+ "col_data": [
99
+ {
100
+ "column_name": "reciept",
101
+ "data_type": "INTEGER",
102
+ "default_column_name": "Reciept",
103
+ "default_value": null,
104
+ "not_null": 0,
105
+ "primary_key": 1
106
+ },
107
+ {
108
+ "column_name": "ordinal",
109
+ "data_type": "INTEGER",
110
+ "default_column_name": "Ordinal",
111
+ "default_value": null,
112
+ "not_null": 0,
113
+ "primary_key": 2
114
+ },
115
+ {
116
+ "column_name": "item",
117
+ "data_type": "TEXT",
118
+ "default_column_name": "Item",
119
+ "default_value": null,
120
+ "not_null": 0,
121
+ "primary_key": 0
122
+ }
123
+ ],
124
+ "table": "items"
125
+ }
126
+ ]
test_database/bakery_1/bakery_1.sql ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE "customers" (
2
+ "Id" INTEGER PRIMARY KEY,
3
+ "LastName" TEXT,
4
+ "FirstName" TEXT
5
+ );
6
+
7
+
8
+ CREATE TABLE "goods" (
9
+ "Id" TEXT PRIMARY KEY,
10
+ "Flavor" TEXT,
11
+ "Food" TEXT,
12
+ "Price" REAL
13
+ );
14
+
15
+
16
+ CREATE TABLE "items" (
17
+ "Receipt" INTEGER,
18
+ "Ordinal" INTEGER,
19
+ "Item" TEXT,
20
+ PRIMARY KEY(Receipt, Ordinal),
21
+ FOREIGN KEY (Item) REFERENCES goods(Id)
22
+ FOREIGN KEY (Receipt) REFERENCES receipts(ReceiptNumber)
23
+ );
24
+
25
+ CREATE TABLE "receipts" (
26
+ "ReceiptNumber" INTEGER PRIMARY KEY,
27
+ "Date" TEXT,
28
+ "CustomerId" INTEGER,
29
+ FOREIGN KEY(CustomerId) REFERENCES customers(Id)
30
+ );
test_database/bakery_1/bakery_1.sqlite ADDED
Binary file (57.3 kB). View file
 
test_database/bakery_1/data_csv/receipts.csv ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ReceiptNumber, Date, CustomerId
2
+ 18129, '28-Oct-2007', 15
3
+ 51991, '17-Oct-2007', 14
4
+ 83085, '12-Oct-2007', 7
5
+ 70723, '28-Oct-2007', 20
6
+ 13355, '19-Oct-2007', 7
7
+ 52761, '27-Oct-2007', 8
8
+ 99002, '13-Oct-2007', 20
9
+ 58770, '22-Oct-2007', 18
10
+ 84665, '10-Oct-2007', 6
11
+ 55944, '16-Oct-2007', 19
12
+ 42166, '14-Oct-2007', 8
13
+ 16034, '10-Oct-2007', 4
14
+ 25906, '29-Oct-2007', 15
15
+ 27741, '25-Oct-2007', 8
16
+ 64451, '10-Oct-2007', 11
17
+ 41028, '6-Oct-2007', 17
18
+ 73716, '29-Oct-2007', 18
19
+ 76667, '14-Oct-2007', 15
20
+ 21040, '3-Oct-2007', 6
21
+ 48332, '15-Oct-2007', 20
22
+ 35011, '10-Oct-2007', 20
23
+ 95962, '26-Oct-2007', 8
24
+ 44798, '4-Oct-2007', 16
25
+ 60270, '31-Oct-2007', 11
26
+ 21162, '4-Oct-2007', 8
27
+ 77406, '9-Oct-2007', 13
28
+ 32565, '24-Oct-2007', 14
29
+ 36343, '31-Oct-2007', 19
30
+ 96619, '7-Oct-2007', 18
31
+ 86678, '24-Oct-2007', 3
32
+ 44330, '20-Oct-2007', 18
33
+ 91937, '21-Oct-2007', 12
34
+ 21545, '22-Oct-2007', 12
35
+ 29226, '26-Oct-2007', 14
36
+ 25121, '20-Oct-2007', 18
37
+ 54935, '16-Oct-2007', 14
38
+ 36423, '24-Oct-2007', 16
39
+ 83437, '15-Oct-2007', 8
40
+ 49854, '12-Oct-2007', 2
41
+ 99994, '21-Oct-2007', 6
42
+ 21622, '10-Oct-2007', 7
43
+ 64861, '15-Oct-2007', 10
44
+ 33456, '5-Oct-2007', 16
45
+ 75468, '21-Oct-2007', 10
46
+ 56365, '14-Oct-2007', 12
47
+ 91192, '10-Oct-2007', 5
48
+ 82056, '7-Oct-2007', 18
49
+ 27192, '28-Oct-2007', 9
50
+ 59716, '30-Oct-2007', 2
51
+ 82795, '8-Oct-2007', 15
52
+ 26240, '7-Oct-2007', 16
53
+ 56724, '9-Oct-2007', 13
54
+ 70796, '31-Oct-2007', 12
55
+ 37636, '20-Oct-2007', 1
56
+ 63998, '13-Oct-2007', 20
57
+ 48981, '24-Oct-2007', 20
58
+ 66704, '29-Oct-2007', 14
59
+ 12698, '23-Oct-2007', 19
60
+ 79287, '30-Oct-2007', 8
61
+ 55690, '15-Oct-2007', 19
62
+ 94371, '22-Oct-2007', 8
63
+ 26148, '19-Oct-2007', 20
64
+ 11923, '9-Oct-2007', 15
65
+ 46598, '3-Oct-2007', 14
66
+ 76951, '27-Oct-2007', 14
67
+ 85858, '31-Oct-2007', 1
68
+ 85881, '13-Oct-2007', 1
69
+ 89937, '20-Oct-2007', 7
70
+ 66227, '10-Oct-2007', 1
71
+ 60240, '17-Oct-2007', 17
72
+ 86085, '16-Oct-2007', 1
73
+ 67314, '23-Oct-2007', 6
74
+ 10013, '17-Oct-2007', 15
75
+ 26741, '24-Oct-2007', 7
76
+ 38157, '23-Oct-2007', 16
77
+ 45873, '5-Oct-2007', 13
78
+ 37540, '3-Oct-2007', 20
79
+ 11891, '30-Oct-2007', 7
80
+ 61797, '30-Oct-2007', 8
81
+ 52369, '15-Oct-2007', 5
82
+ 96430, '4-Oct-2007', 18
83
+ 64301, '12-Oct-2007', 14
84
+ 45976, '3-Oct-2007', 10
85
+ 39605, '12-Oct-2007', 12
86
+ 52013, '5-Oct-2007', 13
87
+ 88626, '25-Oct-2007', 17
88
+ 53376, '30-Oct-2007', 8
89
+ 15584, '13-Oct-2007', 3
90
+ 73437, '1-Oct-2007', 6
91
+ 24200, '16-Oct-2007', 9
92
+ 92252, '25-Oct-2007', 7
93
+ 39685, '28-Oct-2007', 1
94
+ 61378, '8-Oct-2007', 11
95
+ 96761, '14-Oct-2007', 20
96
+ 26198, '12-Oct-2007', 11
97
+ 78179, '24-Oct-2007', 14
98
+ 68890, '27-Oct-2007', 7
99
+ 75526, '22-Oct-2007', 18
100
+ 86162, '10-Oct-2007', 16
101
+ 13496, '30-Oct-2007', 11
102
+ 60469, '20-Oct-2007', 4
103
+ 50660, '18-Oct-2007', 9
104
+ 64553, '8-Oct-2007', 17
105
+ 57784, '15-Oct-2007', 7
106
+ 84258, '22-Oct-2007', 2
107
+ 68199, '4-Oct-2007', 9
108
+ 78187, '17-Oct-2007', 14
109
+ 81517, '10-Oct-2007', 1
110
+ 18951, '14-Oct-2007', 20
111
+ 20411, '8-Oct-2007', 7
112
+ 55494, '20-Oct-2007', 15
113
+ 42162, '16-Oct-2007', 7
114
+ 49977, '18-Oct-2007', 3
115
+ 89638, '7-Oct-2007', 4
116
+ 73438, '18-Oct-2007', 10
117
+ 96258, '12-Oct-2007', 8
118
+ 19258, '25-Oct-2007', 5
119
+ 12800, '22-Oct-2007', 11
120
+ 81368, '17-Oct-2007', 19
121
+ 70655, '6-Oct-2007', 2
122
+ 19002, '19-Oct-2007', 6
123
+ 31874, '13-Oct-2007', 2
124
+ 72207, '15-Oct-2007', 1
125
+ 65091, '9-Oct-2007', 17
126
+ 42833, '22-Oct-2007', 3
127
+ 72949, '2-Oct-2007', 6
128
+ 46248, '12-Oct-2007', 11
129
+ 38849, '25-Oct-2007', 1
130
+ 86861, '26-Oct-2007', 9
131
+ 32701, '19-Oct-2007', 16
132
+ 89182, '29-Oct-2007', 5
133
+ 68753, '11-Oct-2007', 5
134
+ 39217, '19-Oct-2007', 20
135
+ 96531, '12-Oct-2007', 8
136
+ 53922, '13-Oct-2007', 2
137
+ 64477, '16-Oct-2007', 6
138
+ 99058, '3-Oct-2007', 14
139
+ 77032, '28-Oct-2007', 14
140
+ 15286, '11-Oct-2007', 6
141
+ 59774, '2-Oct-2007', 16
142
+ 35073, '23-Oct-2007', 5
143
+ 34910, '7-Oct-2007', 20
144
+ 17685, '2-Oct-2007', 12
145
+ 45062, '23-Oct-2007', 1
146
+ 39109, '2-Oct-2007', 16
147
+ 37063, '22-Oct-2007', 14
148
+ 18567, '13-Oct-2007', 7
149
+ 37586, '3-Oct-2007', 8
150
+ 62707, '7-Oct-2007', 8
151
+ 28117, '9-Oct-2007', 5
152
+ 64574, '2-Oct-2007', 6
153
+ 40305, '25-Oct-2007', 8
154
+ 33060, '29-Oct-2007', 20
155
+ 12396, '10-Oct-2007', 10
156
+ 43103, '7-Oct-2007', 4
157
+ 39575, '20-Oct-2007', 20
158
+ 70162, '9-Oct-2007', 19
159
+ 23034, '15-Oct-2007', 17
160
+ 79296, '3-Oct-2007', 19
161
+ 74741, '12-Oct-2007', 20
162
+ 98806, '15-Oct-2007', 17
163
+ 43752, '5-Oct-2007', 5
164
+ 47353, '12-Oct-2007', 6
165
+ 39829, '31-Oct-2007', 3
166
+ 87454, '21-Oct-2007', 6
167
+ 76663, '4-Oct-2007', 10
168
+ 85492, '20-Oct-2007', 12
169
+ 48647, '9-Oct-2007', 3
170
+ 61008, '9-Oct-2007', 14
171
+ 96402, '4-Oct-2007', 6
172
+ 35904, '21-Oct-2007', 10
173
+ 49845, '31-Oct-2007', 20
174
+ 46014, '16-Oct-2007', 15
175
+ 46876, '6-Oct-2007', 13
176
+ 34579, '8-Oct-2007', 7
177
+ 17729, '16-Oct-2007', 16
178
+ 74952, '16-Oct-2007', 5
179
+ 61948, '4-Oct-2007', 5
180
+ 41064, '25-Oct-2007', 16
181
+ 17947, '27-Oct-2007', 7
182
+ 20913, '7-Oct-2007', 8
183
+ 95514, '9-Oct-2007', 10
184
+ 24829, '7-Oct-2007', 15
185
+ 44590, '12-Oct-2007', 1
186
+ 65165, '4-Oct-2007', 4
187
+ 89588, '9-Oct-2007', 7
188
+ 53240, '3-Oct-2007', 14
189
+ 46674, '29-Oct-2007', 15
190
+ 67946, '18-Oct-2007', 7
191
+ 31233, '20-Oct-2007', 13
192
+ 15904, '6-Oct-2007', 13
193
+ 17488, '20-Oct-2007', 6
194
+ 97097, '23-Oct-2007', 9
195
+ 50512, '27-Oct-2007', 8
196
+ 11548, '21-Oct-2007', 13
197
+ 29908, '14-Oct-2007', 13
198
+ 20127, '7-Oct-2007', 15
199
+ 41963, '29-Oct-2007', 8
200
+ 16532, '21-Oct-2007', 4
201
+ 34378, '23-Oct-2007', 6
test_database/bakery_1/link.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ http://users.csc.calpoly.edu/~dekhtyar/365-Spring2017/index.html
test_database/bakery_1/q.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Find all chocolate-flavored items on the menu whose price is under $5.00. For each item output the flavor, the name (food type) of the item, and the price.
2
+
3
+ Report the prices of any lemon-flavored items. Output the flavor, the name (food type) and the price of each pastry.
4
+
5
+ Find all customers who made a purchase on October 3, 2007. Report the name of the customer (first, last).
6
+
7
+ Find all types of cookies purchased by KIP ARNN during the month of October of 2007. Report each cookie type (flavor, food type) exactly once.
8
+
9
+ Report the total amount of money NATACHA STENZ spent at the bakery during the month of October, 2007.
10
+
11
+ Find all customers who purchased, during the same trip to the bakery, two different Croissants. Report first and last names of the customers.
12
+
13
+ Find the total amount of money the bakery earned in October 2007 from selling eclairs. Report just the amount.
14
+
15
+ Report all days on which more than ten tarts were purchased.
16
+
17
+ For each purchase made by NATACHA STENZ output the receipt number, the date of purchase, the total number of items purchased and the amount paid.
18
+
19
+ Find the customer(s) who spent the most on pastries in October of 2007. Report first and last name.
20
+
21
+ Find the type of baked good (food type, flavor) responsible for highest total revenue.
22
+
23
+ Find the day of the highest revenue in the month of October, 2007.
24
+
25
+ Find the best-selling item (by number of purchases) on the day of the highest revenue in October of 2007.
test_database/bike_1/schema.sql ADDED
The diff for this file is too large to render. See raw diff
 
test_database/car_1/car_1.json ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "col_data": [
4
+ {
5
+ "column_name": "ContId",
6
+ "data_type": "INTEGER",
7
+ "default_column_name": "ContId",
8
+ "default_value": null,
9
+ "not_null": 0,
10
+ "primary_key": 1
11
+ },
12
+ {
13
+ "column_name": "Continent",
14
+ "data_type": "TEXT",
15
+ "default_column_name": "Continent",
16
+ "default_value": null,
17
+ "not_null": 0,
18
+ "primary_key": 0
19
+ }
20
+ ],
21
+ "table": "continents"
22
+ },
23
+ {
24
+ "col_data": [
25
+ {
26
+ "column_name": "CountryId",
27
+ "data_type": "INTEGER",
28
+ "default_column_name": "CountryId",
29
+ "default_value": null,
30
+ "not_null": 0,
31
+ "primary_key": 1
32
+ },
33
+ {
34
+ "column_name": "CountryName",
35
+ "data_type": "TEXT",
36
+ "default_column_name": "CountryName",
37
+ "default_value": null,
38
+ "not_null": 0,
39
+ "primary_key": 0
40
+ },
41
+ {
42
+ "column_name": "Continent",
43
+ "data_type": "INTEGER",
44
+ "default_column_name": "Continent",
45
+ "default_value": null,
46
+ "not_null": 0,
47
+ "primary_key": 0
48
+ }
49
+ ],
50
+ "table": "countries"
51
+ },
52
+ {
53
+ "col_data": [
54
+ {
55
+ "column_name": "Id",
56
+ "data_type": "INTEGER",
57
+ "default_column_name": "Id",
58
+ "default_value": null,
59
+ "not_null": 0,
60
+ "primary_key": 1
61
+ },
62
+ {
63
+ "column_name": "Maker",
64
+ "data_type": "TEXT",
65
+ "default_column_name": "Maker",
66
+ "default_value": null,
67
+ "not_null": 0,
68
+ "primary_key": 0
69
+ },
70
+ {
71
+ "column_name": "FullName",
72
+ "data_type": "TEXT",
73
+ "default_column_name": "FullName",
74
+ "default_value": null,
75
+ "not_null": 0,
76
+ "primary_key": 0
77
+ },
78
+ {
79
+ "column_name": "Country",
80
+ "data_type": "TEXT",
81
+ "default_column_name": "Country",
82
+ "default_value": null,
83
+ "not_null": 0,
84
+ "primary_key": 0
85
+ }
86
+ ],
87
+ "table": "car-makers"
88
+ },
89
+ {
90
+ "col_data": [
91
+ {
92
+ "column_name": "MakeId",
93
+ "data_type": "INTEGER",
94
+ "default_column_name": "MakeId",
95
+ "default_value": null,
96
+ "not_null": 0,
97
+ "primary_key": 1
98
+ },
99
+ {
100
+ "column_name": "Model",
101
+ "data_type": "TEXT",
102
+ "default_column_name": "Model",
103
+ "default_value": null,
104
+ "not_null": 0,
105
+ "primary_key": 0
106
+ },
107
+ {
108
+ "column_name": "Make",
109
+ "data_type": "TEXT",
110
+ "default_column_name": "Make",
111
+ "default_value": null,
112
+ "not_null": 0,
113
+ "primary_key": 0
114
+ }
115
+ ],
116
+ "table": "car-names"
117
+ },
118
+ {
119
+ "col_data": [
120
+ {
121
+ "column_name": "Id",
122
+ "data_type": "INTEGER",
123
+ "default_column_name": "Id",
124
+ "default_value": null,
125
+ "not_null": 0,
126
+ "primary_key": 1
127
+ },
128
+ {
129
+ "column_name": "MPG",
130
+ "data_type": "TEXT",
131
+ "default_column_name": "MPG",
132
+ "default_value": null,
133
+ "not_null": 0,
134
+ "primary_key": 0
135
+ },
136
+ {
137
+ "column_name": "Cylinders",
138
+ "data_type": "INTEGER",
139
+ "default_column_name": "Cylinders",
140
+ "default_value": null,
141
+ "not_null": 0,
142
+ "primary_key": 0
143
+ },
144
+ {
145
+ "column_name": "Edispl",
146
+ "data_type": "REAL",
147
+ "default_column_name": "Edispl",
148
+ "default_value": null,
149
+ "not_null": 0,
150
+ "primary_key": 0
151
+ },
152
+ {
153
+ "column_name": "Horsepower",
154
+ "data_type": "TEXT",
155
+ "default_column_name": "Horsepower",
156
+ "default_value": null,
157
+ "not_null": 0,
158
+ "primary_key": 0
159
+ },
160
+ {
161
+ "column_name": "Weight",
162
+ "data_type": "INTEGER",
163
+ "default_column_name": "Weight",
164
+ "default_value": null,
165
+ "not_null": 0,
166
+ "primary_key": 0
167
+ },
168
+ {
169
+ "column_name": "Accelerate",
170
+ "data_type": "REAL",
171
+ "default_column_name": "Accelerate",
172
+ "default_value": null,
173
+ "not_null": 0,
174
+ "primary_key": 0
175
+ },
176
+ {
177
+ "column_name": "Year",
178
+ "data_type": "INTEGER",
179
+ "default_column_name": "Year",
180
+ "default_value": null,
181
+ "not_null": 0,
182
+ "primary_key": 0
183
+ }
184
+ ],
185
+ "table": "cars-data"
186
+ },
187
+ {
188
+ "col_data": [
189
+ {
190
+ "column_name": "ModelId",
191
+ "data_type": "INTEGER",
192
+ "default_column_name": "ModelId",
193
+ "default_value": null,
194
+ "not_null": 0,
195
+ "primary_key": 1
196
+ },
197
+ {
198
+ "column_name": "Maker",
199
+ "data_type": "INTEGER",
200
+ "default_column_name": "Maker",
201
+ "default_value": null,
202
+ "not_null": 0,
203
+ "primary_key": 0
204
+ },
205
+ {
206
+ "column_name": "Model",
207
+ "data_type": "TEXT",
208
+ "default_column_name": "Model",
209
+ "default_value": null,
210
+ "not_null": 0,
211
+ "primary_key": 0
212
+ }
213
+ ],
214
+ "table": "model-list"
215
+ }
216
+ ]
test_database/car_1/data_csv/car-makers.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Id,Maker,FullName,Country
2
+ 1,'amc','American Motor Company',1
3
+ 2,'volkswagen','Volkswagen',2
4
+ 3,'bmw','BMW',2
5
+ 4,'gm','General Motors',1
6
+ 5,'ford','Ford Motor Company',1
7
+ 6,'chrysler','Chrysler',1
8
+ 7,'citroen','Citroen',3
9
+ 8,'nissan','Nissan Motors',4
10
+ 9,'fiat','Fiat',5
11
+ 10,'hi','hi',null
12
+ 11,'honda','Honda',4
13
+ 12,'mazda','Mazda',4
14
+ 13,'daimler benz','Daimler Benz',2
15
+ 14,'opel','Opel',2
16
+ 15,'peugeaut','Peugeaut',3
17
+ 16,'renault','Renault',3
18
+ 17,'saab','Saab',6
19
+ 18,'subaru','Subaru',4
20
+ 19,'toyota','Toyota',4
21
+ 20,'triumph','Triumph',7
22
+ 21,'volvo','Volvo',6
23
+ 22,'kia','Kia Motors',8
24
+ 23,'hyundai','Hyundai',8
test_database/city_record/city_record.sqlite ADDED
Binary file (36.9 kB). View file
 
test_database/club_1/club_1.sqlite ADDED
Binary file (16.4 kB). View file
 
test_database/club_leader/club_leader.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/club_leader/schema_old.sql ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ PRAGMA foreign_keys = ON;
3
+
4
+ CREATE TABLE "member" (
5
+ "Member_ID" int,
6
+ "Name" text,
7
+ "Nationality" text,
8
+ "Age" int,
9
+ PRIMARY KEY ("Member_ID")
10
+ );
11
+
12
+ CREATE TABLE "club" (
13
+ "Club_ID" int,
14
+ "Overall_Ranking" int,
15
+ "Team_Leader" text,
16
+ "Club_Name" text,
17
+ PRIMARY KEY ("Club_ID")
18
+ );
19
+
20
+ INSERT INTO "member" VALUES ("1984","Wally Lewis","Australia",23);
21
+ INSERT INTO "member" VALUES ("1985","Brett Kenny","Australia",19);
22
+ INSERT INTO "member" VALUES ("1986","Garry Jack","Australia",18);
23
+ INSERT INTO "member" VALUES ("1987","Hugh McGahan Peter Sterling","New Zealand Australia",24);
24
+ INSERT INTO "member" VALUES ("1988","Ellery Hanley","England",19);
25
+ INSERT INTO "member" VALUES ("1989","Mal Meninga","Australia",22);
26
+ INSERT INTO "member" VALUES ("1990","Garry Schofield","England",21);
27
+ INSERT INTO "member" VALUES ("1991","No award given","No award given",20);
28
+ INSERT INTO "member" VALUES ("1999","Andrew Johns","Australia",19);
29
+ INSERT INTO "member" VALUES ("2000","Brad Fittler","Australia",17);
30
+
31
+
32
+ INSERT INTO "club" VALUES ("1","5","Mack Mitchell","Houston");
33
+ INSERT INTO "club" VALUES ("3","57","Oscar Roan","SMU");
34
+ INSERT INTO "club" VALUES ("4","82","Tony Peters","Oklahoma");
35
+ INSERT INTO "club" VALUES ("5","109","John Zimba","Villanova");
36
+ INSERT INTO "club" VALUES ("2","119","Jim Cope","Ohio State");
37
+ INSERT INTO "club" VALUES ("6","150","Charles Miller","West Virginia");
38
+ INSERT INTO "club" VALUES ("16","154","Henry Hynoski","Temple");
39
+ INSERT INTO "club" VALUES ("7","161","Merle Wang","TCU");
40
+ INSERT INTO "club" VALUES ("8","186","Barry Santini","Purdue");
41
+ INSERT INTO "club" VALUES ("9","213","Larry Poole","Kent State");
42
+ INSERT INTO "club" VALUES ("19","215","Floyd Hogan","Arkansas");
43
+ INSERT INTO "club" VALUES ("10","238","Stan Lewis","Wayne");
44
+
45
+
46
+ CREATE TABLE "club_leader" (
47
+ "Club_ID" int,
48
+ "Member_ID" int,
49
+ "Year_Join" text,
50
+ PRIMARY KEY ("Club_ID","Member_ID"),
51
+ FOREIGN KEY ("Club_ID") REFERENCES "club"("Club_ID"),
52
+ FOREIGN KEY ("Member_ID") REFERENCES "member"("Member_ID")
53
+ );
54
+
55
+ INSERT INTO "club_leader" VALUES (1,1988,"2018");
56
+ INSERT INTO "club_leader" VALUES (8,1984,"2017");
57
+ INSERT INTO "club_leader" VALUES (6,1985,"2015");
58
+ INSERT INTO "club_leader" VALUES (4,1990,"2018");
59
+ INSERT INTO "club_leader" VALUES (10,1991,"2017");
60
+ INSERT INTO "club_leader" VALUES (6,1999,"2018");
61
+
test_database/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite ADDED
Binary file (57.3 kB). View file
 
test_database/cre_Doc_Tracking_DB/schema.sql ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+ CREATE TABLE Ref_Document_Types (
3
+ Document_Type_Code CHAR(15) NOT NULL,
4
+ Document_Type_Name VARCHAR(255) NOT NULL,
5
+ Document_Type_Description VARCHAR(255) NOT NULL,
6
+ PRIMARY KEY (Document_Type_Code)
7
+ );
8
+
9
+ CREATE TABLE Ref_Calendar (
10
+ Calendar_Date DATETIME NOT NULL,
11
+ Day_Number INTEGER,
12
+ PRIMARY KEY (Calendar_Date)
13
+ );
14
+ CREATE TABLE Ref_Locations (
15
+ Location_Code CHAR(15) NOT NULL,
16
+ Location_Name VARCHAR(255) NOT NULL,
17
+ Location_Description VARCHAR(255) NOT NULL,
18
+ PRIMARY KEY (Location_Code)
19
+ );
20
+
21
+ CREATE TABLE Roles (
22
+ Role_Code CHAR(15) NOT NULL,
23
+ Role_Name VARCHAR(255),
24
+ Role_Description VARCHAR(255),
25
+ PRIMARY KEY (Role_Code)
26
+ );
27
+
28
+ CREATE TABLE All_Documents (
29
+ Document_ID INTEGER NOT NULL,
30
+ Date_Stored DATETIME,
31
+ Document_Type_Code CHAR(15) NOT NULL,
32
+ Document_Name CHAR(255),
33
+ Document_Description CHAR(255),
34
+ Other_Details VARCHAR(255),
35
+ PRIMARY KEY (Document_ID),
36
+ FOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),
37
+ FOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar (Calendar_Date)
38
+ );
39
+
40
+ CREATE TABLE Employees (
41
+ Employee_ID INTEGER NOT NULL,
42
+ Role_Code CHAR(15) NOT NULL,
43
+ Employee_Name VARCHAR(255),
44
+ Gender_MFU CHAR(1) NOT NULL,
45
+ Date_of_Birth DATETIME NOT NULL,
46
+ Other_Details VARCHAR(255),
47
+ PRIMARY KEY (Employee_ID),
48
+ FOREIGN KEY (Role_Code) REFERENCES Roles (Role_Code)
49
+ );
50
+
51
+ CREATE TABLE Document_Locations (
52
+ Document_ID INTEGER NOT NULL,
53
+ Location_Code CHAR(15) NOT NULL,
54
+ Date_in_Location_From DATETIME NOT NULL,
55
+ Date_in_Locaton_To DATETIME,
56
+ PRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From),
57
+ FOREIGN KEY (Location_Code) REFERENCES Ref_Locations (Location_Code),
58
+ FOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar (Calendar_Date),
59
+ FOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar (Calendar_Date),
60
+ FOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)
61
+ );
62
+
63
+ CREATE TABLE Documents_to_be_Destroyed (
64
+ Document_ID INTEGER NOT NULL,
65
+ Destruction_Authorised_by_Employee_ID INTEGER,
66
+ Destroyed_by_Employee_ID INTEGER,
67
+ Planned_Destruction_Date DATETIME,
68
+ Actual_Destruction_Date DATETIME,
69
+ Other_Details VARCHAR(255),
70
+ PRIMARY KEY (Document_ID),
71
+ FOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees (Employee_ID),
72
+ FOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees (Employee_ID),
73
+ FOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),
74
+ FOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),
75
+ FOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)
76
+ );
77
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1972-03-31 09:47:22', 5);
78
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1976-06-15 03:40:06', 7);
79
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1985-05-13 12:19:43', 7);
80
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1986-10-14 17:53:39', 1);
81
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1987-11-05 06:11:22', 3);
82
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1988-02-01 14:41:52', 8);
83
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1994-11-15 03:49:54', 9);
84
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1995-01-01 03:52:11', 1);
85
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('1997-03-10 15:24:00', 7);
86
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2007-05-28 16:28:48', 2);
87
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2008-06-08 12:45:38', 3);
88
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2009-08-18 03:29:08', 8);
89
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2010-11-26 19:22:50', 7);
90
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2012-07-03 09:48:46', 7);
91
+ INSERT INTO Ref_Calendar (`Calendar_Date`, `Day_Number`) VALUES ('2017-01-06 23:17:22', 8);
92
+ INSERT INTO Ref_Document_Types (`Document_Type_Code`, `Document_Type_Name`, `Document_Type_Description`) VALUES ('CV', 'CV', '');
93
+ INSERT INTO Ref_Document_Types (`Document_Type_Code`, `Document_Type_Name`, `Document_Type_Description`) VALUES ('BK', 'Book', '');
94
+ INSERT INTO Ref_Document_Types (`Document_Type_Code`, `Document_Type_Name`, `Document_Type_Description`) VALUES ('PR', 'Paper', '');
95
+ INSERT INTO Ref_Document_Types (`Document_Type_Code`, `Document_Type_Name`, `Document_Type_Description`) VALUES ('RV', 'Review', '');
96
+ INSERT INTO Ref_Locations (`Location_Code`, `Location_Name`, `Location_Description`) VALUES ('b', 'Brazil', '');
97
+ INSERT INTO Ref_Locations (`Location_Code`, `Location_Name`, `Location_Description`) VALUES ('c', 'Canada', '');
98
+ INSERT INTO Ref_Locations (`Location_Code`, `Location_Name`, `Location_Description`) VALUES ('e', 'Edinburgh', '');
99
+ INSERT INTO Ref_Locations (`Location_Code`, `Location_Name`, `Location_Description`) VALUES ('n', 'Nanjing', '');
100
+ INSERT INTO Ref_Locations (`Location_Code`, `Location_Name`, `Location_Description`) VALUES ('x', 'Xiamen', '');
101
+ INSERT INTO Roles (`Role_Code`, `Role_Name`, `Role_Description`) VALUES ('MG', 'Manager', 'Vero harum corrupti odit ipsa vero et odio. Iste et recusandae temporibus maxime. Magni aspernatur fugit quis explicabo totam esse corrupti.');
102
+ INSERT INTO Roles (`Role_Code`, `Role_Name`, `Role_Description`) VALUES ('ED', 'Editor', 'Itaque dolor ut nemo rerum vitae provident. Vel laborum ipsum velit sint. Et est omnis dignissimos.');
103
+ INSERT INTO Roles (`Role_Code`, `Role_Name`, `Role_Description`) VALUES ('PT', 'Photo', 'Aut modi nihil molestias temporibus sit rerum. Sit neque eaque odio omnis incidunt.');
104
+ INSERT INTO Roles (`Role_Code`, `Role_Name`, `Role_Description`) VALUES ('PR', 'Proof Reader', 'Ut sed quae eaque mollitia qui hic. Natus ea expedita et odio illum fugiat qui natus. Consequatur velit ut dolorem cum ullam esse deserunt dignissimos. Enim non non rem officiis quis.');
105
+ INSERT INTO Roles (`Role_Code`, `Role_Name`, `Role_Description`) VALUES ('HR', 'Human Resource', 'Et totam est quibusdam aspernatur ut. Vitae perferendis eligendi voluptatem molestiae rem ut enim. Ipsum expedita quae earum unde est. Repellendus ut ipsam nihil accusantium sit. Magni accusantium numquam quod et.');
106
+
107
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (25, 'HR', 'Leo', '', '1973-02-15 17:16:00', NULL);
108
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (30, 'MG', 'Ebba', '', '1979-09-20 12:50:15', NULL);
109
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (38, 'ED', 'Stephanie', '1', '2012-03-30 23:02:28', NULL);
110
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (55, 'ED', 'Harley', '', '1972-02-18 11:53:30', NULL);
111
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (57, 'ED', 'Armani', '', '1988-12-08 06:13:33', NULL);
112
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (71, 'ED', 'Gussie', '', '1973-04-04 21:41:22', NULL);
113
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (99, 'ED', 'Izabella', '1', '1977-07-04 16:25:21', NULL);
114
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (123, 'PT', 'Hugh', '', '2010-03-15 00:17:13', NULL);
115
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (136, 'ED', 'Mallie', '', '1980-12-11 20:28:20', NULL);
116
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (138, 'ED', 'Beatrice', '1', '2013-04-02 23:55:48', NULL);
117
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (156, 'PR', 'Diego', '', '1998-05-30 12:54:10', NULL);
118
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (159, 'PR', 'Arno', '', '2010-06-10 20:36:34', NULL);
119
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (173, 'PR', 'Alene', '1', '1980-10-14 12:23:10', NULL);
120
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (181, 'PR', 'Ettie', '1', '1988-08-03 00:11:14', NULL);
121
+ INSERT INTO Employees (`Employee_ID`, `Role_Code`, `Employee_Name`, `Gender_MFU`, `Date_of_Birth`, `Other_Details`) VALUES (183, 'PR', 'Jeramie', '', '1993-08-21 05:22:10', NULL);
122
+
123
+
124
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (7, '1976-06-15 03:40:06', 'CV', 'Robin CV', NULL, NULL);
125
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (11, '1986-10-14 17:53:39', 'CV', 'Marry CV', NULL, NULL);
126
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (25, '2008-06-08 12:45:38', 'BK', 'One hundred years of solitude', NULL, NULL);
127
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (39, '2012-07-03 09:48:46', 'BK', 'How to read a book', NULL, NULL);
128
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (72, '2012-07-03 09:48:46', 'CV', 'Alan CV', NULL, NULL);
129
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (81, '1995-01-01 03:52:11', 'BK', 'Hua Mulan', NULL, NULL);
130
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (99, '2008-06-08 12:45:38', 'CV', 'Leon CV', NULL, NULL);
131
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (111, '1987-11-05 06:11:22', 'PR', 'Learning features of CNN', NULL, NULL);
132
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (119, '2008-06-08 12:45:38', 'RV', 'Marriage and population', NULL, NULL);
133
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (120, '1997-03-10 15:24:00', 'RV', 'Society and tax', NULL, NULL);
134
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (166, '1997-03-10 15:24:00', 'PR', 'Are you talking to a machine', NULL, NULL);
135
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (170, '2009-08-18 03:29:08', 'RV', 'Population', NULL, NULL);
136
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (230, '1976-06-15 03:40:06', 'CV', 'Martin CV', NULL, NULL);
137
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (252, '1976-06-15 03:40:06', 'BK', 'Summer', NULL, NULL);
138
+ INSERT INTO All_Documents (`Document_ID`, `Date_Stored`, `Document_Type_Code`, `Document_Name`, `Document_Description`, `Other_Details`) VALUES (260, '1997-03-10 15:24:00', 'BK', 'Cats and me', NULL, NULL);
139
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (7, 'e', '2017-01-06 23:17:22', '2008-06-08 12:45:38');
140
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (11, 'x', '2017-01-06 23:17:22', '2012-07-03 09:48:46');
141
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (81, 'c', '1972-03-31 09:47:22', '1987-11-05 06:11:22');
142
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (81, 'c', '2017-01-06 23:17:22', '2010-11-26 19:22:50');
143
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (81, 'x', '2008-06-08 12:45:38', '1976-06-15 03:40:06');
144
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (111, 'x', '1986-10-14 17:53:39', '2010-11-26 19:22:50');
145
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (119, 'b', '2017-01-06 23:17:22', '1995-01-01 03:52:11');
146
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (166, 'b', '1985-05-13 12:19:43', '1986-10-14 17:53:39');
147
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (166, 'b', '1986-10-14 17:53:39', '2010-11-26 19:22:50');
148
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (170, 'x', '1997-03-10 15:24:00', '1976-06-15 03:40:06');
149
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (230, 'e', '1972-03-31 09:47:22', '1987-11-05 06:11:22');
150
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (230, 'e', '2010-11-26 19:22:50', '2017-01-06 23:17:22');
151
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (252, 'n', '2017-01-06 23:17:22', '1997-03-10 15:24:00');
152
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (252, 'x', '1972-03-31 09:47:22', '2009-08-18 03:29:08');
153
+ INSERT INTO Document_Locations (`Document_ID`, `Location_Code`, `Date_in_Location_From`, `Date_in_Locaton_To`) VALUES (260, 'e', '2009-08-18 03:29:08', '1986-10-14 17:53:39');
154
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (7, 156, 138, '1988-02-01 14:41:52', '2017-01-06 23:17:22', NULL);
155
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (11, 55, 173, '2010-11-26 19:22:50', '1986-10-14 17:53:39', NULL);
156
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (25, 183, 156, '2009-08-18 03:29:08', '1995-01-01 03:52:11', NULL);
157
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (39, 183, 136, '1976-06-15 03:40:06', '2009-08-18 03:29:08', NULL);
158
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (99, 55, 99, '2017-01-06 23:17:22', '1986-10-14 17:53:39', NULL);
159
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (111, 38, 173, '1972-03-31 09:47:22', '2009-08-18 03:29:08', NULL);
160
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (120, 183, 173, '1972-03-31 09:47:22', '1995-01-01 03:52:11', NULL);
161
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (166, 156, 38, '1987-11-05 06:11:22', '2012-07-03 09:48:46', NULL);
162
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (170, 123, 136, '2017-01-06 23:17:22', '1988-02-01 14:41:52', NULL);
163
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (252, 30, 55, '1972-03-31 09:47:22', '1985-05-13 12:19:43', NULL);
164
+ INSERT INTO Documents_to_be_Destroyed (`Document_ID`, `Destruction_Authorised_by_Employee_ID`, `Destroyed_by_Employee_ID`, `Planned_Destruction_Date`, `Actual_Destruction_Date`, `Other_Details`) VALUES (260, 55, 99, '2017-01-06 23:17:22', '2017-01-06 23:17:22', NULL);
test_database/cre_Students_Information_Systems/schema.sql ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+ CREATE TABLE Students (
4
+ `student_id` INTEGER NOT NULL,
5
+ `bio_data` VARCHAR(255) NOT NULL,
6
+ `student_details` VARCHAR(255) NOT NULL,
7
+ PRIMARY KEY (`student_id`)
8
+ );
9
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (276, 'Camila', 'Suite 076');
10
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (287, 'Dino', 'Suite 970');
11
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (325, 'Pansy', 'Apt. 149');
12
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (361, 'Louvenia', 'Suite 218');
13
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (415, 'Leora', 'Apt. 748');
14
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (435, 'Vanessa', 'Suite 684');
15
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (471, 'Antone', 'Suite 303');
16
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (567, 'Arturo', 'Apt. 491');
17
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (648, 'Leonard', 'Suite 505');
18
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (669, 'Brenden', 'Apt. 305');
19
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (762, 'Edison', 'Apt. 763');
20
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (777, 'Houston', 'Apt. 040');
21
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (811, 'Felipa', 'Apt. 253');
22
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (824, 'Stephon', 'Suite 839');
23
+ INSERT INTO Students (`student_id`, `bio_data`, `student_details`) VALUES (984, 'Keshawn', 'Suite 889');
24
+
25
+
26
+
27
+ /* ---------------------------------------------------------------------- */
28
+ /* Add table "Transcripts" */
29
+ /* ---------------------------------------------------------------------- */
30
+ CREATE TABLE Transcripts (
31
+ `transcript_id` INTEGER NOT NULL,
32
+ `student_id` INTEGER NOT NULL,
33
+ `date_of_transcript` DATETIME(3),
34
+ `transcript_details` VARCHAR(255) NOT NULL,
35
+ PRIMARY KEY (`transcript_id`),
36
+ FOREIGN KEY (student_id) REFERENCES Students (student_id)
37
+ );
38
+
39
+
40
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (131, 669, '1973-08-09 00:00:00.000', 'Good');
41
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (138, 824, '1973-11-05 00:00:00.000', 'Good');
42
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (145, 361, '2002-11-23 00:00:00.000', 'Good');
43
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (167, 276, '2017-03-17 00:00:00.000', 'Pass');
44
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (177, 811, '2010-12-14 00:00:00.000', 'Good');
45
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (224, 567, '1973-05-05 00:00:00.000', 'Pass');
46
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (264, 824, '2005-06-04 00:00:00.000', 'Good');
47
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (276, 415, '2002-02-26 00:00:00.000', 'Pass');
48
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (283, 287, '1979-04-05 00:00:00.000', 'Good');
49
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (293, 276, '2017-10-31 00:00:00.000', 'Pass');
50
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (307, 648, '1981-12-01 00:00:00.000', 'Good');
51
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (309, 777, '1979-02-07 00:00:00.000', 'Pass');
52
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (325, 361, '2015-07-24 00:00:00.000', 'Good');
53
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (330, 669, '2014-09-13 00:00:00.000', 'Pass');
54
+ INSERT INTO Transcripts (`transcript_id`, `student_id`, `date_of_transcript`, `transcript_details`) VALUES (377, 984, '1982-12-04 00:00:00.000', 'Pass');
55
+
56
+
57
+ /* ---------------------------------------------------------------------- */
58
+ /* Add table "Behaviour_Monitoring" */
59
+ /* ---------------------------------------------------------------------- */
60
+ CREATE TABLE Behaviour_Monitoring (
61
+ `behaviour_monitoring_id` INTEGER NOT NULL,
62
+ `student_id` INTEGER NOT NULL,
63
+ `behaviour_monitoring_details` VARCHAR(255) NOT NULL,
64
+ PRIMARY KEY (`behaviour_monitoring_id`),
65
+ FOREIGN KEY (student_id) REFERENCES Students (student_id)
66
+ );
67
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (142, 435, 'A');
68
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (220, 811, 'A');
69
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (248, 567, 'A');
70
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (265, 984, 'B');
71
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (376, 648, 'B');
72
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (434, 777, 'B');
73
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (448, 567, 'C');
74
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (477, 287, 'C');
75
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (572, 287, 'A');
76
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (674, 361, 'C');
77
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (701, 669, 'D');
78
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (705, 435, 'A');
79
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (834, 984, 'E');
80
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (873, 325, 'A');
81
+ INSERT INTO Behaviour_Monitoring (`behaviour_monitoring_id`, `student_id`, `behaviour_monitoring_details`) VALUES (994, 648, 'B');
82
+
83
+ /* ---------------------------------------------------------------------- */
84
+ /* Add table "Addresses" */
85
+ /* ---------------------------------------------------------------------- */
86
+ CREATE TABLE Addresses (
87
+ `address_id` INTEGER NOT NULL,
88
+ `address_details` VARCHAR(255) NOT NULL,
89
+ PRIMARY KEY (`address_id`)
90
+ );
91
+
92
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (0, '607 Nikita Cape Suite 449');
93
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (4, '4474 Dina Park');
94
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (5, '19571 Garrett Manor');
95
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (34, '423 Rosenbaum Shores Apt. 812');
96
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (47, '100 Hayes Point');
97
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (51, '0773 Kaci Villages');
98
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (66, '33376 Terry Mews Suite 922');
99
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (72, '90147 Greenholt Springs Apt. 497');
100
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (74, '1951 Beatty Oval');
101
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (76, '41082 Calista Mountains');
102
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (85, '4240 Enrico Grove');
103
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (90, '7127 Ressie Plains');
104
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (94, '222 Chase Union Apt. 747');
105
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (97, '564 Aaliyah Trace');
106
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (98, '033 Robel Courts Apt. 312');
107
+
108
+
109
+
110
+ /* ---------------------------------------------------------------------- */
111
+ /* Add table "Ref_Event_Types" */
112
+ /* ---------------------------------------------------------------------- */
113
+ CREATE TABLE Ref_Event_Types (
114
+ `event_type_code` CHAR(10) NOT NULL,
115
+ `event_type_description` VARCHAR(255) NOT NULL,
116
+ PRIMARY KEY (`event_type_code`)
117
+ );
118
+ CREATE TABLE Ref_Achievement_Type (
119
+ `achievement_type_code` CHAR(15) NOT NULL,
120
+ `achievement_type_description` VARCHAR(80),
121
+ PRIMARY KEY (`achievement_type_code`)
122
+ );
123
+
124
+
125
+ /* ---------------------------------------------------------------------- */
126
+ /* Add table "Ref_Address_Types" */
127
+ /* ---------------------------------------------------------------------- */
128
+ CREATE TABLE Ref_Address_Types (
129
+ `address_type_code` CHAR(10) NOT NULL,
130
+ `address_type_description` VARCHAR(255) NOT NULL,
131
+ PRIMARY KEY (`address_type_code`)
132
+ );
133
+
134
+ /* ---------------------------------------------------------------------- */
135
+ /* Add table "Ref_Detention_Type" */
136
+ /* ---------------------------------------------------------------------- */
137
+ CREATE TABLE Ref_Detention_Type (
138
+ `detention_type_code` CHAR(10) NOT NULL,
139
+ `detention_type_description` VARCHAR(80),
140
+ PRIMARY KEY (`detention_type_code`)
141
+ );
142
+
143
+ INSERT INTO Ref_Achievement_Type (`achievement_type_code`, `achievement_type_description`) VALUES ('Athletic', 'Athletic');
144
+ INSERT INTO Ref_Achievement_Type (`achievement_type_code`, `achievement_type_description`) VALUES ('Scholastic', 'Scholastic');
145
+ INSERT INTO Ref_Address_Types (`address_type_code`, `address_type_description`) VALUES ('CO', 'College');
146
+ INSERT INTO Ref_Address_Types (`address_type_code`, `address_type_description`) VALUES ('HM', 'Home');
147
+ INSERT INTO Ref_Detention_Type (`detention_type_code`, `detention_type_description`) VALUES ('After School', 'After School');
148
+ INSERT INTO Ref_Detention_Type (`detention_type_code`, `detention_type_description`) VALUES ('Break', 'On break');
149
+ INSERT INTO Ref_Detention_Type (`detention_type_code`, `detention_type_description`) VALUES ('Illness', 'Leave for illness');
150
+ INSERT INTO Ref_Detention_Type (`detention_type_code`, `detention_type_description`) VALUES ('Lunch', 'During lunchtime');
151
+ INSERT INTO Ref_Event_Types (`event_type_code`, `event_type_description`) VALUES ('Exam', 'Exam');
152
+ INSERT INTO Ref_Event_Types (`event_type_code`, `event_type_description`) VALUES ('Registration', 'Registration');
153
+
154
+
155
+ /* ---------------------------------------------------------------------- */
156
+ /* Add table "Student_Events" */
157
+ /* ---------------------------------------------------------------------- */
158
+ CREATE TABLE Student_Events (
159
+ `event_id` INTEGER NOT NULL,
160
+ `event_type_code` CHAR(10) NOT NULL,
161
+ `student_id` INTEGER NOT NULL,
162
+ `event_date` DATETIME(3),
163
+ `other_details` VARCHAR(255) NOT NULL,
164
+ PRIMARY KEY (`event_id`),
165
+ FOREIGN KEY (student_id) REFERENCES Students (student_id),
166
+ FOREIGN KEY (event_type_code) REFERENCES Ref_Event_Types (event_type_code)
167
+ );
168
+
169
+ INSERT INTO Student_Events (`event_id`, `event_type_code`, `student_id`, `event_date`, `other_details`) VALUES (146, 'Exam', 287, '2008-08-15 22:16:17.000', '');
170
+ INSERT INTO Student_Events (`event_id`, `event_type_code`, `student_id`, `event_date`, `other_details`) VALUES (161, 'Exam', 777, '2014-07-15 18:18:15.000', '');
171
+ INSERT INTO Student_Events (`event_id`, `event_type_code`, `student_id`, `event_date`, `other_details`) VALUES (189, 'Exam', 361, '2013-04-14 04:14:10.000', '');
172
+ INSERT INTO Student_Events (`event_id`, `event_type_code`, `student_id`, `event_date`, `other_details`) VALUES (227, 'Registration', 669, '2012-12-06 06:44:53.000', '');
173
+
174
+
175
+
176
+
177
+ /* ---------------------------------------------------------------------- */
178
+ /* Add table "Teachers" */
179
+ /* ---------------------------------------------------------------------- */
180
+ CREATE TABLE Teachers (
181
+ `teacher_id` INTEGER NOT NULL,
182
+ `teacher_details` VARCHAR(255),
183
+ PRIMARY KEY (`teacher_id`)
184
+ );
185
+
186
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (115, 'Jon');
187
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (127, 'Tyson');
188
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (164, 'Trinity');
189
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (172, 'Viva');
190
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (195, 'Osvaldo');
191
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (212, 'Isabel');
192
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (226, 'Adella');
193
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (234, 'Chasity');
194
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (252, 'Wilfredo');
195
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (253, 'Marielle');
196
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (274, 'Beverly');
197
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (282, 'Nicholaus');
198
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (298, 'Arianna');
199
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (302, 'Angie');
200
+ INSERT INTO Teachers (`teacher_id`, `teacher_details`) VALUES (316, 'Hertha');
201
+
202
+ /* ---------------------------------------------------------------------- */
203
+ /* Add table "Ref_Achievement_Type" */
204
+ /* ---------------------------------------------------------------------- */
205
+
206
+ /* ---------------------------------------------------------------------- */
207
+ /* Add table "Student_Loans" */
208
+ /* ---------------------------------------------------------------------- */
209
+ CREATE TABLE Student_Loans (
210
+ `student_loan_id` INTEGER NOT NULL,
211
+ `student_id` INTEGER NOT NULL,
212
+ `date_of_loan` DATETIME(3),
213
+ `amount_of_loan` DECIMAL(15,4),
214
+ `other_details` VARCHAR(255),
215
+ PRIMARY KEY (`student_loan_id`),
216
+ FOREIGN KEY (student_id) REFERENCES Students (student_id)
217
+ );
218
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (165, 777, '1980-01-06 00:00:00.000', '2216.1500', NULL);
219
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (169, 669, '1991-03-24 00:00:00.000', '5223.1800', NULL);
220
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (188, 777, '1983-08-01 00:00:00.000', '3221.4900', NULL);
221
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (205, 777, '1977-08-27 00:00:00.000', '3358.8700', NULL);
222
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (267, 435, '2018-01-17 00:00:00.000', '5174.7600', NULL);
223
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (269, 361, '1989-05-07 00:00:00.000', '3803.6000', NULL);
224
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (287, 984, '1989-04-23 00:00:00.000', '1561.5700', NULL);
225
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (366, 361, '1992-11-14 00:00:00.000', '4190.3200', NULL);
226
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (408, 762, '1994-02-24 00:00:00.000', '4213.1300', NULL);
227
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (550, 762, '2004-04-11 00:00:00.000', '1644.6500', NULL);
228
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (574, 325, '1975-07-21 00:00:00.000', '1419.9700', NULL);
229
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (596, 824, '1978-08-01 00:00:00.000', '4454.3000', NULL);
230
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (652, 984, '2001-07-31 00:00:00.000', '4407.2700', NULL);
231
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (684, 415, '1993-11-23 00:00:00.000', '3768.4900', NULL);
232
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (718, 325, '1981-05-31 00:00:00.000', '2312.5300', NULL);
233
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (824, 824, '2012-11-19 00:00:00.000', '1785.4400', NULL);
234
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (837, 984, '1994-02-10 00:00:00.000', '2645.7600', NULL);
235
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (850, 287, '1973-10-22 00:00:00.000', '5006.9400', NULL);
236
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (889, 567, '2014-01-06 00:00:00.000', '3685.7400', NULL);
237
+ INSERT INTO Student_Loans (`student_loan_id`, `student_id`, `date_of_loan`, `amount_of_loan`, `other_details`) VALUES (965, 824, '1983-05-03 00:00:00.000', '4528.5000', NULL);
238
+
239
+
240
+ /* ---------------------------------------------------------------------- */
241
+ /* Add table "Classes" */
242
+ /* ---------------------------------------------------------------------- */
243
+ CREATE TABLE Classes (
244
+ `class_id` INTEGER NOT NULL,
245
+ `student_id` INTEGER NOT NULL,
246
+ `teacher_id` INTEGER NOT NULL,
247
+ `class_details` VARCHAR(255) NOT NULL,
248
+ PRIMARY KEY (`class_id`),
249
+ FOREIGN KEY (student_id) REFERENCES Students (student_id),
250
+ FOREIGN KEY (teacher_id) REFERENCES Teachers (teacher_id)
251
+ );
252
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (114, 435, 253, 'databases');
253
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (195, 471, 274, 'english');
254
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (235, 811, 282, 'writing');
255
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (248, 471, 252, 'statistics');
256
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (294, 762, 234, 'math 100');
257
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (354, 287, 302, 'math 300');
258
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (387, 325, 316, 'statistics 100');
259
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (411, 811, 316, 'databases 200');
260
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (424, 669, 252, 'computer science 100');
261
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (429, 669, 195, 'data structure');
262
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (451, 762, 274, 'programming');
263
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (455, 471, 274, 'art 300');
264
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (493, 824, 252, 'music 100');
265
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (529, 567, 127, 'computer science 300');
266
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (552, 984, 234, 'law 200');
267
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (553, 762, 226, 'art 100');
268
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (579, 276, 282, 'debate');
269
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (600, 361, 195, 'networks');
270
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (613, 435, 212, 'dancing');
271
+ INSERT INTO Classes (`class_id`, `student_id`, `teacher_id`, `class_details`) VALUES (621, 811, 234, 'acting');
272
+
273
+
274
+ /* ---------------------------------------------------------------------- */
275
+ /* Add table "Students_Addresses" */
276
+ /* ---------------------------------------------------------------------- */
277
+ CREATE TABLE Students_Addresses (
278
+ `student_address_id` INTEGER NOT NULL,
279
+ `address_id` INTEGER NOT NULL,
280
+ `address_type_code` CHAR(10) NOT NULL,
281
+ `student_id` INTEGER NOT NULL,
282
+ `date_from` DATETIME(3),
283
+ `date_to` DATETIME(3),
284
+ PRIMARY KEY (`student_address_id`),
285
+ FOREIGN KEY (student_id) REFERENCES Students (student_id),
286
+ FOREIGN KEY (address_id) REFERENCES Addresses (address_id),
287
+ FOREIGN KEY (address_type_code) REFERENCES Ref_Address_Types (address_type_code)
288
+ );
289
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (11, 94, 'HM', 984, '2011-06-29 09:45:39.000', '2018-03-22 07:50:48.000');
290
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (15, 76, 'HM', 415, '2011-10-04 09:58:41.000', '2018-03-14 18:32:37.000');
291
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (20, 97, 'CO', 777, '2015-02-01 00:20:42.000', '2018-03-04 09:58:38.000');
292
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (23, 72, 'CO', 361, '2015-03-14 15:55:46.000', '2018-03-08 08:41:07.000');
293
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (33, 97, 'HM', 762, '2017-05-18 23:15:01.000', '2018-03-20 08:06:53.000');
294
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (35, 98, 'HM', 762, '2009-04-27 17:42:38.000', '2018-02-28 07:36:43.000');
295
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (45, 90, 'HM', 777, '2014-03-28 08:03:34.000', '2018-03-11 19:21:54.000');
296
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (56, 94, 'HM', 777, '2009-08-24 22:57:30.000', '2018-03-10 09:05:12.000');
297
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (59, 98, 'HM', 777, '2013-05-27 16:51:49.000', '2018-02-27 11:03:50.000');
298
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (67, 0, 'HM', 361, '2011-04-29 03:20:26.000', '2018-03-02 04:33:35.000');
299
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (73, 34, 'CO', 471, '2008-04-20 04:24:19.000', '2018-03-18 22:15:17.000');
300
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (80, 85, 'HM', 471, '2009-02-23 20:33:05.000', '2018-03-06 22:42:42.000');
301
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (84, 76, 'HM', 415, '2008-09-21 02:28:34.000', '2018-03-03 17:46:12.000');
302
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (91, 66, 'HM', 276, '2012-12-17 20:22:50.000', '2018-03-22 10:12:26.000');
303
+ INSERT INTO Students_Addresses (`student_address_id`, `address_id`, `address_type_code`, `student_id`, `date_from`, `date_to`) VALUES (92, 97, 'HM', 361, '2009-06-21 04:28:15.000', '2018-03-04 23:55:53.000');
304
+
305
+
306
+ /* ---------------------------------------------------------------------- */
307
+ /* Add table "Detention" */
308
+ /* ---------------------------------------------------------------------- */
309
+ CREATE TABLE Detention (
310
+ `detention_id` INTEGER NOT NULL,
311
+ `detention_type_code` CHAR(10) NOT NULL,
312
+ `student_id` INTEGER NOT NULL,
313
+ `datetime_detention_start` DATETIME(3),
314
+ `datetime_detention_end` DATETIME(3),
315
+ `detention_summary` VARCHAR(255),
316
+ `other_details` VARCHAR(255),
317
+ PRIMARY KEY (`detention_id`),
318
+ FOREIGN KEY (student_id) REFERENCES Students (student_id),
319
+ FOREIGN KEY (detention_type_code) REFERENCES Ref_Detention_Type (detention_type_code)
320
+ );
321
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (133, 'Lunch', 361, '2012-03-18 09:49:33.000', '2011-09-15 05:58:59.000', NULL, NULL);
322
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (141, 'After School', 811, '2012-06-07 15:01:05.000', '2009-05-23 17:33:31.000', NULL, NULL);
323
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (211, 'Break', 762, '2011-04-24 17:23:32.000', '2013-09-06 15:49:53.000', NULL, NULL);
324
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (242, 'After School', 648, '2014-01-16 00:49:33.000', '2013-04-07 15:42:52.000', NULL, NULL);
325
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (384, 'Illness', 762, '2016-12-28 21:44:59.000', '2013-04-20 13:13:40.000', NULL, NULL);
326
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (401, 'Break', 415, '2011-03-22 20:51:56.000', '2013-10-06 03:49:35.000', NULL, NULL);
327
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (451, 'After School', 361, '2014-02-03 00:18:05.000', '2012-05-09 00:54:20.000', NULL, NULL);
328
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (478, 'Illness', 762, '2010-03-14 06:33:25.000', '2015-10-16 19:21:09.000', NULL, NULL);
329
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (492, 'Break', 471, '2018-03-16 04:10:29.000', '2008-06-03 01:53:37.000', NULL, NULL);
330
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (545, 'Illness', 276, '2013-06-24 06:36:47.000', '2014-05-18 21:10:48.000', NULL, NULL);
331
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (576, 'After School', 471, '2010-08-24 04:11:35.000', '2015-12-13 06:27:13.000', NULL, NULL);
332
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (646, 'Illness', 984, '2017-08-12 03:26:18.000', '2013-12-02 02:48:47.000', NULL, NULL);
333
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (796, 'Illness', 415, '2010-08-16 18:17:43.000', '2013-10-18 09:56:25.000', NULL, NULL);
334
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (804, 'After School', 648, '2015-07-11 17:47:17.000', '2014-10-14 11:25:12.000', NULL, NULL);
335
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (860, 'Illness', 435, '2009-07-29 16:16:12.000', '2016-06-03 08:58:25.000', NULL, NULL);
336
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (868, 'Illness', 435, '2017-01-09 13:20:45.000', '2016-06-03 07:14:46.000', NULL, NULL);
337
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (876, 'After School', 669, '2008-04-12 06:33:01.000', '2009-10-12 19:06:35.000', NULL, NULL);
338
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (904, 'Break', 648, '2013-03-02 16:45:53.000', '2010-11-06 02:41:01.000', NULL, NULL);
339
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (907, 'After School', 762, '2011-03-27 16:53:25.000', '2015-01-29 21:12:58.000', NULL, NULL);
340
+ INSERT INTO Detention (`detention_id`, `detention_type_code`, `student_id`, `datetime_detention_start`, `datetime_detention_end`, `detention_summary`, `other_details`) VALUES (962, 'After School', 435, '2011-05-19 23:10:25.000', '2015-12-14 01:07:11.000', NULL, NULL);
341
+
342
+
343
+
344
+ /* ---------------------------------------------------------------------- */
345
+ /* Add table "Achievements" */
346
+ /* ---------------------------------------------------------------------- */
347
+ CREATE TABLE Achievements (
348
+ `achievement_id` INTEGER NOT NULL,
349
+ `achievement_type_code` CHAR(15) NOT NULL,
350
+ `student_id` INTEGER NOT NULL,
351
+ `date_achievement` DATETIME(3),
352
+ `achievement_details` VARCHAR(255),
353
+ `other_details` VARCHAR(255),
354
+ PRIMARY KEY (`achievement_id`),
355
+ FOREIGN KEY (student_id) REFERENCES Students (student_id),
356
+ FOREIGN KEY (achievement_type_code) REFERENCES Ref_Achievement_Type (achievement_type_code)
357
+ );
358
+ /* ---------------------------------------------------------------------- */
359
+ /* Foreign key constraints */
360
+ /* ---------------------------------------------------------------------- */
361
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (153, 'Athletic', 777, 2013, 'Gold', NULL);
362
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (159, 'Athletic', 415, 2013, 'Gold', NULL);
363
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (262, 'Scholastic', 415, 2014, 'Gold', NULL);
364
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (264, 'Scholastic', 471, 2014, 'Silver', NULL);
365
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (316, 'Scholastic', 648, 2014, 'Gold', NULL);
366
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (340, 'Scholastic', 276, 2014, 'Bronze', NULL);
367
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (450, 'Athletic', 669, 2014, 'Bronze', NULL);
368
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (602, 'Scholastic', 824, 2014, 'Silver', NULL);
369
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (650, 'Athletic', 777, 2014, 'Silver', NULL);
370
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (672, 'Athletic', 984, 2014, 'Gold', NULL);
371
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (697, 'Scholastic', 762, 2014, 'Gold', NULL);
372
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (702, 'Scholastic', 325, 2014, 'Gold', NULL);
373
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (717, 'Athletic', 567, 2015, 'Silver', NULL);
374
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (722, 'Athletic', 777, 2015, 'Silver', NULL);
375
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (753, 'Scholastic', 325, 2015, 'Silver', NULL);
376
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (770, 'Athletic', 287, 2015, 'Silver', NULL);
377
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (877, 'Athletic', 471, 2015, 'Gold', NULL);
378
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (885, 'Scholastic', 811, 2015, 'Gold', NULL);
379
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (933, 'Athletic', 648, 2015, 'Gold', NULL);
380
+ INSERT INTO Achievements (`achievement_id`, `achievement_type_code`, `student_id`, `date_achievement`, `achievement_details`, `other_details`) VALUES (964, 'Scholastic', 811, 2016, 'Gold', NULL);
381
+
test_database/customer_deliveries/schema.sql ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+ CREATE TABLE `Products` (
4
+ `product_id` INTEGER PRIMARY KEY,
5
+ `product_name` VARCHAR(20),
6
+ `product_price` DECIMAL(19,4),
7
+ `product_description` VARCHAR(255)
8
+ );
9
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (1, 'dvds', '1322.7800', 'good condition');
10
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (2, 'cloth', '6402.0900', 'good condition');
11
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (3, 'electronics', '2511.2900', 'great condition');
12
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (4, 'books', '7111.6800', 'good condition');
13
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (5, 'food', '3644.4500', 'good condition');
14
+ INSERT INTO Products (`product_id`, `product_name`, `product_price`, `product_description`) VALUES (6, 'gift', '5022.3900', 'bad condition');
15
+
16
+
17
+ CREATE TABLE `Addresses` (
18
+ `address_id` INTEGER PRIMARY KEY,
19
+ `address_details` VARCHAR(80),
20
+ `city` VARCHAR(50),
21
+ `zip_postcode` VARCHAR(20),
22
+ `state_province_county` VARCHAR(50),
23
+ `country` VARCHAR(50)
24
+ );
25
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (1, '92283 Lora Forges Suite 322', 'Mohrville', '271', 'Nebraska', 'USA');
26
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (2, '17135 Jaida Fork Suite 798', 'East Brody', '940', 'Colorado', 'USA');
27
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (3, '41099 Crist Prairie Suite 507', 'Evelinebury', '003', 'Idaho', 'USA');
28
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (4, '615 Adams Rue Apt. 095', 'Sawaynville', '575', 'Kentucky', 'USA');
29
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (5, '045 Marquardt Village Suite 484', 'Carterside', '827', 'California', 'USA');
30
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (6, '203 Joseph Hills', 'Giovannaton', '960', 'Tennessee', 'USA');
31
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (7, '6187 Feil Extension Apt. 749', 'East Frederic', '674', 'Maine', 'USA');
32
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (8, '185 Farrell Brooks Apt. 106', 'Mosciskimouth', '076', 'Illinois', 'USA');
33
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (9, '3720 Pagac Hollow Apt. 131', 'Alvertatown', '234', 'Wyoming', 'USA');
34
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (10, '57136 Eichmann Ranch Suite 091', 'Gerholdtown', '297', 'Illinois', 'USA');
35
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (11, '3020 Steuber Gardens Apt. 620', 'Flossiefurt', '460', 'Michigan', 'USA');
36
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (12, '2060 Hilpert Forge Apt. 379', 'Annietown', '491', 'Michigan', 'USA');
37
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (13, '469 Roberts Mews', 'Lake Abbey', '838', 'Washington', 'USA');
38
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (14, '8701 Myrtis Ranch', 'North Marquesfort', '940', 'Ohio', 'USA');
39
+ INSERT INTO Addresses (`address_id`, `address_details`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (15, '06959 Garett Meadows Apt. 259', 'New Lizziechester', '934', 'Massachusetts', 'USA');
40
+
41
+
42
+ CREATE TABLE `Customers` (
43
+ `customer_id` INTEGER PRIMARY KEY,
44
+ `payment_method` VARCHAR(10) NOT NULL,
45
+ `customer_name` VARCHAR(80),
46
+ `customer_phone` VARCHAR(80),
47
+ `customer_email` VARCHAR(80),
48
+ `date_became_customer` DATETIME
49
+ );
50
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (1, 'Visa', 'Ron Emard', '1-382-503-5179x53639', 'shaniya45@example.net', '2011-04-25 22:20:35');
51
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (2, 'MasterCard', 'Gabe Schroeder', '1-728-537-4293x0885', 'alexandra91@example.net', '2011-10-17 16:08:25');
52
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (3, 'Discover', 'Candace Schneider', '940.575.3682x7959', 'tkassulke@example.com', '2012-01-11 21:17:01');
53
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (4, 'Visa', 'Jaden Lang', '361.151.3489x7272', 'dedric17@example.org', '2009-12-29 17:38:10');
54
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (5, 'Visa', 'Geovanni Grady', '1-005-644-2495', 'elmira.langworth@example.org', '2017-05-21 07:09:55');
55
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (6, 'Visa', 'Dr. Karine Farrell', '+49(2)0677806107', 'reichel.winnifred@example.org', '2010-11-06 08:42:56');
56
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (7, 'Discover', 'Emmanuel Reilly', '129.959.6420', 'gleichner.ethelyn@example.net', '2013-11-29 06:15:22');
57
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (8, 'MasterCard', 'Keenan Kuhic', '686-517-9923x348', 'dallin76@example.org', '2013-04-09 18:17:05');
58
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (9, 'American', 'Rusty Morar', '1-123-197-9677x7194', 'njenkins@example.org', '2015-09-09 09:29:06');
59
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (10, 'Visa', 'Lila Howe', '1-492-284-1097', 'leann.hamill@example.org', '2014-02-04 04:51:58');
60
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (11, 'Visa', 'Amalia Hudson DDS', '003-991-1506x483', 'danika49@example.com', '2014-02-25 19:39:51');
61
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (12, 'Discover', 'Verda Streich', '06730471330', 'xgraham@example.org', '2008-10-12 12:19:27');
62
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (13, 'Discover', 'Patience Yundt', '969-208-8932x715', 'kira82@example.com', '2017-03-25 18:48:04');
63
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (14, 'Visa', 'Annabell Walsh', '(881)096-1281x6448', 'adriana83@example.org', '2017-06-30 19:02:11');
64
+ INSERT INTO Customers (`customer_id`, `payment_method`, `customer_name`, `customer_phone`, `customer_email`, `date_became_customer`) VALUES (15, 'Visa', 'Aracely Borer V', '531-617-3230', 'rollin95@example.net', '2015-09-13 22:39:50');
65
+
66
+
67
+ CREATE TABLE `Regular_Orders` (
68
+ `regular_order_id` INTEGER PRIMARY KEY,
69
+ `distributer_id` INTEGER NOT NULL,
70
+ FOREIGN KEY (`distributer_id` ) REFERENCES `Customers`(`customer_id` )
71
+ );
72
+
73
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (1, 12);
74
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (2, 15);
75
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (3, 6);
76
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (4, 3);
77
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (5, 8);
78
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (6, 14);
79
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (7, 2);
80
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (8, 15);
81
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (9, 10);
82
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (10, 7);
83
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (11, 3);
84
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (12, 1);
85
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (13, 1);
86
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (14, 15);
87
+ INSERT INTO Regular_Orders (`regular_order_id`, `distributer_id`) VALUES (15, 15);
88
+
89
+
90
+ CREATE TABLE `Regular_Order_Products` (
91
+ `regular_order_id` INTEGER NOT NULL,
92
+ `product_id` INTEGER NOT NULL,
93
+ FOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),
94
+ FOREIGN KEY (`regular_order_id` ) REFERENCES `Regular_Orders`(`regular_order_id` )
95
+ );
96
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (5, 3);
97
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (2, 3);
98
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (10, 1);
99
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (8, 5);
100
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (12, 2);
101
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (1, 4);
102
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (6, 3);
103
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (3, 6);
104
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (3, 1);
105
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (9, 6);
106
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (5, 5);
107
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (1, 1);
108
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (7, 4);
109
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (6, 4);
110
+ INSERT INTO Regular_Order_Products (`regular_order_id`, `product_id`) VALUES (13, 2);
111
+
112
+
113
+
114
+ CREATE TABLE `Actual_Orders` (
115
+ `actual_order_id` INTEGER PRIMARY KEY,
116
+ `order_status_code` VARCHAR(10) NOT NULL,
117
+ `regular_order_id` INTEGER NOT NULL,
118
+ `actual_order_date` DATETIME,
119
+ FOREIGN KEY (`regular_order_id` ) REFERENCES `Regular_Orders`(`regular_order_id` )
120
+ );
121
+
122
+
123
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (1, 'Success', 8, '2018-03-02 23:26:19');
124
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (2, 'Cancel', 15, '2018-03-02 08:33:39');
125
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (3, 'Cancel', 4, '2018-02-25 10:13:36');
126
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (4, 'Cancel', 10, '2018-03-21 01:34:52');
127
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (5, 'Cancel', 14, '2018-02-28 15:31:06');
128
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (6, 'Success', 12, '2018-03-12 05:33:57');
129
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (7, 'Success', 1, '2018-03-06 12:20:31');
130
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (8, 'Cancel', 11, '2018-03-22 19:30:17');
131
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (9, 'Success', 6, '2018-03-13 05:43:25');
132
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (10, 'Success', 13, '2018-03-05 17:31:36');
133
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (11, 'Cancel', 4, '2018-03-16 00:28:09');
134
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (12, 'Cancel', 12, '2018-02-26 01:55:52');
135
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (13, 'Cancel', 8, '2018-03-11 10:45:05');
136
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (14, 'Cancel', 4, '2018-03-12 11:24:59');
137
+ INSERT INTO Actual_Orders (`actual_order_id`, `order_status_code`, `regular_order_id`, `actual_order_date`) VALUES (15, 'Cancel', 7, '2018-03-10 18:22:34');
138
+
139
+
140
+ CREATE TABLE `Actual_Order_Products` (
141
+ `actual_order_id` INTEGER NOT NULL,
142
+ `product_id` INTEGER NOT NULL,
143
+ FOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),
144
+ FOREIGN KEY (`actual_order_id` ) REFERENCES `Actual_Orders`(`actual_order_id` )
145
+ );
146
+
147
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (2, 1);
148
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (14, 5);
149
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (13, 6);
150
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (9, 2);
151
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (3, 2);
152
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (2, 3);
153
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (13, 2);
154
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (3, 1);
155
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (3, 1);
156
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (10, 3);
157
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (6, 6);
158
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (5, 5);
159
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (7, 3);
160
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (5, 3);
161
+ INSERT INTO Actual_Order_Products (`actual_order_id`, `product_id`) VALUES (15, 4);
162
+
163
+
164
+
165
+
166
+
167
+ CREATE TABLE `Customer_Addresses` (
168
+ `customer_id` INTEGER NOT NULL,
169
+ `address_id` INTEGER NOT NULL,
170
+ `date_from` DATETIME NOT NULL,
171
+ `address_type` VARCHAR(10) NOT NULL,
172
+ `date_to` DATETIME,
173
+ FOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` ),
174
+ FOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )
175
+ );
176
+
177
+
178
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (5, 6, '2016-09-06 19:23:46', 'House', '2018-02-25 15:34:58');
179
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (14, 5, '2016-12-21 03:49:54', 'House', '2018-03-13 21:20:21');
180
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (2, 2, '2014-06-09 06:31:49', 'Flat', '2018-03-02 21:56:40');
181
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (10, 6, '2011-05-24 21:49:34', 'House', '2018-03-18 12:45:44');
182
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (14, 2, '2011-12-06 16:49:10', 'Flat', '2018-02-24 20:18:08');
183
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (10, 1, '2012-05-24 11:47:54', 'House', '2018-03-14 20:26:33');
184
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (7, 3, '2016-08-17 17:45:20', 'Flat', '2018-03-16 14:09:24');
185
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (4, 9, '2009-08-03 03:17:03', 'House', '2018-03-15 23:45:59');
186
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (3, 7, '2010-12-29 11:01:39', 'House', '2018-03-22 02:54:10');
187
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (12, 6, '2012-08-31 15:41:03', 'Flat', '2018-03-02 23:42:49');
188
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (12, 11, '2008-04-02 08:23:13', 'Apartment', '2018-03-17 12:51:37');
189
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (14, 10, '2011-08-18 09:40:49', 'House', '2018-03-06 15:48:13');
190
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (1, 11, '2014-12-20 18:58:32', 'House', '2018-02-27 00:53:48');
191
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (8, 6, '2013-05-06 00:49:45', 'Flat', '2018-03-05 01:34:02');
192
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `address_type`, `date_to`) VALUES (12, 5, '2017-11-01 10:59:35', 'Flat', '2018-03-09 05:05:17');
193
+
194
+
195
+ CREATE TABLE `Delivery_Routes` (
196
+ `route_id` INTEGER PRIMARY KEY,
197
+ `route_name` VARCHAR(50),
198
+ `other_route_details` VARCHAR(255)
199
+ );
200
+
201
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (1, 'Torphy Ltd', '16893 Wilderman Terrace
202
+ Port Lucasburgh, ND 55978-5550');
203
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (2, 'Heidenreich Group', '6534 Cheyenne Trace Suite 242
204
+ Koryburgh, PA 21391-9164');
205
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (3, 'Gerhold Inc', '70469 Unique Crest
206
+ Katherynville, IA 92263-4974');
207
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (4, 'Huel, Armstrong and Senger', '534 Lubowitz Terrace
208
+ Lake Tomfort, LA 52697-4998');
209
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (5, 'Nader, Leuschke and Huels', '4627 Johnnie Centers
210
+ Lake Hipolitoton, RI 37305');
211
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (6, 'Abshire Ltd', '36578 Kirsten Terrace
212
+ Krajcikside, NH 29063');
213
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (7, 'Adams, Macejkovic and Carroll', '941 Ritchie Plains Suite 833
214
+ North Jerry, LA 32804-7405');
215
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (8, 'Schowalter Group', '52417 Wiza Brook Apt. 000
216
+ Zechariahstad, WY 15885-3711');
217
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (9, 'Gorczany Group', '9608 Hoyt Extension
218
+ East Linnieview, GA 87356-5339');
219
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (10, 'Grady, King and Price', '4989 Pfeffer Passage Suite 915
220
+ West Jacebury, SD 68079-3347');
221
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (11, 'Streich, Spencer and Brakus', '30335 Pacocha Burgs Apt. 400
222
+ North Onastad, OR 76419');
223
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (12, 'Brekke, Powlowski and Fritsch', '53685 Abshire Falls
224
+ Lake Destineyville, OK 91313');
225
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (13, 'Hermiston, Feeney and Daugherty', '54645 Ziemann Skyway Suite 987
226
+ Lake Roderickstad, OH 77820');
227
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (14, 'Renner-Kovacek', '809 Daija Radial Apt. 507
228
+ Kavonfort, MN 70034-2797');
229
+ INSERT INTO Delivery_Routes (`route_id`, `route_name`, `other_route_details`) VALUES (15, 'Hegmann-Waters', '719 Vito Parks
230
+ Kassulkeville, NH 77748');
231
+
232
+
233
+ CREATE TABLE `Delivery_Route_Locations` (
234
+ `location_code` VARCHAR(10) PRIMARY KEY,
235
+ `route_id` INTEGER NOT NULL,
236
+ `location_address_id` INTEGER NOT NULL,
237
+ `location_name` VARCHAR(50),
238
+ FOREIGN KEY (`location_address_id` ) REFERENCES `Addresses`(`address_id` ),
239
+ FOREIGN KEY (`route_id` ) REFERENCES `Delivery_Routes`(`route_id` )
240
+ );
241
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('27 City Rd', 11, 5, 'Labadie-Crooks');
242
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('30 Sam Rd', 7, 13, 'VonRueden, Schmeler and Fay');
243
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('67 LV Rd', 11, 6, 'Carter, Pfannerstill and Rutherford');
244
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('38 Enisner Av', 10, 7, 'Bradtke-Herman');
245
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('73 Nancy Av', 14, 10, 'Streich Group');
246
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('84 OE Av', 14, 7, 'Hessel and Sons');
247
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('34 Benz St', 2, 15, 'Strosin, Hegmann and Abbott');
248
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('15 Sixth Av', 8, 6, 'Pouros, Brakus and Konopelski');
249
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('04 Elm Rd', 8, 8, 'Hermiston, Hand and Wisoky');
250
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('79 Square St', 15, 5, 'Turner, Dietrich and Smitham');
251
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('84 Temple Rd', 7, 2, 'Leannon, Erdman and Schneider');
252
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('64 Kate Rd', 7, 12, 'Dach Group');
253
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('68 Denny St', 4, 7, 'Ledner-Kozey');
254
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('76 David St', 11, 3, 'Rosenbaum, Kiehn and Kilback');
255
+ INSERT INTO Delivery_Route_Locations (`location_code`, `route_id`, `location_address_id`, `location_name`) VALUES ('58 Roof Av', 13, 4, 'Bartoletti, Keebler and Crona');
256
+
257
+
258
+ CREATE TABLE `Trucks` (
259
+ `truck_id` INTEGER PRIMARY KEY,
260
+ `truck_licence_number` VARCHAR(20),
261
+ `truck_details` VARCHAR(255)
262
+ );
263
+
264
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (1, '58110', 'Frida');
265
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (2, '33822', 'Randy');
266
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (3, '17106', 'Laverna');
267
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (4, '24474', 'Kaya');
268
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (5, '63359', 'Queen');
269
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (6, '25232', 'Deon');
270
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (7, '92426', 'Stacy');
271
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (8, '69863', 'Rebeka');
272
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (9, '78683', 'Bud');
273
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (10, '47865', 'Holly');
274
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (11, '49160', 'Rosamond');
275
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (12, '32054', 'Ricky');
276
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (13, '87695', 'Joanny');
277
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (14, '75871', 'Luisa');
278
+ INSERT INTO Trucks (`truck_id`, `truck_licence_number`, `truck_details`) VALUES (15, '89343', 'Efren');
279
+
280
+
281
+ CREATE TABLE `Employees` (
282
+ `employee_id` INTEGER PRIMARY KEY,
283
+ `employee_address_id` INTEGER NOT NULL,
284
+ `employee_name` VARCHAR(80),
285
+ `employee_phone` VARCHAR(80),
286
+ FOREIGN KEY (`employee_address_id` ) REFERENCES `Addresses`(`address_id` )
287
+ );
288
+
289
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (1, 4, 'Kacie', '716-650-2081');
290
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (2, 12, 'Dejuan', '211.289.9042');
291
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (3, 1, 'Leonie', '816-890-2580');
292
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (4, 11, 'Rogelio', '(539)655-7194x3276');
293
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (5, 12, 'Eriberto', '675.047.7555x13273');
294
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (6, 9, 'Matteo', '620.905.4152x7146');
295
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (7, 4, 'Sasha', '1-547-775-6049');
296
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (8, 11, 'Eino', '033.973.3729x07313');
297
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (9, 8, 'Cydney', '191.702.4400x1018');
298
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (10, 6, 'Cristian', '1-833-492-9430');
299
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (11, 5, 'Lew', '776.002.6775');
300
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (12, 15, 'Anthony', '+69(6)9999892744');
301
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (13, 14, 'Jovani', '+28(9)6180779782');
302
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (14, 10, 'Dovie', '944-507-0999');
303
+ INSERT INTO Employees (`employee_id`, `employee_address_id`, `employee_name`, `employee_phone`) VALUES (15, 12, 'Allison', '+48(5)2807285053');
304
+
305
+
306
+ CREATE TABLE `Order_Deliveries` (
307
+ `location_code` VARCHAR(10) NOT NULL,
308
+ `actual_order_id` INTEGER NOT NULL,
309
+ `delivery_status_code` VARCHAR(10) NOT NULL,
310
+ `driver_employee_id` INTEGER NOT NULL,
311
+ `truck_id` INTEGER NOT NULL,
312
+ `delivery_date` DATETIME,
313
+ FOREIGN KEY (`truck_id` ) REFERENCES `Trucks`(`truck_id` ),
314
+ FOREIGN KEY (`actual_order_id` ) REFERENCES `Actual_Orders`(`actual_order_id` ),
315
+ FOREIGN KEY (`location_code` ) REFERENCES `Delivery_Route_Locations`(`location_code` ),
316
+ FOREIGN KEY (`driver_employee_id` ) REFERENCES `Employees`(`employee_id` )
317
+ );
318
+
319
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('27 City Rd', 11, 'Ready', 6, 11, '2018-03-21 00:57:22');
320
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('27 City Rd', 1, 'On Road', 4, 10, '2018-02-26 01:32:49');
321
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('27 City Rd', 3, 'Ready', 1, 2, '2018-03-08 17:17:12');
322
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('73 Nancy Av', 2, 'Delivered', 12, 10, '2018-03-17 19:42:08');
323
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('73 Nancy Av', 2, 'On Road', 1, 6, '2018-03-05 03:03:24');
324
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('34 Benz St', 14, 'Delivered', 11, 6, '2018-03-12 20:45:27');
325
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('73 Nancy Av', 6, 'On Road', 11, 11, '2018-03-22 22:09:56');
326
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('34 Benz St', 6, 'Delivered', 2, 10, '2018-03-06 22:39:17');
327
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('34 Benz St', 5, 'Delivered', 14, 6, '2018-03-02 09:03:13');
328
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('73 Nancy Av', 8, 'Ready', 13, 4, '2018-03-17 09:09:06');
329
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('58 Roof Av', 9, 'Ready', 3, 9, '2018-02-26 13:22:53');
330
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('58 Roof Av', 5, 'Ready', 8, 1, '2018-03-20 20:36:44');
331
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('58 Roof Av', 9, 'Ready', 14, 5, '2018-03-14 05:16:17');
332
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('58 Roof Av', 10, 'Ready', 13, 11, '2018-03-18 02:35:08');
333
+ INSERT INTO Order_Deliveries (`location_code`, `actual_order_id`, `delivery_status_code`, `driver_employee_id`, `truck_id`, `delivery_date`) VALUES ('34 Benz St', 4, 'On Road', 1, 2, '2018-03-01 00:50:45');
test_database/customers_and_products_contacts/customers_and_products_contacts.sqlite ADDED
Binary file (32.8 kB). View file
 
test_database/customers_and_products_contacts/schema.sql ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+ CREATE TABLE `Addresses` (
3
+ `address_id` INTEGER PRIMARY KEY,
4
+ `line_1_number_building` VARCHAR(80),
5
+ `city` VARCHAR(50),
6
+ `zip_postcode` VARCHAR(20),
7
+ `state_province_county` VARCHAR(50),
8
+ `country` VARCHAR(50)
9
+ );
10
+
11
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (1, '4315 Kerluke Canyon Apt. 800', 'Hertafurt', '740', 'Nevada', 'USA');
12
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (2, '319 Kozey Highway Suite 973', 'Edgardoberg', '282', 'Colorado', 'USA');
13
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (3, '592 Frederique Ridge', 'Gilbertmouth', '167', 'Virginia', 'USA');
14
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (4, '01868 Laverna Green', 'Lake Floyd', '041', 'Oklahoma', 'USA');
15
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (5, '6017 Price Greens', 'Gibsonfurt', '873', 'District of Columbia', 'USA');
16
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (6, '037 Luella Path', 'North Jairo', '126', 'Maryland', 'USA');
17
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (7, '044 Greenfelder Fort', 'East Rickey', '564', 'Louisiana', 'USA');
18
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (8, '2676 Connelly Islands Apt. 199', 'West Kaiatown', '770', 'Oregon', 'USA');
19
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (9, '6830 Alexanne Forks Apt. 925', 'Agustinstad', '248', 'Illinois', 'USA');
20
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (10, '918 Lauren Drive', 'Gleasonland', '116', 'Kentucky', 'USA');
21
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (11, '70345 Marvin Glens Apt. 669', 'Lake Katheryn', '505', 'Kentucky', 'USA');
22
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (12, '65854 McKenzie Tunnel', 'North Lisandroport', '202', 'Maine', 'USA');
23
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (13, '494 Bruen Radial Apt. 723', 'Estaland', '381', 'Idaho', 'USA');
24
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (14, '794 Doyle Lake Apt. 531', 'West Muriel', '571', 'Vermont', 'USA');
25
+ INSERT INTO Addresses (`address_id`, `line_1_number_building`, `city`, `zip_postcode`, `state_province_county`, `country`) VALUES (15, '9590 Rogahn Point Apt. 466', 'Port Montytown', '037', 'SouthDakota', 'USA');
26
+
27
+
28
+
29
+ CREATE TABLE `Products` (
30
+ `product_id` INTEGER PRIMARY KEY,
31
+ `product_type_code` VARCHAR(15),
32
+ `product_name` VARCHAR(80),
33
+ `product_price` DOUBLE NULL
34
+ );
35
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (1, 'Hardware', 'Apple', '54753982.574522');
36
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (2, 'Clothes', 'jcrew', '30590929.528306');
37
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (3, 'Hardware', 'Apple', '10268.85297069');
38
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (4, 'Hardware', 'Apple', '22956668.699482');
39
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (5, 'Clothes', 'jcrew', '5927021.8748021');
40
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (6, 'Hardware', 'Apple', '77.109961147471');
41
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (7, 'Hardware', 'Apple', '450.39232520498');
42
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (8, 'Hardware', 'Sony', '4446237.9177554');
43
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (9, 'Clothes', 'jcrew', '622.79275984494');
44
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (10, 'Hardware', 'Sony', '7171.5933353284');
45
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (11, 'Clothes', 'jcrew', '149.95519076938');
46
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (12, 'Clothes', 'gucci', '593.80519929985');
47
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (13, 'Clothes', 'gucci', '11388.26282462');
48
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (14, 'Hardware', 'Sony', '389.91542644329');
49
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (15, 'Clothes', 'gucci', '310488248.48788');
50
+
51
+
52
+ CREATE TABLE `Customers` (
53
+ `customer_id` INTEGER PRIMARY KEY,
54
+ `payment_method_code` VARCHAR(15),
55
+ `customer_number` VARCHAR(20),
56
+ `customer_name` VARCHAR(80),
57
+ `customer_address` VARCHAR(255),
58
+ `customer_phone` VARCHAR(80),
59
+ `customer_email` VARCHAR(80)
60
+ );
61
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (1, 'Credit Card', '456', 'Kayley', '636 Chanelle Isle Apt. 846', '+87(9)5279161988', 'antonette73@example.com');
62
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (2, 'Credit Card', '553', 'Sterling', '12174 Boyer Crossroad', '896.685.8228x2786', 'stroman.chadd@example.net');
63
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (3, 'Credit Card', '951', 'Buford', '650 Spencer Way Apt. 584', '(192)144-4687', 'pattie.mayer@example.net');
64
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (4, 'Direct Debit', '497', 'Caterina', '075 Skiles Expressway', '387.053.1225', 'dbeahan@example.net');
65
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (5, 'Direct Debit', '752', 'Raymond', '8497 Huel Stravenue', '1-513-427-0125', 'bergnaum.ashton@example.com');
66
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (6, 'Direct Debit', '838', 'Cheyenne', '058 Ben Street Apt. 034', '009-136-4509x19635', 'rhayes@example.org');
67
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (7, 'Direct Debit', '429', 'Cecelia', '4065 Forest Vista Apt. 103', '672-559-0630x7875', 'caesar.lemke@example.net');
68
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (8, 'Credit Card', '564', 'Brenna', '440 Aiden Ports', '1-271-345-4681x1131', 'macy.huel@example.org');
69
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (9, 'Credit Card', '525', 'Lela', '13256 Valentina Valleys Suite 292', '838.718.8618x23239', 'vandervort.helena@example.org');
70
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (10, 'Credit Card', '795', 'Cleo', '91702 Hilpert Pines Suite 177', '1-202-928-5395', 'xrosenbaum@example.org');
71
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (11, 'Direct Debit', '233', 'Shany', '55270 Carter Street Apt. 214', '936.929.9929', 'kling.jesus@example.com');
72
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (12, 'Credit Card', '586', 'Madaline', '8428 Cecile Land Apt. 192', '097-514-4641', 'brady.ernser@example.net');
73
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (13, 'Direct Debit', '445', 'Melissa', '251 Botsford Harbors Suite 399', '529.148.1926', 'howard27@example.com');
74
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (14, 'Direct Debit', '735', 'Orion', '10823 Rollin Spur', '479-171-6355x66065', 'kip.abernathy@example.com');
75
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_number`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (15, 'Direct Debit', '523', 'Ottilie', '4098 Kreiger Knoll Suite 758', '393-750-2077x72779', 'morton06@example.net');
76
+
77
+ CREATE TABLE `Contacts` (
78
+ `contact_id` INTEGER PRIMARY KEY,
79
+ `customer_id` INTEGER NOT NULL,
80
+ `gender` VARCHAR(1),
81
+ `first_name` VARCHAR(80),
82
+ `last_name` VARCHAR(50),
83
+ `contact_phone` VARCHAR(80)
84
+ );
85
+
86
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (1, 4, 'male', 'Cierra', 'Collins', '+73(2)0854391820');
87
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (2, 6, 'male', 'Jennifer', 'Doyle', '482-949-1364x17500');
88
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (3, 8, 'female', 'Carli', 'Blick', '(608)868-5069x554');
89
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (4, 14, 'female', 'Gustave', 'Ebert', '00414184198');
90
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (5, 3, 'male', 'Danika', 'Bauch', '1-368-227-6322');
91
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (6, 9, 'female', 'Rachelle', 'Stamm', '048-342-0880x5170');
92
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (7, 10, 'male', 'Sid', 'Legros', '658.850.7946x9993');
93
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (8, 7, 'female', 'Adella', 'Streich', '1-613-226-7727');
94
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (9, 4, 'male', 'Etha', 'Raynor', '385-123-4556');
95
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (10, 15, 'female', 'Skye', 'Ratke', '+62(3)0497423927');
96
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (11, 10, 'female', 'Leif', 'Buckridge', '+96(5)1807022818');
97
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (12, 6, 'female', 'Shyann', 'Hills', '(842)564-7057x121');
98
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (13, 3, 'male', 'Darion', 'Leannon', '1-279-181-8737');
99
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (14, 8, 'female', 'Amani', 'Kunze', '405-058-1659');
100
+ INSERT INTO Contacts (`contact_id`, `customer_id`, `gender`, `first_name`, `last_name`, `contact_phone`) VALUES (15, 14, 'female', 'Hellen', 'Little', '136.724.5322');
101
+
102
+
103
+ CREATE TABLE `Customer_Address_History` (
104
+ `customer_id` INTEGER NOT NULL,
105
+ `address_id` INTEGER NOT NULL,
106
+ `date_from` DATETIME NOT NULL,
107
+ `date_to` DATETIME,
108
+ FOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` ),
109
+ FOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )
110
+ );
111
+ CREATE TABLE `Customer_Orders` (
112
+ `order_id` INTEGER PRIMARY KEY,
113
+ `customer_id` INTEGER NOT NULL,
114
+ `order_date` DATETIME NOT NULL,
115
+ `order_status_code` VARCHAR(15),
116
+ FOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )
117
+ );
118
+
119
+ CREATE TABLE `Order_Items` (
120
+ `order_item_id` INTEGER NOT NULL ,
121
+ `order_id` INTEGER NOT NULL,
122
+ `product_id` INTEGER NOT NULL,
123
+ `order_quantity` VARCHAR(80),
124
+ FOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),
125
+ FOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` )
126
+ );
127
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (12, 7, '2015-07-23 14:37:18', '2018-03-07 12:04:20');
128
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (12, 2, '2016-11-06 14:33:12', '2018-03-14 21:36:28');
129
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (3, 9, '2011-11-19 12:17:36', '2018-03-22 10:20:16');
130
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (13, 15, '2009-02-16 23:04:20', '2018-03-07 17:47:47');
131
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (3, 12, '2008-06-22 21:50:44', '2018-03-13 00:08:29');
132
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (11, 10, '2012-04-09 18:10:36', '2018-03-11 20:16:56');
133
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (11, 10, '2014-11-17 15:11:26', '2018-03-08 23:31:30');
134
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (2, 13, '2011-01-02 21:42:29', '2018-02-25 19:55:00');
135
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (13, 11, '2015-05-01 12:44:46', '2018-03-24 06:20:36');
136
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (12, 3, '2011-06-02 02:53:28', '2018-03-10 00:47:18');
137
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (6, 1, '2013-06-14 23:07:04', '2018-03-16 14:49:28');
138
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (14, 12, '2008-10-13 04:37:27', '2018-03-19 10:10:53');
139
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (13, 5, '2012-03-16 17:42:30', '2018-02-27 07:31:19');
140
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 13, '2012-11-19 09:20:49', '2018-03-11 20:11:21');
141
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 3, '2012-11-09 07:15:16', '2018-03-09 12:03:31');
142
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (2, 4, '2011-11-02 17:31:41', '2018-03-07 05:29:10');
143
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (9, 13, '2010-03-25 08:23:20', '2018-03-09 16:41:55');
144
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (6, 12, '2017-10-25 07:35:59', '2018-03-11 21:40:52');
145
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 3, '2009-05-22 04:42:28', '2018-03-18 11:13:27');
146
+ INSERT INTO Customer_Address_History (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (12, 9, '2016-12-23 04:42:07', '2018-03-20 01:13:38');
147
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (1, 2, '2009-07-19 13:40:49', 'Completed');
148
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (2, 2, '1976-05-28 15:02:44', 'Part');
149
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (3, 6, '1979-03-29 02:47:13', 'Completed');
150
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (4, 4, '2003-01-17 00:06:12', 'Part');
151
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (5, 13, '1992-04-19 21:42:58', 'Completed');
152
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (6, 4, '1972-03-17 21:42:29', 'Part');
153
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (7, 10, '2002-01-20 01:52:53', 'Part');
154
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (8, 2, '1985-01-03 05:22:09', 'Part');
155
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (9, 9, '2016-09-17 03:00:47', 'Completed');
156
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (10, 5, '1971-12-04 19:14:18', 'Completed');
157
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (11, 10, '1993-05-08 14:12:06', 'Completed');
158
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (12, 10, '1998-06-14 21:22:53', 'Completed');
159
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (13, 9, '1997-08-02 09:44:57', 'Part');
160
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (14, 3, '1979-07-13 17:19:40', 'Part');
161
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_date`, `order_status_code`) VALUES (15, 1, '2007-01-19 07:54:50', 'Completed');
162
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (1, 9, 15, '3');
163
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (2, 8, 12, '7');
164
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (3, 11, 9, '9');
165
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (4, 15, 2, 'male');
166
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (5, 13, 3, '3');
167
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (6, 3, 6, '4');
168
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (7, 7, 4, '8');
169
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (8, 6, 2, '7');
170
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (9, 3, 15, '2');
171
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (10, 4, 12, '5');
172
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (11, 14, 11, '8');
173
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (12, 6, 2, '7');
174
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (13, 7, 5, '9');
175
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (14, 5, 13, '4');
176
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`, `order_quantity`) VALUES (15, 7, 3, '8');
test_database/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite ADDED
Binary file (36.9 kB). View file
 
test_database/decoration_competition/decoration_competition.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/department_store/department_store.sqlite ADDED
Binary file (86 kB). View file
 
test_database/department_store/schema.sql ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+ CREATE TABLE `Addresses` (
3
+ `address_id` INTEGER PRIMARY KEY,
4
+ `address_details` VARCHAR(255)
5
+ );
6
+
7
+
8
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (1, '28481 Crist Circle
9
+ East Burdettestad, IA 21232');
10
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (2, '0292 Mitchel Pike
11
+ Port Abefurt, IA 84402-4249');
12
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (3, '4062 Mante Place
13
+ West Lindsey, DE 76199-8015');
14
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (4, '99666 Julie Junction
15
+ Marvinburgh, OH 16085-1623');
16
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (5, '195 Mara Rue
17
+ Jenkinsmouth, OK 22345');
18
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (6, '11784 Stehr Road
19
+ Port Isaac, NV 61159');
20
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (7, '69482 Renner Ville Suite 653
21
+ Langworthborough, OH 95195');
22
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (8, '36594 O''Keefe Lock
23
+ New Cali, RI 42319');
24
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (9, '7181 Wuckert Port Apt. 571
25
+ Lake Zariaburgh, IL 98085');
26
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (10, '92594 Marvin Trafficway
27
+ Pourosfurt, IA 98649');
28
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (11, '0258 Kessler Mountains Suite 688
29
+ Mooreside, ME 41586-5022');
30
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (12, '69275 Mose Drive
31
+ Wilkinsonstad, CO 79055-7622');
32
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (13, '8207 Morissette Lakes
33
+ East Rheaview, ID 47493');
34
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (14, '145 Alice Corners
35
+ Willmsport, NV 36680');
36
+ INSERT INTO Addresses (`address_id`, `address_details`) VALUES (15, '521 Molly Harbors Apt. 567
37
+ Reingerland, HI 97099-1005');
38
+
39
+ CREATE TABLE `Staff` (
40
+ `staff_id` INTEGER PRIMARY KEY,
41
+ `staff_gender` VARCHAR(1),
42
+ `staff_name` VARCHAR(80)
43
+ );
44
+
45
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (1, '1', 'Tom');
46
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (2, '1', 'Malika');
47
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (3, '1', 'Katelynn');
48
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (4, '1', 'Vanessa');
49
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (5, '0', 'Maximus');
50
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (6, '1', 'Tyson');
51
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (7, '1', 'Yolanda');
52
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (8, '1', 'Vito');
53
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (9, '1', 'Zakary');
54
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (10, '1', 'Sabrina');
55
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (11, '1', 'Dannie');
56
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (12, '1', 'Melody');
57
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (13, '1', 'Archibald');
58
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (14, '1', 'Adrienne');
59
+ INSERT INTO Staff (`staff_id`, `staff_gender`, `staff_name`) VALUES (15, '1', 'Kristy');
60
+
61
+ CREATE TABLE `Suppliers` (
62
+ `supplier_id` INTEGER PRIMARY KEY,
63
+ `supplier_name` VARCHAR(80),
64
+ `supplier_phone` VARCHAR(80)
65
+ );
66
+
67
+ INSERT INTO Suppliers (`supplier_id`, `supplier_name`, `supplier_phone`) VALUES (1, 'Lidl', '(692)009-5928');
68
+ INSERT INTO Suppliers (`supplier_id`, `supplier_name`, `supplier_phone`) VALUES (2, 'AB Store', '1-483-283-4742');
69
+ INSERT INTO Suppliers (`supplier_id`, `supplier_name`, `supplier_phone`) VALUES (3, 'Tesco', '287-071-1153x254');
70
+ INSERT INTO Suppliers (`supplier_id`, `supplier_name`, `supplier_phone`) VALUES (4, 'Audi', '1-432-960-2402x1734');
71
+
72
+ CREATE TABLE `Department_Store_Chain` (
73
+ `dept_store_chain_id` INTEGER PRIMARY KEY,
74
+ `dept_store_chain_name` VARCHAR(80)
75
+ );
76
+
77
+ INSERT INTO Department_Store_Chain (`dept_store_chain_id`, `dept_store_chain_name`) VALUES (1, 'South');
78
+ INSERT INTO Department_Store_Chain (`dept_store_chain_id`, `dept_store_chain_name`) VALUES (2, 'West');
79
+ INSERT INTO Department_Store_Chain (`dept_store_chain_id`, `dept_store_chain_name`) VALUES (3, 'East');
80
+ INSERT INTO Department_Store_Chain (`dept_store_chain_id`, `dept_store_chain_name`) VALUES (4, 'North');
81
+
82
+
83
+ CREATE TABLE `Customers` (
84
+ `customer_id` INTEGER PRIMARY KEY,
85
+ `payment_method_code` VARCHAR(10) NOT NULL,
86
+ `customer_code` VARCHAR(20),
87
+ `customer_name` VARCHAR(80),
88
+ `customer_address` VARCHAR(255),
89
+ `customer_phone` VARCHAR(80),
90
+ `customer_email` VARCHAR(80)
91
+ );
92
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (1, 'Credit Card', '401', 'Ahmed', '75099 Tremblay Port Apt. 163
93
+ South Norrisland, SC 80546', '254-072-4068x33935', 'margarett.vonrueden@example.com');
94
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (2, 'Credit Card', '665', 'Chauncey', '8408 Lindsay Court
95
+ East Dasiabury, IL 72656-3552', '+41(8)1897032009', 'stiedemann.sigrid@example.com');
96
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (3, 'Direct Debit', '844', 'Lukas', '7162 Rodolfo Knoll Apt. 502
97
+ Lake Annalise, TN 35791-8871', '197-417-3557', 'joelle.monahan@example.com');
98
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (4, 'Direct Debit', '662', 'Lexus', '9581 Will Flat Suite 272
99
+ East Cathryn, WY 30751-4404', '+08(3)8056580281', 'gbrekke@example.com');
100
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (5, 'Credit Card', '848', 'Tara', '5065 Mraz Fields Apt. 041
101
+ East Chris, NH 41624', '1-064-498-6609x051', 'nicholas44@example.com');
102
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (6, 'Credit Card', '916', 'Jon', '841 Goyette Unions
103
+ South Dionbury, NC 62021', '(443)013-3112x528', 'cconroy@example.net');
104
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (7, 'Credit Card', '172', 'Cristobal', '8327 Christiansen Lakes Suite 409
105
+ Schneiderland, IA 93624', '877-150-8674x63517', 'shawna.cummerata@example.net');
106
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (8, 'Direct Debit', '927', 'Adah', '5049 Hand Land
107
+ Coymouth, IL 97300-7731', '1-695-364-7586x59256', 'kathlyn24@example.org');
108
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (9, 'Credit Card', '808', 'Yasmeen', '3558 Witting Meadow Apt. 483
109
+ Lake Moriahbury, OH 91556-2122', '587.398.2400x31176', 'ludwig54@example.net');
110
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (10, 'Credit Card', '887', 'Karson', '7308 Joan Lake Suite 346
111
+ Lizethtown, DE 56522', '857-844-9339x40140', 'moriah91@example.com');
112
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (11, 'Direct Debit', '611', 'Cordell', '362 Fisher Forge Apt. 900
113
+ New Mckenna, CA 98525-5674', '(730)934-8249', 'qstokes@example.org');
114
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (12, 'Credit Card', '182', 'Darron', '84445 Elinor Glens
115
+ Port Zita, SD 39410', '117.822.3577', 'gwisozk@example.net');
116
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (13, 'Credit Card', '589', 'Kenya', '338 Floy Mountains Suite 589
117
+ Yesseniaville, TN 60847', '08023680831', 'maxime86@example.net');
118
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (14, 'Direct Debit', '240', 'Abbie', '983 Elinore Passage
119
+ Darrionborough, SC 53915-0479', '07594320656', 'celine.bogan@example.com');
120
+ INSERT INTO Customers (`customer_id`, `payment_method_code`, `customer_code`, `customer_name`, `customer_address`, `customer_phone`, `customer_email`) VALUES (15, 'Credit Card', '980', 'Lyric', '649 Ocie Lights
121
+ Wyatttown, UT 12697', '1-472-036-0434', 'schultz.arnoldo@example.net');
122
+
123
+
124
+ CREATE TABLE `Products` (
125
+ `product_id` INTEGER PRIMARY KEY,
126
+ `product_type_code` VARCHAR(10) NOT NULL,
127
+ `product_name` VARCHAR(80),
128
+ `product_price` DECIMAL(19,4)
129
+ );
130
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (1, 'Clothes', 'red jeans', '734.7300');
131
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (2, 'Clothes', 'yellow jeans', '687.2300');
132
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (3, 'Clothes', 'black jeans', '695.1600');
133
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (4, 'Clothes', 'blue jeans', '939.5700');
134
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (5, 'Clothes', 'red jeans', '534.5200');
135
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (6, 'Clothes', 'red topping', '408.8200');
136
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (7, 'Clothes', 'black topping', '916.5300');
137
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (8, 'Clothes', 'yellow topping', '918.4100');
138
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (9, 'Clothes', 'blue topping', '604.8600');
139
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (10, 'Hardware', 'monitor', '813.7600');
140
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (11, 'Hardware', 'mouse', '803.7400');
141
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (12, 'Hardware', 'drive', '944.9600');
142
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (13, 'Hardware', 'keyboard', '629.8900');
143
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (14, 'Hardware', 'speaker', '612.4600');
144
+ INSERT INTO Products (`product_id`, `product_type_code`, `product_name`, `product_price`) VALUES (15, 'Hardware', 'mic', '971.4400');
145
+
146
+ CREATE TABLE `Supplier_Addresses` (
147
+ `supplier_id` INTEGER NOT NULL,
148
+ `address_id` INTEGER NOT NULL,
149
+ `date_from` DATETIME NOT NULL,
150
+ `date_to` DATETIME,
151
+ PRIMARY KEY (`supplier_id`, `address_id`),
152
+ FOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),
153
+ FOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` )
154
+ );
155
+
156
+ INSERT INTO Supplier_Addresses (`supplier_id`, `address_id`, `date_from`, `date_to`) VALUES (4, 5, '2016-09-22 16:41:31', '2018-03-14 20:06:37');
157
+ INSERT INTO Supplier_Addresses (`supplier_id`, `address_id`, `date_from`, `date_to`) VALUES (3, 9, '2014-11-07 19:18:49', '2018-03-16 16:39:58');
158
+ INSERT INTO Supplier_Addresses (`supplier_id`, `address_id`, `date_from`, `date_to`) VALUES (3, 2, '2008-11-22 12:01:25', '2018-03-02 19:50:22');
159
+ INSERT INTO Supplier_Addresses (`supplier_id`, `address_id`, `date_from`, `date_to`) VALUES (2, 11, '2015-03-16 19:30:29', '2018-03-24 00:14:45');
160
+
161
+
162
+ CREATE TABLE `Customer_Addresses` (
163
+ `customer_id` INTEGER NOT NULL,
164
+ `address_id` INTEGER NOT NULL,
165
+ `date_from` DATETIME NOT NULL,
166
+ `date_to` DATETIME,
167
+ PRIMARY KEY (`customer_id`, `address_id`),
168
+ FOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),
169
+ FOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )
170
+ );
171
+
172
+
173
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (2, 9, '2017-12-11 05:00:22', '2018-03-20 20:52:34');
174
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (1, 6, '2017-10-07 23:00:26', '2018-02-28 14:53:52');
175
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (10, 8, '2017-04-04 20:00:27', '2018-02-27 20:08:33');
176
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (1, 9, '2017-12-14 07:40:08', '2018-03-24 14:31:59');
177
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (1, 2, '2017-07-31 20:18:52', '2018-03-12 05:32:28');
178
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (8, 2, '2018-01-27 06:27:34', '2018-03-23 17:49:51');
179
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (1, 14, '2017-08-06 20:57:36', '2018-03-05 21:19:53');
180
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (6, 13, '2017-09-07 04:41:01', '2018-02-27 23:10:07');
181
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 7, '2017-10-02 19:56:27', '2018-03-22 17:22:34');
182
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (8, 4, '2018-01-15 12:05:39', '2018-03-13 21:49:51');
183
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 4, '2018-02-22 04:46:48', '2018-02-26 00:52:25');
184
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (2, 4, '2017-11-28 23:36:20', '2018-03-02 17:46:11');
185
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (12, 14, '2017-11-01 04:21:41', '2018-03-05 16:18:34');
186
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (7, 10, '2018-01-07 13:31:08', '2018-03-09 07:06:56');
187
+ INSERT INTO Customer_Addresses (`customer_id`, `address_id`, `date_from`, `date_to`) VALUES (4, 12, '2017-08-27 13:38:37', '2018-03-17 15:44:10');
188
+
189
+
190
+
191
+ CREATE TABLE `Customer_Orders` (
192
+ `order_id` INTEGER PRIMARY KEY,
193
+ `customer_id` INTEGER NOT NULL,
194
+ `order_status_code` VARCHAR(10) NOT NULL,
195
+ `order_date` DATETIME NOT NULL,
196
+ FOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )
197
+ );
198
+
199
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (1, 12, 'Completed', '2018-02-10 15:44:48');
200
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (2, 4, 'New', '2018-01-31 17:49:18');
201
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (3, 1, 'PartFilled', '2018-02-26 12:39:33');
202
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (4, 4, 'Pending', '2018-03-07 16:55:17');
203
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (5, 4, 'New', '2018-02-12 19:34:12');
204
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (6, 11, 'PartFilled', '2018-03-06 16:35:51');
205
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (7, 1, 'Cancelled', '2018-02-15 02:25:32');
206
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (8, 13, 'Pending', '2018-03-05 23:17:54');
207
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (9, 7, 'Pending', '2018-02-09 11:16:46');
208
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (10, 11, 'Cancelled', '2018-03-22 10:49:25');
209
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (11, 8, 'Cancelled', '2018-02-16 19:42:39');
210
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (12, 4, 'New', '2018-02-02 23:42:01');
211
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (13, 15, 'PartFilled', '2018-02-26 05:34:18');
212
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (14, 6, 'Completed', '2018-03-18 15:12:39');
213
+ INSERT INTO Customer_Orders (`order_id`, `customer_id`, `order_status_code`, `order_date`) VALUES (15, 10, 'Pending', '2018-03-16 22:42:46');
214
+
215
+
216
+ CREATE TABLE `Department_Stores` (
217
+ `dept_store_id` INTEGER PRIMARY KEY,
218
+ `dept_store_chain_id` INTEGER,
219
+ `store_name` VARCHAR(80),
220
+ `store_address` VARCHAR(255),
221
+ `store_phone` VARCHAR(80),
222
+ `store_email` VARCHAR(80),
223
+ FOREIGN KEY (`dept_store_chain_id` ) REFERENCES `Department_Store_Chain`(`dept_store_chain_id` )
224
+ );
225
+
226
+
227
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (1, 1, 'store_name', '01290 Jeremie Parkway Suite 753
228
+ North Arielle, MS 51249', '(948)944-5099x2027', 'bmaggio@example.com');
229
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (2, 3, 'store_name', '082 Purdy Expressway
230
+ O''Connellshire, IL 31732', '877-917-5029', 'larissa10@example.org');
231
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (3, 4, 'store_name', '994 Travis Plains
232
+ North Wadeton, WV 27575-3951', '1-216-312-0375', 'alexandro.mcclure@example.net');
233
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (4, 2, 'store_name', '93472 Mayert Shore Apt. 360
234
+ Mitchellton, TN 84209', '670-466-6367', 'bryon24@example.org');
235
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (5, 3, 'store_name', '88112 Parisian Lights
236
+ Sporermouth, MN 25962', '01399327266', 'creola23@example.org');
237
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (6, 4, 'store_name', '49708 Marcella Valleys Suite 181
238
+ Ninamouth, WA 86667', '1-859-843-1957', 'jerod.reynolds@example.net');
239
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (7, 4, 'store_name', '41924 Alfredo Cliff
240
+ New Eviestad, NY 17573', '1-109-872-9142x77078', 'ihamill@example.org');
241
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (8, 4, 'store_name', '7081 Shanna Cape
242
+ West Zacheryshire, NC 17408', '+67(5)4983519062', 'casper.adolfo@example.org');
243
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (9, 4, 'store_name', '5288 Kaia Street
244
+ Devonton, NJ 61782-9006', '(723)503-7086x356', 'selmer.stiedemann@example.org');
245
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (10, 3, 'store_name', '00578 Lisa Gateway Suite 476
246
+ Strosinville, VA 03998-3292', '07126036440', 'luisa57@example.org');
247
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (11, 2, 'store_name', '34894 Everett Road
248
+ South Jeremiehaven, GA 08730', '611-037-9309', 'vonrueden.vern@example.org');
249
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (12, 4, 'store_name', '2676 Cruickshank Gardens
250
+ North Ginahaven, CT 85046', '(626)763-7031', 'freda.toy@example.org');
251
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (13, 2, 'store_name', '29297 West Road Suite 210
252
+ West Dulceside, UT 58085-8998', '1-764-126-7567x0795', 'katlynn62@example.com');
253
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (14, 1, 'store_name', '16650 Lysanne River Apt. 281
254
+ North Garettton, AL 84756-4375', '319.331.3397', 'mohr.elwin@example.net');
255
+ INSERT INTO Department_Stores (`dept_store_id`, `dept_store_chain_id`, `store_name`, `store_address`, `store_phone`, `store_email`) VALUES (15, 3, 'store_name', '82470 Hansen Squares Suite 190
256
+ Wehnermouth, NC 76791', '(587)993-3604x3077', 'kelly30@example.com');
257
+
258
+
259
+ CREATE TABLE `Departments` (
260
+ `department_id` INTEGER PRIMARY KEY,
261
+ `dept_store_id` INTEGER NOT NULL,
262
+ `department_name` VARCHAR(80),
263
+ FOREIGN KEY (`dept_store_id` ) REFERENCES `Department_Stores`(`dept_store_id` )
264
+ );
265
+ INSERT INTO Departments (`department_id`, `dept_store_id`, `department_name`) VALUES (1, 5, 'human resource');
266
+ INSERT INTO Departments (`department_id`, `dept_store_id`, `department_name`) VALUES (2, 11, 'purchasing');
267
+ INSERT INTO Departments (`department_id`, `dept_store_id`, `department_name`) VALUES (3, 4, 'marketing');
268
+ INSERT INTO Departments (`department_id`, `dept_store_id`, `department_name`) VALUES (4, 11, 'advertising');
269
+ INSERT INTO Departments (`department_id`, `dept_store_id`, `department_name`) VALUES (5, 4, 'managing');
270
+
271
+
272
+ CREATE TABLE `Order_Items` (
273
+ `order_item_id` INTEGER PRIMARY KEY,
274
+ `order_id` INTEGER NOT NULL,
275
+ `product_id` INTEGER NOT NULL,
276
+ FOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` ),
277
+ FOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )
278
+ );
279
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (1, 9, 7);
280
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (2, 1, 3);
281
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (3, 5, 2);
282
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (4, 14, 10);
283
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (5, 15, 4);
284
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (6, 14, 13);
285
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (7, 6, 13);
286
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (8, 12, 8);
287
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (9, 13, 12);
288
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (10, 14, 13);
289
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (11, 7, 11);
290
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (12, 14, 14);
291
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (13, 15, 5);
292
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (14, 8, 10);
293
+ INSERT INTO Order_Items (`order_item_id`, `order_id`, `product_id`) VALUES (15, 5, 4);
294
+ CREATE TABLE `Product_Suppliers` (
295
+ `product_id` INTEGER NOT NULL,
296
+ `supplier_id` INTEGER NOT NULL,
297
+ `date_supplied_from` DATETIME NOT NULL,
298
+ `date_supplied_to` DATETIME,
299
+ `total_amount_purchased` VARCHAR(80),
300
+ `total_value_purchased` DECIMAL(19,4),
301
+ PRIMARY KEY (`product_id`, `supplier_id`),
302
+ FOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` ),
303
+ FOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )
304
+ );
305
+
306
+
307
+ CREATE TABLE `Staff_Department_Assignments` (
308
+ `staff_id` INTEGER NOT NULL,
309
+ `department_id` INTEGER NOT NULL,
310
+ `date_assigned_from` DATETIME NOT NULL,
311
+ `job_title_code` VARCHAR(10) NOT NULL,
312
+ `date_assigned_to` DATETIME,
313
+ PRIMARY KEY (`staff_id`, `department_id`),
314
+ FOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` ),
315
+ FOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` )
316
+ );
317
+
318
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (4, 3, '2017-06-19 00:49:05', '2018-03-24 19:29:18', '89366.05', '36014.6000');
319
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (8, 4, '2017-07-02 00:35:12', '2018-03-25 07:30:49', '25085.57', '36274.5600');
320
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (3, 3, '2017-10-14 19:15:37', '2018-03-24 02:29:44', '15752.45', '7273.7400');
321
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (7, 1, '2017-08-22 00:58:42', '2018-03-24 02:38:31', '22332.08', '8042.7800');
322
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (15, 4, '2017-12-08 09:14:05', '2018-03-24 23:03:30', '25318.21', '29836.2600');
323
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (11, 1, '2017-12-01 19:46:53', '2018-03-24 05:22:36', '35149.74', '67216.3100');
324
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (11, 3, '2017-07-13 15:02:24', '2018-03-24 23:01:03', '31862.59', '76992.4200');
325
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (5, 2, '2017-07-28 19:23:39', '2018-03-24 09:17:15', '85922.86', '82524.9500');
326
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (6, 2, '2017-12-20 07:07:31', '2018-03-24 23:25:58', '64444.18', '97371.1200');
327
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (4, 1, '2017-09-19 02:14:02', '2018-03-25 09:15:30', '32881.38', '29987.7100');
328
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (15, 2, '2017-08-07 12:08:00', '2018-03-23 19:21:12', '13712.91', '48100.2300');
329
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (4, 4, '2017-06-09 01:30:40', '2018-03-24 12:35:08', '79316.31', '98086.8000');
330
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (8, 2, '2017-06-25 14:59:40', '2018-03-24 12:27:13', '83873.58', '99049.0100');
331
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (7, 4, '2017-11-17 08:23:16', '2018-03-25 12:03:33', '20689.78', '61800.9500');
332
+ INSERT INTO Product_Suppliers (`product_id`, `supplier_id`, `date_supplied_from`, `date_supplied_to`, `total_amount_purchased`, `total_value_purchased`) VALUES (14, 1, '2017-08-09 21:26:38', '2018-03-24 18:16:47', '20447.99', '27257.6000');
333
+
334
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (5, 4, '2017-06-11 22:55:20', 'Department Manager', '2018-03-23 21:59:11');
335
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (10, 5, '2017-12-18 19:12:15', 'Sales Person', '2018-03-23 20:25:24');
336
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (1, 5, '2018-02-14 03:15:29', 'Clerical Staff', '2018-03-24 19:57:56');
337
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (8, 1, '2017-05-14 12:30:33', 'Clerical Staff', '2018-03-25 03:15:31');
338
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (15, 2, '2017-03-31 23:07:54', 'Department Manager', '2018-03-24 09:11:14');
339
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (2, 5, '2017-11-14 04:38:44', 'Administration', '2018-03-24 07:04:28');
340
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (9, 4, '2016-09-20 02:59:15', 'Sales Person', '2018-03-24 20:13:13');
341
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (8, 2, '2017-05-10 02:32:17', 'Administration', '2018-03-24 02:36:57');
342
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (3, 5, '2016-10-19 08:11:39', 'Clerical Staff', '2018-03-25 15:34:31');
343
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (6, 1, '2017-12-26 06:34:20', 'Department Manager', '2018-03-25 09:53:37');
344
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (6, 2, '2016-09-15 11:00:41', 'Administration', '2018-03-25 02:29:08');
345
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (8, 5, '2017-06-06 22:22:17', 'Clerical Staff', '2018-03-24 13:02:22');
346
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (12, 5, '2016-11-12 14:10:55', 'Sales Person', '2018-03-25 02:59:19');
347
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (7, 3, '2016-05-17 07:02:37', 'Clerical Staff', '2018-03-24 10:45:21');
348
+ INSERT INTO Staff_Department_Assignments (`staff_id`, `department_id`, `date_assigned_from`, `job_title_code`, `date_assigned_to`) VALUES (2, 3, '2016-06-24 17:31:24', 'Administration', '2018-03-25 13:32:57');
test_database/driving_school/driving_school.sqlite ADDED
Binary file (32.8 kB). View file
 
test_database/election_representative/election_representative.sqlite ADDED
Binary file (20.5 kB). View file
 
test_database/entertainment_awards/entertainment_awards.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/entertainment_awards/schema.sql ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+
4
+ CREATE TABLE "festival_detail" (
5
+ "Festival_ID" int,
6
+ "Festival_Name" text,
7
+ "Chair_Name" text,
8
+ "Location" text,
9
+ "Year" int,
10
+ "Num_of_Audience" int,
11
+ PRIMARY KEY ("Festival_ID")
12
+ );
13
+
14
+ INSERT INTO "festival_detail" VALUES (1,"Panasonic Awards","Raymond Floyd","United States","2006","152");
15
+ INSERT INTO "festival_detail" VALUES (2,"Flower Awards","Charles Coody","United States","2007","155");
16
+ INSERT INTO "festival_detail" VALUES (3,"Cherry Awards","Doug Ford","United States","2007","160");
17
+ INSERT INTO "festival_detail" VALUES (4,"Gobel Awards","Arnold Palmer","United States","2008","160");
18
+ INSERT INTO "festival_detail" VALUES (5,"LA Awards","Lucy Lu","United States","2010","161");
19
+
20
+
21
+ CREATE TABLE artwork (
22
+ "Artwork_ID" int,
23
+ "Type" text,
24
+ "Name" text,
25
+ PRIMARY KEY ("Artwork_ID")
26
+ );
27
+
28
+
29
+ INSERT INTO artwork VALUES (1,"Program Music/Variety Show","Indonesian Idol");
30
+ INSERT INTO artwork VALUES (2,"Program Music/Variety Show","I Know");
31
+ INSERT INTO artwork VALUES (3,"Presenter Music/Variety Show","Loving you");
32
+ INSERT INTO artwork VALUES (4,"Program Music/Variety Show","Why");
33
+ INSERT INTO artwork VALUES (5,"Presenter Music/Variety Show","Boys");
34
+ INSERT INTO artwork VALUES (6,"Program Talent Show","Cats");
35
+ INSERT INTO artwork VALUES (7,"Presenter Talent Show","Daniel Mananta");
36
+ INSERT INTO artwork VALUES (8,"Program Talent Show","Martin");
37
+ INSERT INTO artwork VALUES (9,"Presenter Talent Show","Back Home");
38
+
39
+ CREATE TABLE nomination (
40
+ "Artwork_ID" int,
41
+ "Festival_ID" int,
42
+ "Result" text,
43
+ PRIMARY KEY ("Artwork_ID","Festival_ID"),
44
+ FOREIGN KEY ("Artwork_ID") REFERENCES `artwork`("Artwork_ID"),
45
+ FOREIGN KEY ("Festival_ID") REFERENCES `festival_detail`("Festival_ID")
46
+ );
47
+
48
+ INSERT INTO nomination VALUES (1,2,"Nominated");
49
+ INSERT INTO nomination VALUES (2,2,"Won");
50
+ INSERT INTO nomination VALUES (3,1,"Nominated");
51
+ INSERT INTO nomination VALUES (4,1,"Won");
52
+ INSERT INTO nomination VALUES (8,5,"Nominated");
53
+ INSERT INTO nomination VALUES (9,5,"Nominated");
54
+
test_database/epinions_1/epinions_1.sqlite ADDED
Binary file (57.3 kB). View file
 
test_database/flight_2/data_csv/airports100.csv ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ City ,AirportCode , AirportName ,Country , CountryAbbrev
2
+ 'Aberdeen ','APG','Phillips AAF ','United States ','US '
3
+ 'Aberdeen ','ABR','Municipal ','United States ','US '
4
+ 'Abilene ','DYS','Dyess AFB ','United States ','US '
5
+ 'Abilene ','ABI','Municipal ','United States ','US '
6
+ 'Abingdon ','VJI','Virginia Highlands ','United States ','US '
7
+ 'Ada ','ADT','Ada ','United States ','US '
8
+ 'Adak Island ','ADK','Adak Island Ns ','United States ','US '
9
+ 'Adrian ','ADG','Lenawee County ','United States ','US '
10
+ 'Afton ','AFO','Municipal ','United States ','US '
11
+ 'Aiken ','AIK','Municipal ','United States ','US '
12
+ 'Ainsworth ','ANW','Ainsworth ','United States ','US '
13
+ 'Akhiok ','AKK','Akhiok SPB ','United States ','US '
14
+ 'Akiachak ','KKI','Spb ','United States ','US '
15
+ 'Akiak ','AKI','Akiak ','United States ','US '
16
+ 'Akron CO ' ,'AKO','Colorado Plains Regional Airport ','United States ','US '
17
+ 'Akron/Canton OH ' ,'CAK','Akron/canton Regional ','United States ','US '
18
+ 'Akron/Canton ','AKC','Fulton International ','United States ','US '
19
+ 'Akutan ','KQA','Akutan ','United States ','US '
20
+ 'Alakanuk ','AUK','Alakanuk ','United States ','US '
21
+ 'Alameda ','NGZ','NAS ','United States ','US '
22
+ 'Alamogordo ','HMN','Holloman AFB ','United States ','US '
23
+ 'Alamogordo ','ALM','Municipal ','United States ','US '
24
+ 'Alamosa ','ALS','Municipal ','United States ','US '
25
+ 'Albany ','NAB','Albany NAS ','United States ','US '
26
+ 'Albany ','ABY','Dougherty County ','United States ','US '
27
+ 'Albany ','ALB','Albany International ','United States ','US '
28
+ 'Albany ','CVO','Albany ','United States ','US '
29
+ 'Albert Lea ','AEL','Albert Lea ','United States ','US '
30
+ 'Albuquerque ','ABQ','Albuquerque International ','United States ','US '
31
+ 'Aleknagik ','WKK','Aleknagik ','United States ','US '
32
+ 'Aleneva ','AED','Aleneva ','United States ','US '
33
+ 'Alexander City AL ' ,'ALX','Thomas C Russell Fld ','United States ','US '
34
+ 'Alexandria LA ' ,'AEX','Alexandria International ','United States ','US '
35
+ 'Alexandria ','ESF','Esler Field ','United States ','US '
36
+ 'Alexandria ','AXN','Alexandria ','United States ','US '
37
+ 'Alexandria Bay ','AXB','Alexandria Bay ','United States ','US '
38
+ 'Algona ','AXG','Algona ','United States ','US '
39
+ 'Alice ','ALI','International ','United States ','US '
40
+ 'Aliceville AL ' ,'AIV','George Downer ','United States ','US '
41
+ 'Alitak ','ALZ','Alitak SPB ','United States ','US '
42
+ 'Allakaket ','AET','Allakaket ','United States ','US '
43
+ 'Alliance ','AIA','Alliance ','United States ','US '
44
+ 'Alma ','AMN','Gratiot Community ','United States ','US '
45
+ 'Alpena ','APN','Alpena County Regional ','United States ','US '
46
+ 'Alpine ','ALE','Alpine ','United States ','US '
47
+ 'Alton ','ALN','Alton ','United States ','US '
48
+ 'Altus ','LTS','Altus AFB ','United States ','US '
49
+ 'Altus ','AXS','Municipal ','United States ','US '
50
+ 'Alyeska ','AQY','Alyeska ','United States ','US '
51
+ 'Amarillo ' ,'AMA','Rick Husband Amarillo International ','United States ','US '
52
+ 'Amarillo ','TDW','Tradewind ','United States ','US '
53
+ 'Ambler ','ABL','Ambler ','United States ','US '
54
+ 'Amchitka ','AHT','Amchitka ','United States ','US '
55
+ 'Amery ','AHH','Municipal ','United States ','US '
56
+ 'Ames ','AMW','Ames ','United States ','US '
57
+ 'Amityville ','AYZ','Zahns ','United States ','US '
58
+ 'Amook ','AOS','Amook ','United States ','US '
59
+ 'Anacortes ','OTS','Anacortes ','United States ','US '
60
+ 'Anacostia ','NDV','USN Heliport ','United States ','US '
61
+ 'Anaheim ','ANA','Orange County Steel Salvage Heliport ','United States ','US '
62
+ 'Anaktuvuk ','AKP','Anaktuvuk ','United States ','US '
63
+ 'Anchorage ','EDF','Elmendorf Afb ','United States ','US '
64
+ 'Anchorage ','ANC','Ted Stevens Anchorage International Airport ','United States ','US '
65
+ 'Anchorage ','MRI','Merrill Field ','United States ','US '
66
+ 'Anderson ','AID','Municipal ','United States ','US '
67
+ 'Anderson ','AND','Anderson ','United States ','US '
68
+ 'Andrews ','ADR','Andrews ','United States ','US '
69
+ 'Angel Fire ','AXX','Angel Fire ','United States ','US '
70
+ 'Angola ','ANQ','Tri-State Steuben Cty ','United States ','US '
71
+ 'Angoon ','AGN','Angoon ','United States ','US '
72
+ 'Anguilla ','RFK','Rollang Field ','United States ','US '
73
+ 'Aniak ','ANI','Aniak ','United States ','US '
74
+ 'Anita Bay ','AIB','Anita Bay ','United States ','US '
75
+ 'Ann Arbor MI ' ,'ARB','Municipal ','United States ','US '
76
+ 'Annapolis ','ANP','Lee ','United States ','US '
77
+ 'Annette Island ','ANN','Annette Island ','United States ','US '
78
+ 'Anniston AL ' ,'ANB','Anniston Metropolitan ','United States ','US '
79
+ 'Anniston ','QAW','Ft Mcclellan Bus Trml ','United States ','US '
80
+ 'Anniston ','RLI','Reilly AHP ','United States ','US '
81
+ 'Anthony ','ANY','Anthony ','United States ','US '
82
+ 'Antlers ','ATE','Antlers ','United States ','US '
83
+ 'Anvik ','ANV','Anvik ','United States ','US '
84
+ 'Apalachicola ','AAF','Municipal ','United States ','US '
85
+ 'Apple Valley ','APV','Apple Valley ','United States ','US '
86
+ 'Appleton ','ATW','Outagamie County ','United States ','US '
87
+ 'Arapahoe ','AHF','Municipal ','United States ','US '
88
+ 'Arcata ','ACV','Arcata ','United States ','US '
89
+ 'Arctic Village ','ARC','Arctic Village ','United States ','US '
90
+ 'Ardmore ','AHD','Downtown ','United States ','US '
91
+ 'Ardmore ','ADM','Ardmore Municipal Arpt ','United States ','US '
92
+ 'Arlington Heights ','JLH','US Army Heliport ','United States ','US '
93
+ 'Artesia ','ATS','Artesia ','United States ','US '
94
+ 'Neptune ' ,'ARX','Asbury Park ','United States ','US '
95
+ 'Ashland ','ASX','Ashland ','United States ','US '
96
+ 'Ashley ','ASY','Ashley ','United States ','US '
97
+ 'Aspen ','ASE','Aspen ','United States ','US '
98
+ 'Astoria ','AST','Astoria ','United States ','US '
99
+ 'Athens ','AHN','Athens ','United States ','US '
100
+ 'Athens ','ATO','Ohio University ','United States ','US '
101
+ 'Athens ','MMI','McMinn County ','United States ','US '
test_database/flight_4/link.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://psfotis.github.io/sqlseminar/exercises/
test_database/flight_4/sql.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://psfotis.github.io/sqlseminar/exercises/
test_database/icfp_1/q.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ q5. Retrieve the titles of all papers with a single author.
2
+
3
+ q6. Retrieve the titles and number of affiliated institutions of all papers with authors from more than one institution.
4
+
5
+ q7. Retrieve the title(s) and number of authors of the paper(s) with the most authors in the database instance. For example, if there is one paper with three authors in the whole batch, and every other paper has one or two authors (that's the case in the database you are given), identify that paper.
6
+
7
+ q8. Retrieve the authors' authID, first and last names, in alphabetical order, and the number of papers on which they have authorship.
8
+
9
+ q9. Retrieve the authID, first and last name of the author(s) and their number of collaborators (shared authorships), in alphabetical order.
test_database/institution_sports/institution_sports.sqlite ADDED
Binary file (20.5 kB). View file
 
test_database/journal_committee/journal_committee.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/journal_committee/schema.sql ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE IF NOT EXISTS "journal" (
2
+ "Journal_ID" int,
3
+ "Date" text,
4
+ "Theme" text,
5
+ "Sales" int,
6
+ PRIMARY KEY ("Journal_ID")
7
+ );
8
+ INSERT INTO journal VALUES(1,'September 9, 2001','Miami Dolphins',798);
9
+ INSERT INTO journal VALUES(2,'September 23, 2001','at Jacksonville Jaguars',994);
10
+ INSERT INTO journal VALUES(4,'October 7, 2001','at Baltimore Ravens',7494);
11
+ INSERT INTO journal VALUES(5,'October 14, 2001','Tampa Bay Buccaneers',4798);
12
+ INSERT INTO journal VALUES(6,'October 21, 2001','at Detroit Lions',2940);
13
+ INSERT INTO journal VALUES(7,'October 29, 2001','at Pittsburgh Steelers',1763);
14
+ INSERT INTO journal VALUES(8,'November 4, 2001','Jacksonville Jaguars',1232);
15
+ INSERT INTO journal VALUES(9,'November 12, 2001','Baltimore Ravens',6532);
16
+ INSERT INTO journal VALUES(10,'November 18, 2001','at Cincinnati Bengals',3421);
17
+ INSERT INTO journal VALUES(11,'November 25, 2001','Pittsburgh Steelers',3342);
18
+ INSERT INTO journal VALUES(12,'December 2, 2001','at Cleveland Browns',3534);
19
+ INSERT INTO journal VALUES(13,'December 9, 2001','at Minnesota Vikings',4271);
20
+ INSERT INTO journal VALUES(14,'December 16, 2001','Green Bay Packers',2804);
21
+ INSERT INTO journal VALUES(15,'December 22, 2001','at Oakland Raiders',1934);
22
+ INSERT INTO journal VALUES(16,'December 30, 2001','Cleveland Browns',3798);
23
+ INSERT INTO journal VALUES(17,'January 6, 2002','Cincinnati Bengals',5342);
24
+ CREATE TABLE IF NOT EXISTS "editor" (
25
+ "Editor_ID" int,
26
+ "Name" text,
27
+ "Age" real,
28
+ PRIMARY KEY ("Editor_ID")
29
+ );
30
+ INSERT INTO editor VALUES(1.0,'Kamila Porczyk',34.0);
31
+ INSERT INTO editor VALUES(2.0,'Anna Powierza',35.0);
32
+ INSERT INTO editor VALUES(3.0,'Marek Siudym',20.999999999999999999);
33
+ INSERT INTO editor VALUES(4.0,'Piotr Pręgowski',43.000000000000000001);
34
+ INSERT INTO editor VALUES(5.0,'Szymon Wydra',20.0);
35
+ INSERT INTO editor VALUES(6.0,'Władysław Grzywna',24.0);
36
+ INSERT INTO editor VALUES(7.0,'Mariusz Zalejski',25.0);
37
+ INSERT INTO editor VALUES(8.0,'Grażyna Wolszczak',54.0);
38
+ INSERT INTO editor VALUES(9.0,'Maria Góralczyk',37.999999999999999999);
39
+ CREATE TABLE IF NOT EXISTS "journal_committee" (
40
+ "Editor_ID" int,
41
+ "Journal_ID" int,
42
+ "Work_Type" text,
43
+ PRIMARY KEY ("Editor_ID","Journal_ID"),
44
+ FOREIGN KEY ("Editor_ID") REFERENCES `editor`("Editor_ID"),
45
+ FOREIGN KEY ("Journal_ID") REFERENCES `journal`("Journal_ID")
46
+ );
47
+ INSERT INTO journal_committee VALUES(1,13,'Photo');
48
+ INSERT INTO journal_committee VALUES(8,17,'Article');
49
+ INSERT INTO journal_committee VALUES(6,11,'Photo');
50
+ INSERT INTO journal_committee VALUES(4,2,'Article');
51
+ INSERT INTO journal_committee VALUES(3,6,'Title');
52
+ INSERT INTO journal_committee VALUES(9,12,'Photo');
53
+ INSERT INTO journal_committee VALUES(8,4,'Photo');
54
+
test_database/performance_attendance/schema.sql ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+
4
+ CREATE TABLE "member" (
5
+ "Member_ID" text,
6
+ "Name" text,
7
+ "Nationality" text,
8
+ "Role" text,
9
+ PRIMARY KEY ("Member_ID")
10
+ );
11
+
12
+
13
+
14
+ INSERT INTO "member" VALUES ("1","Wilfredo Ruiz","Uruguay","Prime Violin");
15
+ INSERT INTO "member" VALUES ("2","Luis González","Argentina","Violin");
16
+ INSERT INTO "member" VALUES ("3","Héctor Campana","Argentina","Violin");
17
+ INSERT INTO "member" VALUES ("4","Héctor Campana","Argentina","Violin");
18
+ INSERT INTO "member" VALUES ("5","Juan Espil","Argentina","Viola");
19
+ INSERT INTO "member" VALUES ("6","Andrew Moten","United States","Viola");
20
+ INSERT INTO "member" VALUES ("7","Charlie Burke","United States","Viola");
21
+ INSERT INTO "member" VALUES ("8","Corey Allen","United States","Cello");
22
+ INSERT INTO "member" VALUES ("9","John Eubanks","United States","Cello");
23
+ INSERT INTO "member" VALUES ("10","Joshua Pittman","United States","Bass");
24
+ INSERT INTO "member" VALUES ("11","Joseph Bunn","United States","Bass");
25
+
26
+ CREATE TABLE "performance" (
27
+ "Performance_ID" real,
28
+ "Date" text,
29
+ "Host" text,
30
+ "Location" text,
31
+ "Attendance" int,
32
+ PRIMARY KEY ("Performance_ID")
33
+ );
34
+
35
+ INSERT INTO "performance" VALUES (1,"February 2","Boston Bruins","TD Garden","165");
36
+ INSERT INTO "performance" VALUES (2,"February 4","New York Rangers","Madison Square Garden","1820");
37
+ INSERT INTO "performance" VALUES (3,"February 5","Atlanta Thrashers","Verizon Center","1878");
38
+ INSERT INTO "performance" VALUES (4,"February 7","Pittsburgh Penguins","Verizon Center","1877");
39
+ INSERT INTO "performance" VALUES (5,"February 10","Montreal Canadiens","Bell Centre","2173");
40
+ INSERT INTO "performance" VALUES (6,"February 11","Ottawa Senators","Scotiabank Place","1982");
41
+
42
+
43
+ CREATE TABLE "member_attendance" (
44
+ "Member_ID" int,
45
+ "Performance_ID" int,
46
+ "Num_of_Pieces" int,
47
+ PRIMARY KEY ("Member_ID","Performance_ID"),
48
+ FOREIGN KEY ("Member_ID") REFERENCES `member`("Member_ID"),
49
+ FOREIGN KEY ("Performance_ID") REFERENCES `performance`("Performance_ID")
50
+ );
51
+
52
+ INSERT INTO "member_attendance" VALUES (11,3,2);
53
+ INSERT INTO "member_attendance" VALUES (7,2,3);
54
+ INSERT INTO "member_attendance" VALUES (4,6,4);
55
+ INSERT INTO "member_attendance" VALUES (2,1,1);
56
+ INSERT INTO "member_attendance" VALUES (3,1,1);
57
+ INSERT INTO "member_attendance" VALUES (4,3,2);
58
+ INSERT INTO "member_attendance" VALUES (5,1,2);
59
+ INSERT INTO "member_attendance" VALUES (1,4,4);
60
+
test_database/roller_coaster/schema.sql ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+ CREATE TABLE "roller_coaster" (
4
+ "Roller_Coaster_ID" int,
5
+ "Name" text,
6
+ "Park" text,
7
+ "Country_ID" int,
8
+ "Length" real,
9
+ "Height" real,
10
+ "Speed" text,
11
+ "Opened" text,
12
+ "Status" text,
13
+ PRIMARY KEY ("Roller_Coaster_ID"),
14
+ FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
15
+ );
16
+
17
+ CREATE TABLE "country" (
18
+ "Country_ID" int,
19
+ "Name" text,
20
+ "Population" int,
21
+ "Area" int,
22
+ "Languages" text,
23
+ PRIMARY KEY ("Country_ID")
24
+ );
25
+
26
+ INSERT INTO "country" VALUES (1,"Austria","8206524","83871","German");
27
+ INSERT INTO "country" VALUES (2,"Finland","5261008","338145","Finnish Swedish");
28
+ INSERT INTO "country" VALUES (3,"Sweden","9047752","449964","Swedish");
29
+
30
+ INSERT INTO "roller_coaster" VALUES (1,"Boardwalk Bullet","Kemah Boardwalk",1,"3236","96","51","August 31, 2007","Operating");
31
+ INSERT INTO "roller_coaster" VALUES (2,"Dauling Dragon","Happy Valley",1,"3914","105","55","2012","Operating");
32
+ INSERT INTO "roller_coaster" VALUES (3,"Hades 360","Mt. Olympus",1,"4726","136","70","May 14, 2005","Operating");
33
+ INSERT INTO "roller_coaster" VALUES (4,"Ravine Flyer II","Waldameer",2,"2900","120","57","May 17, 2008","Operating");
34
+ INSERT INTO "roller_coaster" VALUES (5,"Twister","Gröna Lund",2,"1574","50","37.9","2011","Operating");
35
+ INSERT INTO "roller_coaster" VALUES (6,"The Voyage","Holiday World",3,"6442","163","67","May 6, 2006","Operating");
test_database/school_finance/schema.sql ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+ CREATE TABLE "School" (
4
+ "School_id" text,
5
+ "School_name" text,
6
+ "Location" text,
7
+ "Mascot" text,
8
+ "Enrollment" int,
9
+ "IHSAA_Class" text,
10
+ "IHSAA_Football_Class" text,
11
+ "County" text,
12
+ PRIMARY KEY ("School_id")
13
+ );
14
+
15
+ CREATE TABLE "budget" (
16
+ "School_id" int,
17
+ "Year" int,
18
+ "Budgeted" int,
19
+ "total_budget_percent_budgeted" real,
20
+ "Invested" int,
21
+ "total_budget_percent_invested" real,
22
+ "Budget_invested_percent" text,
23
+ PRIMARY KEY("School_id","YEAR"),
24
+ FOREIGN KEY("School_id") REFERENCES "School"("School_id")
25
+
26
+ );
27
+
28
+ CREATE TABLE "endowment" (
29
+ "endowment_id" int,
30
+ "School_id" int,
31
+ "donator_name" text,
32
+ "amount" real,
33
+ PRIMARY KEY("endowment_id"),
34
+ FOREIGN KEY("School_id") REFERENCES "School"("School_id")
35
+ );
36
+
37
+ INSERT INTO "School" VALUES (1,"Bremen","Bremen","Lions","495","AA","AA","50 Marshall");
38
+ INSERT INTO "School" VALUES (2,"Culver Community","Culver","Cavaliers","287","A","A","50 Marshall");
39
+ INSERT INTO "School" VALUES (3,"Glenn","Walkerton","Falcons","605","AAA","AAA","71 St. Joseph");
40
+ INSERT INTO "School" VALUES (4,"Jimtown","Elkhart","Jimmies","601","AAA","AAA","20 Elkhart");
41
+ INSERT INTO "School" VALUES (5,"Knox Community","Knox","Redskins","620","AAA","AAA","75 Starke");
42
+ INSERT INTO "School" VALUES (6,"LaVille","Lakeville","Lancers","379","AA","A","71 St. Joseph");
43
+ INSERT INTO "School" VALUES (7,"New Prairie 1","New Carlisle","Cougars","852","AAA","AAAA","46 LaPorte 71 St. Joseph");
44
+ INSERT INTO "School" VALUES (8,"Triton","Bourbon","Trojans","316","A","A","50 Marshall");
45
+ INSERT INTO "budget" VALUES (2,"1999","4979","2","2134","2","42.9");
46
+ INSERT INTO "budget" VALUES (2,"2000","3666","2","5840","2","159.3");
47
+ INSERT INTO "budget" VALUES (2,"2001","6803","2","8335","2","122.5");
48
+ INSERT INTO "budget" VALUES (3,"2002","6803","2","8335","2","146.9");
49
+ INSERT INTO "budget" VALUES (1,"2003","119527","2.4","85249","2.2","71.3");
50
+ INSERT INTO "budget" VALUES (4,"2004","74849","2.0","95542","2.2","127.6");
51
+ INSERT INTO "budget" VALUES (5,"2005","61283","1.3","140102","2.7","228.8");
52
+ INSERT INTO "budget" VALUES (5,"2006","113531","2.0","146102","2.7","228.6");
53
+ INSERT INTO "endowment" VALUES (1,1,"Monte Plata","9.51");
54
+ INSERT INTO "endowment" VALUES (2,2,"San José de Ocoa","9.83");
55
+ INSERT INTO "endowment" VALUES (3,3,"Distrito Nacional","9.55");
56
+ INSERT INTO "endowment" VALUES (4,3,"Valverde","9.73");
57
+ INSERT INTO "endowment" VALUES (5,3,"San Cristóbal","9.05");
58
+ INSERT INTO "endowment" VALUES (6,4,"Santo Domingo Este","8.99");
59
+ INSERT INTO "endowment" VALUES (7,4,"Santiago","8.85");
60
+ INSERT INTO "endowment" VALUES (8,5,"Duarte","8.53");
61
+ INSERT INTO "endowment" VALUES (9,6,"Com. Dom. En Estados Unidos","8.43");
62
+ INSERT INTO "endowment" VALUES (10,7,"La Vega","8.82");
63
+ INSERT INTO "endowment" VALUES (11, 8,"Peravia","8.33");
64
+
test_database/school_finance/school_finance.sqlite ADDED
Binary file (28.7 kB). View file
 
test_database/vehicle_rent/schema.sql ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PRAGMA foreign_keys = ON;
2
+
3
+ CREATE TABLE "Customers" (
4
+ "id" int,
5
+ "name" text,
6
+ "age" int,
7
+ "membership_credit" int,
8
+ PRIMARY KEY ("id")
9
+ );
10
+ INSERT INTO "Customers" VALUES (1, "Griffiths",26, 100);
11
+ INSERT INTO "Customers" VALUES (2, "Silluzio",34, 1200);
12
+ INSERT INTO "Customers" VALUES (3, "Woodman",35, 2000);
13
+ INSERT INTO "Customers" VALUES (4, "Poulter", 63, 43500);
14
+ INSERT INTO "Customers" VALUES (5, "Smith", 45, 5399);
15
+
16
+
17
+ CREATE TABLE "Discount" (
18
+ "id" int,
19
+ "name" text,
20
+ "membership_credit" int,
21
+ PRIMARY KEY ("id")
22
+ );
23
+ INSERT INTO "Discount" VALUES (1, "no discount", 0);
24
+ INSERT INTO "Discount" VALUES (2, "20% off", 1000);
25
+ INSERT INTO "Discount" VALUES (3, "40% off for over $6000", 2000);
26
+ INSERT INTO "Discount" VALUES (4, "50% off", 4000);
27
+ INSERT INTO "Discount" VALUES (5, "70% off", 400000);
28
+
29
+
30
+ CREATE TABLE "Vehicles" (
31
+ "id" int,
32
+ "name" text,
33
+ "Model_year" int,
34
+ "Type_of_powertrain" text,
35
+ "Combined_fuel_economy_rate" int,
36
+ "City_fuel_economy_rate" int,
37
+ "Highway_fuel_economy_rate" int,
38
+ "Cost_per_25_miles" real,
39
+ "Annual_fuel_cost" real,
40
+ "Notes" text,
41
+ PRIMARY KEY ("id")
42
+ );
43
+
44
+
45
+
46
+ INSERT INTO "Vehicles" VALUES (1, "Chevrolet Spark EV","2014","Electric","119","128","109","0.87","500","See (1)");
47
+ INSERT INTO "Vehicles" VALUES (2, "Honda Fit EV","2013","hybrid","118","132","105","0.87","500","See (1)");
48
+ INSERT INTO "Vehicles" VALUES (3, "Fiat 500e","2013","Electric","116","122","108","0.87","500","See (1)");
49
+ INSERT INTO "Vehicles" VALUES (4, "Nissan Leaf","2013","Electric","115","129","102","0.87","500","See (1)");
50
+ INSERT INTO "Vehicles" VALUES (5, "Mitsubishi i","2012","hybrid","112","126","99","0.90","550","best selling of the year");
51
+ INSERT INTO "Vehicles" VALUES (6, "Ford Focus Electric","2012","electric","105","110","99","0.96","600","See (2)");
52
+ INSERT INTO "Vehicles" VALUES (7, "BMW ActiveE","2011","Electric","102","107","96","0.99","600","See (1)");
53
+
54
+
55
+ CREATE TABLE "Renting_history" (
56
+ "id" int,
57
+ "customer_id" int,
58
+ "discount_id" int,
59
+ "vehicles_id" int,
60
+ "total_hours" int,
61
+ PRIMARY KEY ("id"),
62
+ FOREIGN KEY ("customer_id") REFERENCES "Customers"("id"),
63
+ FOREIGN KEY ("vehicles_id") REFERENCES "Vehicles"("id"),
64
+ FOREIGN KEY ("discount_id") REFERENCES "Discount"("id")
65
+ );
66
+
67
+
68
+
69
+ INSERT INTO "Renting_history" VALUES (1,1,1,2,1);
70
+ INSERT INTO "Renting_history" VALUES (2,2,2,5,10);
71
+ INSERT INTO "Renting_history" VALUES (3,3,3,7,24);
72
+ INSERT INTO "Renting_history" VALUES (4,4,4,3,24);
73
+ INSERT INTO "Renting_history" VALUES (5,1,1,5,36);
74
+ INSERT INTO "Renting_history" VALUES (6,2,2,1,24);
75
+ INSERT INTO "Renting_history" VALUES (7,5,4,4,72);
76
+
77
+
test_database/voter_2/schema.sql ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ create table Student (
2
+ StuID INTEGER PRIMARY KEY,
3
+ LName VARCHAR(12),
4
+ Fname VARCHAR(12),
5
+ Age INTEGER,
6
+ Sex VARCHAR(1),
7
+ Major INTEGER,
8
+ Advisor INTEGER,
9
+ city_code VARCHAR(3)
10
+ );
11
+
12
+ create table Voting_record (
13
+ StuID INTEGER,
14
+ Registration_Date VARCHAR(12),
15
+ Election_Cycle VARCHAR(12),
16
+ President_Vote INTEGER,
17
+ Vice_President_Vote INTEGER,
18
+ Secretary_Vote INTEGER,
19
+ Treasurer_Vote INTEGER,
20
+ Class_President_Vote INTEGER,
21
+ Class_Senator_Vote INTEGER,
22
+ FOREIGN KEY(StuID) REFERENCES Student(StuID),
23
+ FOREIGN KEY(President_Vote) REFERENCES Student(StuID),
24
+ FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),
25
+ FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),
26
+ FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),
27
+ FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),
28
+ FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)
29
+ );
30
+
31
+ insert into Student values ( 1001, 'Smith', 'Linda', 18, 'F', 600, 1121,'BAL');
32
+ insert into Student values ( 1002, 'Kim', 'Tracy', 19, 'F', 600, 7712,'HKG');
33
+ insert into Student values ( 1003, 'Jones', 'Shiela', 21, 'F', 600, 7792,'WAS');
34
+ insert into Student values ( 1004, 'Kumar', 'Dinesh', 20, 'M', 600, 8423,'CHI');
35
+ insert into Student values ( 1005, 'Gompers', 'Paul', 26, 'M', 600, 1121,'YYZ');
36
+ insert into Student values ( 1006, 'Schultz', 'Andy', 18, 'M', 600, 1148,'BAL');
37
+ insert into Student values ( 1007, 'Apap', 'Lisa', 18, 'F', 600, 8918,'PIT');
38
+ insert into Student values ( 1008, 'Nelson', 'Jandy', 20, 'F', 600, 9172,'BAL');
39
+ insert into Student values ( 1009, 'Tai', 'Eric', 19, 'M', 600, 2192,'YYZ');
40
+ insert into Student values ( 1010, 'Lee', 'Derek', 17, 'M', 600, 2192,'HOU');
41
+ insert into Student values ( 1011, 'Adams', 'David', 22, 'M', 600, 1148,'PHL');
42
+ insert into Student values ( 1012, 'Davis', 'Steven', 20, 'M', 600, 7723,'PIT');
43
+ insert into Student values ( 1014, 'Norris', 'Charles', 18, 'M', 600, 8741, 'DAL');
44
+ insert into Student values ( 1015, 'Lee', 'Susan', 16, 'F', 600, 8721,'HKG');
45
+ insert into Student values ( 1016, 'Schwartz', 'Mark', 17, 'M', 600, 2192,'DET');
46
+ insert into Student values ( 1017, 'Wilson', 'Bruce', 27, 'M', 600, 1148,'LON');
47
+ insert into Student values ( 1018, 'Leighton', 'Michael', 20, 'M', 600, 1121, 'PIT');
48
+ insert into Student values ( 1019, 'Pang', 'Arthur', 18, 'M', 600, 2192,'WAS');
49
+ insert into Student values ( 1020, 'Thornton', 'Ian', 22, 'M', 520, 7271,'NYC');
50
+ insert into Student values ( 1021, 'Andreou', 'George', 19, 'M', 520, 8722, 'NYC');
51
+ insert into Student values ( 1022, 'Woods', 'Michael', 17, 'M', 540, 8722,'PHL');
52
+ insert into Student values ( 1023, 'Shieber', 'David', 20, 'M', 520, 8722,'NYC');
53
+ insert into Student values ( 1024, 'Prater', 'Stacy', 18, 'F', 540, 7271,'BAL');
54
+ insert into Student values ( 1025, 'Goldman', 'Mark', 18, 'M', 520, 7134,'PIT');
55
+ insert into Student values ( 1026, 'Pang', 'Eric', 19, 'M', 520, 7134,'HKG');
56
+ insert into Student values ( 1027, 'Brody', 'Paul', 18, 'M', 520, 8723,'LOS');
57
+ insert into Student values ( 1028, 'Rugh', 'Eric', 20, 'M', 550, 2311,'ROC');
58
+ insert into Student values ( 1029, 'Han', 'Jun', 17, 'M', 100, 2311,'PEK');
59
+ insert into Student values ( 1030, 'Cheng', 'Lisa', 21, 'F', 550, 2311,'SFO');
60
+ insert into Student values ( 1031, 'Smith', 'Sarah', 20, 'F', 550, 8772,'PHL');
61
+ insert into Student values ( 1032, 'Brown', 'Eric', 20, 'M', 550, 8772,'ATL');
62
+ insert into Student values ( 1033, 'Simms', 'William', 18, 'M', 550, 8772,'NAR');
63
+ insert into Student values ( 1034, 'Epp', 'Eric', 18, 'M', 050, 5718,'BOS');
64
+ insert into Student values ( 1035, 'Schmidt', 'Sarah', 26, 'F', 050, 5718,'WAS');
65
+
66
+ insert into Voting_record values (1001, "08/30/2015", "Spring", 1004, 1007, 1010, 1035, 1001, 1028);
67
+ insert into Voting_record values (1002, "08/30/2014", "Spring", 1014, 1007, 1020, 1025, 1021, 1028);
68
+ insert into Voting_record values (1003, "08/30/2013", "Spring", 1004, 1017, 1030, 1035, 1031, 1028);
69
+ insert into Voting_record values (1004, "08/30/2013", "Spring", 1024, 1017, 1020, 1035, 1011, 1028);
70
+ insert into Voting_record values (1005, "08/30/2012", "Spring", 1024, 1017, 1010, 1035, 1021, 1028);
71
+ insert into Voting_record values (1001, "08/30/2015", "Fall", 1004, 1007, 1010, 1035, 1021, 1028);
72
+ insert into Voting_record values (1002, "08/30/2014", "Fall", 1004, 1007, 1020, 1035, 1021, 1028);
73
+ insert into Voting_record values (1003, "08/30/2013", "Fall", 1004, 1017, 1020, 1035, 1031, 1028);
74
+ insert into Voting_record values (1004, "08/30/2013", "Fall", 1024, 1017, 1020, 1035, 1011, 1018);
75
+ insert into Voting_record values (1005, "08/30/2012", "Fall", 1024, 1017, 1010, 1035, 1021, 1028);
test_database/voter_2/voter_2.sqlite ADDED
Binary file (12.3 kB). View file
 
test_database/warehouse_1/q.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Select all warehouses.
2
+
3
+ Select all boxes with a value larger than $150.
4
+
5
+ Select all distinct contents in all the boxes.
6
+
7
+ Select the average value of all the boxes.
8
+
9
+ Select the warehouse code and the average value of the boxes in each warehouse.
10
+
11
+ Same as previous exercise, but select only those warehouses where the average value of the boxes is greater than 150.
12
+
13
+ Select the code of each box, along with the name of the city the box is located in.
14
+
15
+ Select the warehouse codes, along with the number of boxes in each warehouse.
16
+
17
+ Select the codes of all warehouses that are saturated (a warehouse is saturated if the number of boxes in it is larger than the warehouse's capacity).
18
+
19
+ Select the codes of all the boxes located in Chicago.
test_database/warehouse_1/warehouse_1.sqlite ADDED
Binary file (16.4 kB). View file