You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSERT INTO ENGINEER (NAME, EMAIL) VALUES ('Lucas', 'lucasgpc@gmail.com');
INSERT INTO ENGINEER (NAME, EMAIL) VALUES ('Gelson', 'gelson@gmail.com');
INSERT INTO ENGINEER (NAME, EMAIL) VALUES ('Tiago', 'tiago@gmail.com');
INSERT INTO ENGINEER (NAME, EMAIL) VALUES ('Neymar', 'njr@gmail.com');
INSERT INTO METRIC_CODE (CODE, VALUE) VALUES ('MEMORY_USAGE','Memory usage is higher than normal');
INSERT INTO METRIC_CODE (CODE, VALUE) VALUES ('STORAGE_LIMIT','The storage is almost full');
INSERT INTO TEAM (NAME, METRIC_CODE) VALUES ('Memory Usage Team', 'MEMORY_USAGE');
INSERT INTO TEAM (NAME, METRIC_CODE) VALUES ('Storage Limit Team', 'STORAGE_LIMIT');
UPDATE ENGINEER SET TEAM_ID = 1 WHERE ENGINEER_ID IN (1,2);
UPDATE ENGINEER SET TEAM_ID = 2 WHERE ENGINEER_ID IN (3,4);
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (1, 'MONDAY', '08:00:00', '18:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (1, 'WEDNESDAY', '08:00:00', '18:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (1, 'FRIDAY', '08:00:00', '18:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (2, 'TUESDAY', '07:00:00', '17:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (2, 'THURSDAY', '07:00:00', '17:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (3, 'SATURDAY', '08:00:00', '12:00:00');
INSERT INTO AGENDA (ENGINEER_ID, WEEK_DAY, START_TIME, END_TIME) VALUES (4, 'SUNDAY', '14:00:00', '00:00:00');
Queries
-- Get engineer engineer agenda
SELECT * FROM AGENDA WHERE ENGINEER_ID = 1;
-- Get team responsible for the specific metric
SELECT * FROM TEAM WHERE METRIC_CODE = 'MEMORY_USAGE';
-- Get engineers list from the specific team or even by metric code
SELECT * FROM ENGINEER WHERE TEAM_ID = 1;
SELECT * FROM ENGINEER JOIN TEAM WHERE METRIC_CODE = 'MEMORY_USAGE';