Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs122-19wi
nanodb-base
Commits
67f1b287
Commit
67f1b287
authored
6 years ago
by
Donald H. (Donnie) Pinkston, III
Browse files
Options
Download
Email Patches
Plain Diff
Stores schema for HW3+
parent
4c8b4486
master
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
schemas/stores/make-stores.sql
+39
-0
schemas/stores/make-stores.sql
schemas/stores/stores-10K.sql
+10701
-0
schemas/stores/stores-10K.sql
schemas/stores/stores-28K.sql
+27240
-0
schemas/stores/stores-28K.sql
with
37980 additions
and
0 deletions
+37980
-0
schemas/stores/make-stores.sql
0 → 100755
View file @
67f1b287
DROP
TABLE
IF
EXISTS
employees
;
DROP
TABLE
IF
EXISTS
stores
;
DROP
TABLE
IF
EXISTS
cities
;
DROP
TABLE
IF
EXISTS
states
;
CREATE
TABLE
states
(
state_id
INTEGER
PRIMARY
KEY
,
state_name
VARCHAR
(
30
)
NOT
NULL
);
CREATE
TABLE
cities
(
city_id
INTEGER
PRIMARY
KEY
,
city_name
VARCHAR
(
30
)
NOT
NULL
,
population
INTEGER
NOT
NULL
,
state_id
INTEGER
REFERENCES
states
(
state_id
)
);
CREATE
TABLE
stores
(
store_id
INTEGER
PRIMARY
KEY
,
city_id
INTEGER
REFERENCES
cities
(
city_id
),
property_costs
INTEGER
NOT
NULL
);
CREATE
TABLE
employees
(
emp_id
INTEGER
PRIMARY
KEY
,
last_name
VARCHAR
(
30
)
NOT
NULL
,
first_name
VARCHAR
(
30
)
NOT
NULL
,
home_loc_id
INTEGER
REFERENCES
cities
(
city_id
),
work_loc_id
INTEGER
REFERENCES
cities
(
city_id
),
salary
INTEGER
NOT
NULL
,
manager_id
INTEGER
);
This diff is collapsed.
Click to expand it.
schemas/stores/stores-10K.sql
0 → 100644
View file @
67f1b287
This diff is collapsed.
Click to expand it.
schemas/stores/stores-28K.sql
0 → 100644
View file @
67f1b287
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help