Skip to content

Instantly share code, notes, and snippets.

@LiorB-D
Created September 9, 2024 16:20
Show Gist options
  • Save LiorB-D/f86e5176f3312156ad4534139ed191cf to your computer and use it in GitHub Desktop.
Save LiorB-D/f86e5176f3312156ad4534139ed191cf to your computer and use it in GitHub Desktop.
CREATE TABLE Buildings (Building_name VARCHAR(2) PRIMARY KEY, Capacity INTEGER);
CREATE TABLE Employees (Role TEXT, Name TEXT, Building VARCHAR(2), Years_employed SMALLINT, FOREIGN KEY (Building)
REFERENCES Buildings(Building_name));
INSERT INTO Buildings VALUES
('1e', 24), ('1w', 32), ('2e', 16), ('2w', 20);
INSERT INTO Employees VALUES
('Engineer', 'Becky A.', '1e', 4),
('Engineer', 'Dan B.', '1e', 2),
('Engineer', 'Sharon F.', '1e', 6),
('Engineer', 'Dan M.', '1e', 4),
('Engineer', 'Malcom S.', '1e', 1),
('Artist', 'Tylar S.', '2w', 2),
('Artist', 'Sherman D.', '2w', 8),
('Artist', 'Jakob J.', '2w', 6),
('Artist', 'Lillia A.', '2w', 7),
('Artist', 'Brandon J.', '2w', 7),
('Manager', 'Scott K.', '1e', 9),
('Manager', 'Shirlee M.', '1e', 3),
('Manager', 'Daria O.', '2w', 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment