Commit 56026854 authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

adding sql for Lab 3 exercise/assessment

parent 18027778
DELETE FROM Account;
INSERT INTO Account (username,password,email,firstname,lastname) VALUES ('kyuji275','$2a$12$CuR0YSM0K1HFfhbC41EsFeL41coGKHcgpEgdiVNcmcqIHcKBVtyJ6','kyuji275@yahoo.net','Kamal','Yuji'),
('unorr459','$2a$12$C3PgVS8Wd6RDiomTrPbfm.G4nWGMz9shrnxbqjAe.Xdhk//PbHVGC','unorr459@lycos.me','Usman','Norris'),
('vsamp562','$2a$12$A2uXxTx6Du/WSf9wFhdJ9uvK6LgTSSWuINyIPn9DQWjQnX.QdiudK','vsamp562@lycos.net','Vivian','Sampson'),
('fzufi529','$2a$12$p4.SVBof7xb2CKtYA4jg0e2kZfujPUyzGZ/j5lMVuabuiKwL7Vdb.','fzufi529@lycos.co.uk','Faizan','Zufi'),
('pyuji031','$2a$12$OEo1/8zIIyt5rwQn4TzizOJYppoUjYFRJptaq43VUJx.Rwn5llSXa','pyuji031@virgin.me','Peter','Yuji'),
('bmorr050','$2a$12$QOxQIWrn6rmetiyVGWm75OWRDX328mpA6TpLphy6GqGraSC07JTca','bmorr050@live.me','Bevis','Morris'),
('lolde458','$2a$12$0EwG6LdXedVp/tbosUngkODkJQt/UsUDfOKreha75pBmp9G/lr5Py','lolde458@yahoo.me','Lara','Oldershaw'),
('danno169','$2a$12$ccfVEmgLJiNi6FIMWgUcSuUAWuBFs/Syq1KwU9gGVUrCD4rXlwxku','danno169@gmail.me','Darnelle','Annova'),
('qrape023','$2a$12$.1h3pO3HY7VuwKpU530gye.GfbAFtuN3jI1MkBcz38Mrqy7H5QXby','qrape023@live.me','Qatab','Raper'),
('hwill236','$2a$12$.SkaHtlGGnu98FwWgX03EewgDKuiKhvODyzmWjU1d7bubXzUrDc46','hwill236@live.net','Harold','Willis'),
('lmorr997','$2a$12$dR8UG.58mXnwK.RU41sAfOSVe6YsdK4looC7OuOt6SKp5Drm1OuTS','lmorr997@lycos.com','Lara','Morris'),
('pcamu705','$2a$12$IV.EzCnuZer0.0NSTdcHx.CPv4BeHj7Xf0kQVQxlnZCFYZi0Dawpu','pcamu705@gmail.co.uk','Prashant','Camus'),
('htyso841','$2a$12$o4UdP.gTFSoSdr1g.GH/r.a1XDJlfX2tU9F.qKVnMYUz0/vwbxYDm','htyso841@gmail.com','Harpreet','Tyson'),
('njone721','$2a$12$6GxfcNIRH2MfErGSZ0GDA.AV.zHfTB8ZUOOHaLL5ewrxSiPXe3CO2','njone721@hotmail.me','Nana','Jones'),
('pquar294','$2a$12$cHYb0rrZbNgXSuxg1h.ise3j4fVcbEKowqYn/TNsCegaMH0tVQtXi','pquar294@live.com','Pierre','Quartermain'),
('dmort777','$2a$12$vPrOpFHrHU6lkjkX3TxRaekzirmJzHq5sbEbZMg49FCqvQp3ksnOq','dmort777@lycos.co.uk','Daniel','Morton'),
('ntyso427','$2a$12$HWidpM8p5.VYNT5pbgfK3uRtKZJrgdJAuFU09q1uX4x31SETsdAO.','ntyso427@yahoo.net','Neal','Tyson'),
('vkorn510','$2a$12$X7d0J4ce9/i6uDFtADgHHOZ3mI0YMxA.OsCYQFObaD/ZPIqNDV4e2','vkorn510@virgin.me','Vaughn','Kornikova'),
('selto403','$2a$12$E/CLJ5FXBYg76ayRclqK8Ot7nsUSRgH/gA5vm5a5aOvVkhU4w0XMi','selto403@btconnect.co.uk','Solomon','Elton'),
('wmort661','$2a$12$n/yJpBYpcM.5kF1DOY2HkOnihv8kzvsX7iBrZ08E4AAZLXPh9.GvS','wmort661@btconnect.co.uk','Wilton','Morton'),
('fditt584','$2a$12$3ASlD//EYr87EMwd3innvuSG/rkdeZMxckpWCkLkl1bIfnXGaROse','fditt584@live.net','Faizan','Ditto'),
('vnorr082','$2a$12$mdPhjuJxMA1kjiorh0BTL.Ndv6SXMpOV2HgRMV1OKQVRv13QcnDUq','vnorr082@btconnect.net','Vaughn','Norris'),
('zvand205','$2a$12$7OudsBd8a9AcS29t38UeFuD7l/M9eCq6/ZXry9559TK/JVGTUEMgi','zvand205@hotmail.me','Zebedee','Vanderkamp'),
('uyuji152','$2a$12$p9kKrrqeaTvqrAjUzARLmuVjSWf7KrogBTKo2ukf6jvKM8ZlX2xme','uyuji152@btconnect.me','Usman','Yuji'),
('duddi433','$2a$12$w0YIOB.JwVU9TMKpa2mQzuSsQRt8H2H4dlVUEAF.fzz3ER57BXz9.','duddi433@btconnect.net','Doris','Uddin'),
('wvand364','$2a$12$hYiSL.5lZ8y/B4B4PsQnuO6MpisJz0sw2VySmJcLjlFmCwNMjXs9S','wvand364@virgin.co.uk','Walid','Vanderkamp'),
('arape139','$2a$12$hh8rsD8y29OWUT97b3SgeuhlqUPHKuIbRE7X6pWoev3y3od0gd2rC','arape139@virgin.me','Asma','Raper'),
('rover760','$2a$12$21hlkLbGsS/Bivgv4MVoveX4Ncw3SwY4so7KQn4XFD/rwDMxNOGha','rover760@yahoo.me','Raphael','Overhill'),
('fzufi752','$2a$12$GKWB8LSSexSKDzy9QZVisOcXRxDU0by3Pyk8.sBbrA..q33bD/2/2','fzufi752@gmail.com','Fanny','Zufi'),
('ptyso630','$2a$12$IcP5EpEXu8kx//j1Te1FJO2/fjPh.ALw.BSmSBO8KRGC46q30CFte','ptyso630@yahoo.co.uk','Peter','Tyson'),
('bingl212','$2a$12$O/lyb0yIkIEYmwQ9/.ls9.CaSNACWTqrtqxRF3gsPHzHwYAmv2u7u','bingl212@btconnect.me','Bevis','Ingleby'),
('rcamu212','$2a$12$Z9jMRv1ysS/.xjdSRIHwf.mXY5nRHZV.B5wRSjJ1pmLTzko3QVEKO','rcamu212@btconnect.net','Rezwana','Camus'),
('wsmit131','$2a$12$Ya5u84mGuNp1oImkvo7FdOq17yYSLVLANd/J6xo8nd0GVyYyddVBi','wsmit131@gmail.net','Wilton','Smith'),
('ytyso900','$2a$12$SxLbn1qlx3Triep3pz3KAOST6o1RweJGv1PoWNbHjN2xzFfU51daG','ytyso900@gmail.co.uk','Yasser','Tyson'),
('ztyso976','$2a$12$cTg/p22UTSrnZOW2yhW6geXM4p/pWpnzbVcT4s4l5l/5zj3WCI9s.','ztyso976@virgin.net','Zachary','Tyson'),
('ozufi415','$2a$12$9egq1n3SzSnTqvYpJBZGAuLtgMqFGZoGK/06SQz5h9uepcHMAV8ZS','ozufi415@hotmail.com','Ophelia','Zufi'),
('ecamu962','$2a$12$OJZM0b7AB1hYBzEJQ0EEo.EZic5JD7cOsB8Az1W9AePCEkaNBIYgu','ecamu962@yahoo.co.uk','Ellie','Camus'),
('fjame316','$2a$12$pZKtluy2J1BoXiv67vNc6.4LLLbKKgVgupUBoF7dENopS0azcqmya','fjame316@lycos.co.uk','Faizan','Jameson'),
('jolde668','$2a$12$R.k5WO2DE/9dJ/qL72KPkulgas.KkkolXY4KY8HedB9LAah4urfTe','jolde668@lycos.net','Joel','Oldershaw'),
('gpete291','$2a$12$En3k2MYRgANlAEKcM1GSVe8nFoHB/4Cih8fkD5ApztUCfbwreqnhO','gpete291@hotmail.me','Grace','Peterson'),
('dharp528','$2a$12$WYOoTK/fL2N81a9j94B0VekPbcQTHjuadyDPdBnKRUJ23abp0Us4S','dharp528@hotmail.net','Doris','Harper'),
('jyuji881','$2a$12$36son3YgmIXjw8EPqwZpweyy6N3YuG05M1y6sQ/nXzty7lUa1Tu8W','jyuji881@hotmail.co.uk','Jarvis','Yuji'),
('qtyso303','$2a$12$hegvN.KOrK8ffqvXEXpCpefGjVIMAHCe8tBFE3lm4eGqHAM6ZvBhO','qtyso303@hotmail.co.uk','Qatab','Tyson'),
('eyuji565','$2a$12$buqx0eF3DwMqfQtrp.bzneXZG8WqRTs18BsbW34MocUjyH9m9mFB2','eyuji565@btconnect.net','Ervin','Yuji'),
('kuddi661','$2a$12$1JtbZ9ckWxczpbEiIQGIR.LLW/b2C3OLNZUADPK3hTNQ6ecozOdqi','kuddi661@live.com','Kobwena','Uddin'),
('epete535','$2a$12$5DEgKFoztMLT6CrZxf162u9Pv.rnZqwnsrpEeRS8i.V1KrfTayODm','epete535@btconnect.net','Edward','Peterson'),
('aelto759','$2a$12$2HFwc53BUlVDC59pKJVMsukb5wiSSzrmoSmDpG8CHOVMwxFKc1N7q','aelto759@yahoo.net','Andy','Elton'),
('plewi494','$2a$12$pJ/u6usMQ8NTOgpcuWk5zOHfSKnrzo.nPXYIolr5rqbtcTkTRtsPW','plewi494@gmail.co.uk','Prashant','Lewis'),
('vjame904','$2a$12$.6p4L1ap56ZMB3/.GnNemuh46NZ3pSQnIcRSjWtgsAKCXjxBJ1FfS','vjame904@lycos.com','Vivian','Jameson'),
('bsamp888','$2a$12$OR8eN7emAupZktyj5svmdOeEHChI7NtfS844NSRjId26k5E..mbBG','bsamp888@lycos.net','Bertrand','Sampson');
DELETE FROM FluckGiven;
INSERT INTO FluckGiven (account_id,serve_id) VALUES (48,22),
(5,82),
(26,30),
(39,84),
(31,29),
(15,59),
(34,75),
(2,58),
(34,18),
(15,32),
(47,86),
(25,36),
(49,89),
(45,88),
(39,19),
(1,95),
(31,33),
(23,20),
(17,27),
(23,61),
(21,70),
(13,20),
(28,97),
(48,64),
(13,86),
(5,48),
(9,7),
(14,2),
(32,40),
(27,66),
(13,30),
(44,28),
(19,74),
(39,73),
(24,21),
(41,8),
(38,73),
(39,30),
(26,37),
(11,97);
DROP TABLE IF EXISTS FluckGiven, MediaServe, Media, Account;
CREATE TABLE Account (
id INT AUTO_INCREMENT,
username VARCHAR(8) UNIQUE NOT NULL,
password CHAR(61) NOT NULL,
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
email VARCHAR(50) UNIQUE NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE Media (
id INT AUTO_INCREMENT,
img_url VARCHAR(100) UNIQUE,
alt_txt VARCHAR(50),
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE MediaServe (
id INT AUTO_INCREMENT,
media_id INT NOT NULL,
account_id INT,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
FOREIGN KEY (account_id)
REFERENCES Account (id),
FOREIGN KEY (media_id)
REFERENCES Media (id)
) ENGINE=InnoDB;
CREATE TABLE FluckGiven (
id INT AUTO_INCREMENT,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
account_id INT,
serve_id INT NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (account_id)
REFERENCES Account (id),
FOREIGN KEY (serve_id)
REFERENCES MediaServe (id)
) ENGINE=InnoDB;
DELETE FROM MediaServe;
INSERT INTO MediaServe (media_id,account_id) VALUES (13,2),
(7,47),
(16,21),
(20,38),
(9,13),
(14,9),
(10,23),
(8,45),
(12,49),
(10,24),
(16,15),
(11,11),
(12,1),
(13,22),
(18,48),
(5,13),
(19,48),
(10,38),
(9,13),
(11,20),
(13,33),
(1,28),
(1,7),
(5,20),
(6,20),
(16,4),
(7,38),
(6,48),
(11,4),
(16,26),
(3,2),
(19,22),
(13,14),
(15,9),
(15,31),
(17,22),
(10,3),
(7,6),
(14,1),
(14,8),
(8,35),
(2,15),
(19,5),
(16,35),
(1,22),
(14,5),
(2,13),
(2,48),
(1,28),
(5,41),
(7,14),
(4,31),
(8,35),
(9,25),
(5,27),
(2,18),
(5,21),
(13,31),
(19,10),
(14,14),
(17,47),
(14,31),
(1,16),
(2,46),
(10,2),
(11,27),
(12,29),
(5,6),
(2,46),
(9,33),
(8,21),
(7,28),
(17,24),
(10,22),
(4,20),
(19,43),
(16,8),
(8,5),
(10,10),
(3,15),
(7,13),
(6,12),
(9,4),
(3,45),
(3,20),
(2,27),
(6,15),
(2,23),
(11,39),
(15,18),
(11,7),
(10,29),
(8,29),
(1,26),
(14,27),
(2,20),
(9,10),
(1,28),
(8,11),
(12,12);
DELETE FROM Media;
INSERT INTO Media (img_url,alt_txt) VALUES ("https://pbs.twimg.com/media/DMvdd6gWkAAehPL.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvfNuCXUAAW4F1.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvE0hsXUAAs4pl.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvXMmRU8AACFWi.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvQbNAXcAAyTI8.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMviSSOVoAAZyy5.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMr4y9nXkAAWbB4.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvWP1PWsAA6lPP.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DE6JC4AU0AEFE6k.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvdFlhW0AA4x-S.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMr2cTxVQAAneAm.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvVQk5W4AAI5Ss.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMve8MtX0AEzX87.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvm75YWAAAsCDL.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMu6hT2WAAAjIdq.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvW43jUIAAwsar.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMnrbtNU8AEC6lY.jpg","Image related to 'kitten' scraped from Twitter"),
("https://pbs.twimg.com/media/DMvfUrrXUAEsGqa.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMveH-OWsAAPLP1.jpg","Image related to 'cat' scraped from Twitter"),
("https://pbs.twimg.com/media/DMrz1zmVwAAzIGR.jpg","Image related to 'kitten' scraped from Twitter");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment