diff --git a/createdb.sql b/createdb.sql new file mode 100644 index 0000000000000000000000000000000000000000..a214ea038ea9be4ca86e84498ea28b3be3fcde4c --- /dev/null +++ b/createdb.sql @@ -0,0 +1,66 @@ +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