Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SUPERGEEKS-SQL
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Finlay White
SUPERGEEKS-SQL
Commits
1068e723
Commit
1068e723
authored
2 years ago
by
Finlay White
Browse files
Options
Downloads
Patches
Plain Diff
badges added
parent
5eb357ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
createdb.sql
+66
-0
66 additions, 0 deletions
createdb.sql
with
66 additions
and
0 deletions
createdb.sql
0 → 100644
+
66
−
0
View file @
1068e723
DROP
SCHEMA
IF
EXISTS
`SuperGeeks`
;
CREATE
SCHEMA
`SuperGeeks`
;
USE
`SuperGeeks`
;
DROP
TABLE
IF
EXISTS
`Parents`
;
CREATE
TABLE
`Parents`
(
parentID
int
(
20
)
not
null
,
primary
key
(
parentID
),
fname
varchar
(
35
),
lname
varchar
(
35
),
email
varchar
(
320
),
-- maximum size of an email address should be able to store absolutely all possible email addresses
-- unable to view payment info from any select functions it is also encrypted for customer safety
paymentinfo
varchar
(
50
),
subscribed
bool
,
phonenum
int
);
DROP
TABLE
IF
EXISTS
`Students`
;
CREATE
TABLE
`Students`
(
studentID
int
primary
key
,
fname
varchar
(
35
),
lname
varchar
(
35
),
-- The UK Government Data Standards Catalogue reccomends 35 characters for each the first name and last name
bday
date
,
dayjoined
date
,
parentsID
int
(
20
),
FOREIGN
KEY
(
parentsID
)
REFERENCES
Parents
(
parentID
)
-- parent ID is stored in student rather than the parents table so that one parent can have many children
-- and not one child can have many parents. A child may have multiple parents irl but they would share an
-- account
);
DROP
TABLE
IF
EXISTS
`Volunteers`
;
CREATE
TABLE
`Volunteers`
(
VolunteerID
int
(
20
),
primary
key
(
VolunteerID
),
fname
varchar
(
35
),
lname
varchar
(
35
),
hoursworked
int
(
8
),
DBSlastchecked
date
,
SGlastchecked
date
,
emergencycontact
varchar
(
20
)
);
DROP
TABLE
IF
EXISTS
`Session`
;
CREATE
TABLE
`Session`
(
sessionID
int
(
20
),
primary
key
(
sessionID
),
leaderID
int
(
20
),
location
varchar
(
55
),
duration
int
(
10
),
FOREIGN
KEY
(
leaderID
)
REFERENCES
Volunteers
(
VolunteerID
),
maxAttendees
int
(
10
),
Nohelpers
int
(
10
));
DROP
TABLE
IF
EXISTS
`Badge`
;
CREATE
TABLE
`Badge`
(
BadgeID
int
(
20
),
badgeName
varchar
(
35
),
requirementID
int
(
20
)
);
DROP
TABLE
IF
EXISTS
`BadgeAwarded`
;
CREATE
TABLE
`BadgeAwarded`
(
studentID
int
(
20
),
awardedby
int
(
20
),
BadgeID
int
(
20
),
dateAwarded
date
);
select
*
from
Session
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment