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
9ee3940d
Commit
9ee3940d
authored
2 years ago
by
Finlay White
Browse files
Options
Downloads
Patches
Plain Diff
waitlisttg
parent
58387758
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
createdb.sql
+33
-2
33 additions, 2 deletions
createdb.sql
with
33 additions
and
2 deletions
createdb.sql
+
33
−
2
View file @
9ee3940d
...
@@ -61,8 +61,21 @@ CREATE TABLE `Badge`(
...
@@ -61,8 +61,21 @@ CREATE TABLE `Badge`(
BadgeID
varchar
(
40
)
not
null
unique
,
BadgeID
varchar
(
40
)
not
null
unique
,
primary
key
(
BadgeID
),
primary
key
(
BadgeID
),
badgeName
varchar
(
35
),
badgeName
varchar
(
35
),
badgeDesc
varchar
(
255
)
badgeDesc
varchar
(
255
),
);
ageGroup
int
(
1
)
);
DROP
TABLE
IF
EXISTS
`WaitList`
;
CREATE
TABLE
`WaitList`
(
studentID
varchar
(
40
)
unique
,
SessionID
varchar
(
40
),
dateJoined
date
,
ageGroup
int
(
1
),
FOREIGN
KEY
(
studentID
)
REFERENCES
Students
(
studentID
),
FOREIGN
KEY
(
SessionID
)
REFERENCES
Sessions
(
SessionID
));
DROP
TABLE
IF
EXISTS
`BadgeAwarded`
;
DROP
TABLE
IF
EXISTS
`BadgeAwarded`
;
CREATE
TABLE
`BadgeAwarded`
(
CREATE
TABLE
`BadgeAwarded`
(
awardedID
int
(
20
)
not
null
unique
,
awardedID
int
(
20
)
not
null
unique
,
...
@@ -182,6 +195,24 @@ BEGIN
...
@@ -182,6 +195,24 @@ BEGIN
END
$$
END
$$
DELIMITER
;
DELIMITER
;
drop
procedure
if
exists
`applyToGroup`
;
delimiter
$$
CREATE
PROCEDURE
applyToGroup
(
IN
studentID
varchar
(
40
),
IN
SessionID
varchar
(
255
),
IN
ageGroup
int
(
1
))
BEGIN
DECLARE
EXIT
HANDLER
FOR
1062
BEGIN
SELECT
'This student is already on a wait list'
as
ERROR
;
END
;
INSERT
INTO
WaitList
(
StudentID
,
SessionID
,
dateJoined
,
ageGroup
)
values
(
StudentID
,
SessionID
,
CURDATE
(),
ageGroup
);
END
$$
DELIMITER
;
drop
procedure
if
exists
addStudent
;
drop
procedure
if
exists
addStudent
;
delimiter
$$
delimiter
$$
CREATE
PROCEDURE
addStudent
(
CREATE
PROCEDURE
addStudent
(
...
...
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