Seeding a Database

Inserts

Inserts

INSERT Teacher Record

INSERT INTO curriculeon.teachers (first_name, last_name, specialty) VALUES
  ('John', 'Smith', 'FRONT END');

Inserts

INSERT INTO curriculeon.teachers (first_name, last_name, specialty) VALUES
    ('Tabitha', 'Schultz', 'MIDDLE TIER'),
    ('Jane', 'Herman', 'DATA TIER');

Inserts

INSERT INTO curriculeon.teacher_meta (teacher_id, years, room_number) VALUES
  (1, 3, 2),
  (2, 3, 2),
  (3, 10, 1);
INSERT INTO curriculeon.students (name, classroom, notes) VALUES
  ('Linnell McLanachan', '1A', 'Likes Data'),
	('Lorianna Henrion', '1A', 'Loves Data'),
	('Corena Edgeson', '1A', 'Cannot get enough of data'),
	('Archaimbaud Lougheid', '2A', 'Would rather do nothing other than sit down in front of a mountain of data and read through it like a book. SERIOUSLY needs to seek help about this because there is no way it is healthy for this person to like data any more than they do'),
	('Dun Pettet', '2A', NULL ),
	('Hymie Parrington', '2A', 'Enjoys the Star Wars prequels');

Inserts

INSERT INTO curriculeon.assignments (name, URL, teacher_id) VALUES
  ('Learner Lab', 'https://github.com/curriculeon/maven_learnerlab', 3),
  ('Dice And Bin', 'https://github.com/curriculeon/maven.diceandbin', 3),
  ('Spring React Template', 'https://github.com/curriculeon/spring.react_projecttemplate', 2);
INSERT INTO curriculeon.assignment_student (assignment_id, student_id) VALUES 
    (1, 1), (1, 2), (1,3), (1,4), (1,5), (1,6), (2, 1);

Updates

Updates

UPDATE curriculeon.teacher_meta
SET years = years+1;

Stored Procedures

CREATE PROCEDURE curriculeon.increment_years_experience ()
BEGIN
  UPDATE curriculeon.teacher_meta
    SET years = years+1;
END;