Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
1 result

Target

Select target project
  • c22063583/supergeeks_yo
  • c22063583/supergeeks-sql
2 results
Select Git revision
  • main
1 result
Show changes
Commits on Source (24)
File added
Oh god why did I do that
md5 not secure lol
hashing names not studentcode
phone num should be varchar what if starts with 0?
also should be 15 digits
subscribed should be int 1 for each child
vllunteers don't need hours worked they can just
\ No newline at end of file
This diff is collapsed.
-- please run the createdb file before every time you run this
SELECT * FROM parents;
do sleep(2);
call addParent("jeff","Jones","email@realemail.com","veryStrongPassw0rd",02358254);
call addParent("tim","buckley","loss@realemail.com","veryStrongPassw0rd",118254);
select * from parents;
do sleep(2);
-- this is how we add parents to the db notice how it automatically hashes
-- to create an ID based on the information
call addBadge("real badge","respond with placeholder evidence in <>");
call addBadge("test badge","do not respond with hello world");
select * from badge;
select * from students;
do sleep(3);
insert into students (studentID,fname,lname,bday,dayjoined,parentsID,groupID)values ((md5(concat('bobby','jones','EXTRaSTRONGPASSWORD'))),"bobby","jones",'2012-2-11',curdate(),'8e301d6e513165a9c0b6b9a2b10c8305','41');
insert into students (studentID,fname,lname,bday,dayjoined,parentsID,groupID) values(md5(concat('timothy','jones','EXTREMELYSTRONGPASSWORD')),"timothy","jones",'2002-2-11',curdate(),'8e301d6e513165a9c0b6b9a2b10c8305','41');
call addStudent("samantha","jones",'2019-2-11','8e301d6e513165a9c0b6b9a2b10c8305','superSTRONGPASSWORD');
call addStudent("tom","jones",'2012-2-11','8e301d6e513165a9c0b6b9a2b10c8305','superSTRONGPASSWORD');
CALL addstudent('ethan','buckley','2013-03-02','4a85f9d4254038c83c3fc4f9b02b9619','weakpassword');
CALL addstudent('tibalt','buckley','2014-03-02','4a85f9d4254038c83c3fc4f9b02b9619','password');
call viewstudent('');
insert into sessiongroup values('41',5);
call viewstudent('');
do sleep(5);
-- this adds some dummy data in for the db to use
-- some students have been inserted straight into the db without a SP
-- so it seems they have been part of this organisation for a while
-- this will be relevent when I add the students to a group and need students already
-- part of a group
call applytogroup('4208a177bd0e3e81b682640e2c8078dd','41',5);
call addVolunteer("timothy","jones",'bob@bbc.co.uk','8e301d6e513165a9c0b6b9a2b10c8305',"0777008913");
call applytogroup('b6e14bcdd6a79c8f8cd9fcef3be5f00b', '41',5);
call applytogroup('7bd99d2efd6611161736f780a042f978','41',5);
do sleep(1);
-- 2 people were already in the group and 4 students have applied
-- tom jones was added last so he will be the one who will have to miss out
-- (tom's hashed id starts with 031f)
call applytogroup('031f0ba110c9683bf4cf5d2836b32a95',41,5);
call updateSG('419fd9859978a9bf79df4ff16c99c5f9',"2010-04-09");
call updateDBS('419fd9859978a9bf79df4ff16c99c5f9',"2021-09-09");
call viewCheckExpiries();
-- hmmm it appears volunteer tim doesn't have a valid sg check
--
call updateSG('419fd9859978a9bf79df4ff16c99c5f9',"2023-04-04");
-- now its valid
do sleep(2);
call addSession("computer lab",4,'419fd9859978a9bf79df4ff16c99c5f9','2023-02-03',5,'41');
call ReviewSession(md5('2023-02-03'),"it was ok","idk");
-- this is creating sessions and adding students and volunteers to the session
call addSession("computer lab",3,'419fd9859978a9bf79df4ff16c99c5f9','2023-01-03',5,'41');
call ReviewSession(md5('2023-01-03'),"it was ok","idk");
call addSession("computer lab",3,'419fd9859978a9bf79df4ff16c99c5f9','2022-11-03',5,'41');
call addSession("computer lab",13,'419fd9859978a9bf79df4ff16c99c5f9','2023-04-16',5,'41');
CALL STUDENTATTENDS('0ad073b3372ad0c243e6d465a2318568','94b21f931d888fefd4da7a07c01dff4a');
call studentattends('313b6d9a06c3a0618f72ec75c082b6a4','94b21f931d888fefd4da7a07c01dff4a');
call viewVolunteer('');
-- time volunteer has spent has been calculated from
do sleep(3);
select * from students;
do sleep(3);
call viewCheckExpiries();
call addToGroup('41');
do sleep(3);
-- you can see that tom jones is the only one not added as he joined the list last
select * from waitlist;
select * from students;
call StudentBadgeApply( '0ad073b3372ad0c243e6d465a2318568','fb635b87d668b2bbcc6a0b0a2f6adc32','<placeholder evidence that is what is needed>');
call StudentBadgeApply( '0ad073b3372ad0c243e6d465a2318568','fc1c7ce79f0265dd918c07588166cd03','hello world (incorrect)');
-- bobby jones with hash id of 0ad is applying for a badge
-- with the correct evidence to sign them off
call viewbadges('0ad073b3372ad0c243e6d465a2318568');
-- hmm it seems its pending
do sleep(3);
call volunteerviewbadges();
do sleep(3);
call badgeapprove('1ab31562f157f8489ae45bb767cbad43','419fd9859978a9bf79df4ff16c99c5f9',1);
call badgeapprove( 'a360ea99016380d8ee67bdb4d9048004','419fd9859978a9bf79df4ff16c99c5f9',0);
-- the volunteer timothy jones is validating the student booby's application it is correct so he is approving ity
-- the second application is incorrect so it is being rejected
call viewbadges('0ad073b3372ad0c243e6d465a2318568');
-- as you can see the correct badge has been approved and incorrect one has been rejected
do sleep(3);
-- it is correctly approved
er1.png

318 KiB

er2 diagram.png

341 KiB

File added
File added