Created
September 19, 2023 03:52
-
-
Save machinelearningplus/db0208295c30cf7d0b826b17a1c20109 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create the employees table | |
CREATE TABLE employees ( | |
employee_id INT PRIMARY KEY, | |
first_name VARCHAR(50), | |
last_name VARCHAR(50), | |
department_id INT | |
); | |
-- Insert sample data into the employees table | |
INSERT INTO employees (employee_id, first_name, last_name, department_id) | |
VALUES | |
(1, 'John', 'Doe', 1), | |
(2, 'Jane', 'Smith', 2), | |
(3, 'Bob', 'Johnson', 1), | |
(4, 'Alice', 'Williams', NULL); | |
-- Create the departments table | |
CREATE TABLE departments ( | |
department_id INT PRIMARY KEY, | |
department_name VARCHAR(50) | |
); | |
-- Insert sample data into the departments table | |
INSERT INTO departments (department_id, department_name) | |
VALUES | |
(1, 'HR'), | |
(2, 'IT'), | |
(3, 'Finance'); | |
-- Create the projects table | |
CREATE TABLE projects ( | |
project_id INT PRIMARY KEY, | |
project_name VARCHAR(100), | |
department_id INT | |
); | |
-- Insert sample data into the projects table | |
INSERT INTO projects (project_id, project_name, department_id) | |
VALUES | |
(101, 'Employee Training', 1), | |
(102, 'Database Upgrade', 2), | |
(103, 'Budget Analysis', 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment