Skip to content
Snippets Groups Projects
Commit bb16f889 authored by Rafi Zereselasie (raz070)'s avatar Rafi Zereselasie (raz070)
Browse files

New table in the database that hold positions and wages for those positions.

parent d8f3dbc8
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ create table Employees( ...@@ -12,7 +12,7 @@ create table Employees(
primary key (employee_ID) primary key (employee_ID)
); );
#INSERT INTO Employees (first_name,last_name,isManager,email,phoneNumber,wage) VALUES ('Admin', 'Admin',true,'none','0000000000',0.0); INSERT INTO Employees (first_name,last_name,isManager,email,phoneNumber,wage) VALUES ('Admin', 'Admin',true,'none','0000000000',0.0);
create table Shifts( create table Shifts(
shift_id INT NOT NULL auto_increment UNIQUE, shift_id INT NOT NULL auto_increment UNIQUE,
...@@ -20,7 +20,8 @@ create table Shifts( ...@@ -20,7 +20,8 @@ create table Shifts(
start_time INT, start_time INT,
end_time INT, end_time INT,
employee_ID INT, employee_ID INT,
availability boolean, position varchar(20),
availability boolean default false,
PRIMARY KEY (shift_id), PRIMARY KEY (shift_id),
FOREIGN KEY (employee_ID) REFERENCES Employees(employee_ID) FOREIGN KEY (employee_ID) REFERENCES Employees(employee_ID)
); );
...@@ -57,18 +58,28 @@ create table Availabilities( ...@@ -57,18 +58,28 @@ create table Availabilities(
foreign key (employeeID) references Employees(employee_ID) foreign key (employeeID) references Employees(employee_ID)
); );
create table Positions(
ID int not null auto_increment unique,
position varchar(20) not null unique,
wage float not null,
primary key (position)
);
insert into Positions (position, wage) values ("dishwasher", 12.50);
select * from Employees; delete from Positions where position='dishwasher';
select * from TimeOff; select * from Positions;
select * from Employees;
drop table Employees;
drop table Employees;
drop database ScheduleApp; drop database ScheduleApp;
update Shifts set availability=true where shift_id=5;
insert into TimeOff (employeeID, startDate, endDate, approved, reason) values (3, "2022-03-17", "2022-03-17", true, "Vacation"); insert into TimeOff (employeeID, startDate, endDate, approved, reason) values (3, "2022-03-17", "2022-03-17", true, "Vacation");
update TimeOff set approved=true where ID=3 update TimeOff set approved=true where ID=3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment