Skip to content

Commit

Permalink
adding proper object labeling for tables
Browse files Browse the repository at this point in the history
  • Loading branch information
rdevans87 committed May 26, 2021
1 parent 4202146 commit 8e0352d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions employeeTracker.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ USE employeerTracker_db;
-- DATABASE SCHEMA CONTAINING THREE TABLES --

CREATE TABLE department (
id INT PRIMARY KEY AUTOINCREMENT
name VARCHAR(30) NOT NULL
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)


);

CREATE TABLE role(
id INT PRIMARY KEY AUTOINCREMENT
title VARCHAR(30) to hold role title
salary DECIMAL to hold role salary
department_id to hold reference to department role belongs to
id INT NOT NULL AUTO_INCREMENT
-- to hold role title --
title VARCHAR(30) NOT NULL,
-- to hold role salary --
salary DECIMAL NOT NULL,
-- to hold reference to department role belongs to --
department_id FOREIGN KEY REFERENCES department(id)
PRIMARY KEY (id)


);
Expand Down
6 changes: 3 additions & 3 deletions seed.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
USE employeeTracker_db;

INSERT INTO department,
name,
(name),

VALUES
('Sales'),
Expand All @@ -10,7 +10,7 @@ VALUES
('Development');

INSERT INTO role
title, salary, department_id
(title, salary, department_id),

VALUES
('Sales Manager', 60000, 1),
Expand All @@ -23,7 +23,7 @@ VALUES
('Development Associate', 80000, 4);

INSERT INTO
first_name, last_name, role_id, manager_id
(first_name, last_name, role_id, manager_id),

VALUES
('Mike', 'Miller', 1, 2),
Expand Down

0 comments on commit 8e0352d

Please sign in to comment.