CREATE DATABASE TUKOD_Firm
CREATE TABLE Tukod_firm (
CEO_ID INT AUTO_INCREMENT PRIMARY KEY,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
);
INSERT INTO Tukod_firm (
Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress, Address,
DateEmployed
VALUES
('Owner', 'Junah', ‘Yu’, 'Milca', 22, '+63-912-345-6789', ‘junahyumilca@gmail.com', ‘Balud Sta.
Margarita, Samar, PH', '2015-06-01'),
('Owner', 'Prime Jade', ‘Dulatre’, 'Bagallon', 50, '+63-915-678-4321', 'PrimeJade@tukodfirm.com',
‘Brgy. Tinambacan, Calbayog, PH', '2016-08-15'),
CREATE TABLE BoardOfDirectors (
CEO_ID INT,
BOD_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (CEO_ID) references Tukod_firm (CEO_ID)
);
INSERT INTO BoardOfDirectors (
CEO_ID, BOD_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
VALUES
(12, 12-1, 'Finance Director', 'Maria', 'Santos', 'Lopez', 35, '+63-915-678-4321',
'maria.lopez@tukodfirm.com', '456 Ortigas Center, Pasig, PH', '2016-08-15'),
(12, 12-2, 'Operations Director', 'Carlos', 'Reyes', 'Gonzales', 45, '+63-917-456-7890',
'carlos.gonzales@tukodfirm.com', '789 BGC, Taguig, PH', '2018-01-20'),
(12, 12-3, 'Technology & Information Director', 'Rafael', 'Torres', 'Santiago', 37, '+63-910-234-5678',
'rafael.santiago@tukodfirm.com', '234 Mandaluyong, PH', '2019-03-10'),
(12, 12-4, 'Legal Director', 'Ana', 'Martinez', 'Velasco', 28, '+63-916-345-9876',
'ana.velasco@tukodfirm.com', '567 QC, PH', '2020-07-05'),
(12, 12-5, 'Sales & Marketing Director', 'Miguel', 'Fernandez', 'Ramos', 38, '+63-918-567-4321',
'miguel.ramos@tukodfirm.com', '890 Manila, PH', '2021-09-15'),
(12, 12-6, 'Admin & HR Director', 'Lucia', 'Domingo', 'Castillo', 40, '+63-919-876-5432',
'lucia.castillo@tukodfirm.com', '345 Makati, PH', '2022-01-30');
CREATE TABLE FINANCE_Department (
BOD_ID INT,
FD_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references BoardOfDirectors (BOD_ID)
);
INSERT INTO FINANCE_Department (
BOD_ID, FD_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
VALUES
(’1’, ’1-1’, 'Finance_Manager', 'Elena', 'Reyes', 'Fernandez', 40, '+63-921-456-7890',
'elena.fernandez@tukodfirm.com', '123 Makati Ave, Makati, PH', '2018-06-15'),
CREATE TABLE Accounting (
FD_ID INT,
ACC_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (FD_ID) references BoardOfDirectors (FD_ID)
);
INSERT INTO Accounting (
FD_ID, ACC_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
(‘1-1’,’1-1-1’, 'Accounting_Manager', 'Daniel', 'Cruz', 'Santos', 35, '+63-922-345-6789',
'daniel.santos@tukodfirm.com', '456 BGC, Taguig, PH', '2019-09-10'),
CREATE TABLE PAYROLL_MANAGEMENT (
ACC_ID INT,
P_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (ACC_ID) references Accounting (ACC_ID)
);
INSERT INTO PAYROLL_MANAGEMENT (
ACC_ID, P_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
(‘1-1-1’,’1-1-1-1’, 'Payroll_Manager', 'Emanuell', 'Cruz', 'Detos', 37, '+63-922-455-6789',
'da’Emanel@tukodfirm.com', '456 BGC, Taguig, PH', '2024-09-10'),
CREATE TABLE PAYROLL (
P_ID VARCHAR(20) PRIMARY KEY,
EMPLOYEE_ID VARCHAR(20),
SALARY DECIMAL(10,2),
FOREIGN KEY (EMPLOYEE_ID) REFERENCES EMPLOYEES_HEADS(EmployeeID)
);
INSERT INTO PAYROLL (P_ID, EMPLOYEE_ID, SALARY)
VALUES
('1-1-1-1', '1', 150000.00),
('1-1-1-1', '2', 150000.00),
('1-1-1-1', '12-1', 100000.00),
('1-1-1-1', '12-2', 100000.00),
('1-1-1-1', '12-3', 100000.00),
('1-1-1-1', '12-4', 95000.00),
('1-1-1-1', '12-5', 95000.00),
('1-1-1-1', '12-6', 95000.00),
('1-1-1-1', '1-1', 85000.00),
('1-1-1-1', '1-1-1', 75000.00),
('1-1-1-1', '1-1-1-1', 65000.00),
('1-1-1-1', '1-1-1-2', 65000.00),
('1-1-1-1', '1-1-1-3', 60000.00),
('1-1-1-1', '2-1', 90000.00),
('1-1-1-1', '2-1-1', 120000.00),
('1-1-1-1', '2-1-1-1', 70000.00),
('1-1-1-1', '2-1-1-2', 70000.00),
('1-1-1-1', '2-1-1-3', 70000.00),
('1-1-1-1', '2-1-1-4', 70000.00),
('1-1-1-1', '2-1-1-5', 70000.00),
('1-1-1-1', '3-1', 85000.00),
('1-1-1-1', '3-2', 85000.00),
('1-1-1-1', '4-1', 90000.00),
('1-1-1-1', '4-2', 60000.00),
('1-1-1-1', '5-1', 80000.00),
('1-1-1-1', '5-2', 75000.00),
('1-1-1-1', '6-1, 1000)
('1-1-1-1', '6-1-1, 1000)
('1-1-1-1', '1-1', 60000.00),
('1-1-1-1', '2-1', 60000.00),
('1-1-1-1', '2-2', 60000.00),
('1-1-1-1', '2-3', 60000.00),
('1-1-1-1', '2-4', 60000.00),
('1-1-1-1', '1-1', 50000.00),
('1-1-1-1', '2-1', 45000.00),
('1-1-1-1', '3-1', 55000.00),
('1-1-1-1', '4-1', 50000.00),
('1-1-1-1', '5-1', 45000.00),
('1-1-1-1', '1-2', 55000.00),
('1-1-1-1', '2-2', 50000.00),
('1-1-1-1', '3-2', 45000.00),
('1-1-1-1', '4-2', 55000.00),
('1-1-1-1', '5-2', 50000.00),
('1-1-1-1', '1-3', 45000.00),
('1-1-1-1', '2-3', 55000.00),
('1-1-1-1', '3-3', 50000.00),
('1-1-1-1', '4-3', 45000.00),
('1-1-1-1', '5-3', 55000.00),
('1-1-1-1', '1-4', 50000.00),
('1-1-1-1', '2-4', 45000.00),
('1-1-1-1', '3-4', 55000.00),
('1-1-1-1', '4-4', 50000.00),
('1-1-1-1', '5-4', 45000.00);
CREATE TABLE EquipmentManagement (
ACC_ID INT,
EM_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (ACC_ID) references Accounting (ACC_ID)
);
INSERT INTO EquipmentManagement (
ACC_ID, EM_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
(‘1-1-1’,’1-1-1-2, 'Asset_Manager', 'Doniel', 'Dimango', 'Sinoos', 34, '+63-923-345-6789',
'Sinoos@tukodfirm.com', '456 BGC, Taguig, PH', '2019-09-10')
CREATE TABLE construction_equipment (
EM_ID INT,
equipment_id INT AUTO_INCREMENT PRIMARY KEY,
equipment_name VARCHAR(255) NOT NULL,
equipment_type VARCHAR(100),
brand VARCHAR(100),
purchase_date DATE,
condition VARCHAR(50),
price DECIMAL(10, 2),
status VARCHAR(50)
Foreign Key (EM_ID) references EquipmentManagement (EM_ID)
);
INSERT INTO construction_equipment (EM_ID, equipment_id, equipment_name, equipment_type,
brand, purchase_date, condition, price, status)
VALUES
(‘1-1-1-2’,’1’,'Backhoe Loader', 'Heavy machinery', 'John Deere', '2021-03-12', 'Used', 35000.00, 'In-use'),
(‘1-1-1-2’,’2’,'Road Roller', 'Heavy machinery', 'Volvo', '2018-06-25', 'Used', 25000.00, 'Available'),
(‘1-1-1-2’,’3’,'Scissor Lift', 'Material handling', 'Genie', '2022-07-30', 'New', 15000.00, 'In-use'),
(‘1-1-1-2',’4’,’Dump Truck', 'Heavy machinery', 'Mack', '2020-11-05', 'Used', 45000.00, 'Under
maintenance'),
(‘1-1-1-2’,’5’,'Tower Crane', 'Heavy machinery', 'Terex', '2019-04-17', 'Used', 150000.00, 'Available'),
(‘1-1-1-2’,’6’,'Welding Machine', 'Construction tools', 'Lincoln Electric', '2023-01-25', 'New', 2200.00,
'Available'),
(‘1-1-1-2’,’7’,'Generator', 'Construction tools', 'Honda', '2021-09-19', 'New', 5000.00, 'In-use'),
(‘1-1-1-2’,’8’,'Paver', 'Heavy machinery', 'Caterpillar', '2022-08-05', 'Used', 90000.00, 'In-use'),
(‘1-1-1-2’,’9’,'Tamping Rammer', 'Construction tools', 'Wacker Neuson', '2020-04-12', 'Used', 3500.00,
'Under maintenance'),
(‘1-1-1-2’,’10’,'Concrete Pump', 'Heavy machinery', 'Schwing', '2021-11-20', 'New', 70000.00, 'Available');
CREATE TABLE maintenance_schedule (
EM_ID INT,
maintenance_id INT AUTO_INCREMENT PRIMARY KEY,
equipment_id INT,
maintenance_date DATE,
maintenance_type VARCHAR(100),
description TEXT,
cost DECIMAL(10, 2),
next_scheduled_maintenance DATE,
status VARCHAR(50),
FOREIGN KEY (equipment_id) REFERENCES construction_equipment(equipment_id)
);
INSERT INTO maintenance_schedule (EM_ID, equipment_id, maintenance_date, maintenance_type,
description, cost, next_scheduled_maintenance, status)
VALUES
(‘1-1-1-2’, 1, 0'2023-12-10', 'Preventive', 'Oil change, hydraulic system check, filter replacement', 500.00,
'2024-12-10', 'Completed'),
(‘1-1-1-2’,2, '2023-08-15', 'Corrective', 'Engine repair, transmission issue fix', 1500.00, '2024-08-15',
'Completed'),
(‘1-1-1-2’,3, '2024-02-01', 'Preventive', 'Lubrication, electrical system check', 300.00, '2025-02-01',
'Completed'),
(‘1-1-1-2’,4, '2023-10-30', 'Corrective', 'Brakes repair, safety checks', 2000.00, '2024-10-30', 'Completed'),
(‘1-1-1-2’,5, '2024-01-05', 'Preventive', 'Full system inspection, crane arm check', 1200.00, '2025-01-05',
'Completed'),
(‘1-1-1-2’,6, '2023-11-10', 'Preventive', 'Battery check, inspection of lifting mechanisms', 400.00, '2024-
11-10', 'Completed'),
(‘1-1-1-2’,7, '2024-03-10', 'Corrective', 'Engine replacement, wiring fixes', 5000.00, '2025-03-10',
'Pending'),
(‘1-1-1-2’,8, '2023-09-05', 'Preventive', 'Track and hydraulic oil checks, filter replacement', 800.00, '2024-
09-05', 'Completed'),
(‘1-1-1-2’,9, '2023-07-20', 'Preventive', 'Tire check, system inspection', 300.00, '2024-07-20', 'Pending'),
(‘1-1-1-2’,10, '2024-01-15', 'Corrective', 'Pump valve replacement, motor check', 2200.00, '2025-01-15',
'Pending');
CREATE TABLE ProjectAccounting (
ACC_ID INT,
PA_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (ACC_ID) references Accounting (ACC_ID)
);
INSERT INTO ProjectAccounting (
ACC_ID, PA_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
)
(‘1-1-1’,’1-1-1-3’, 'Estimator', 'Doniel', 'Dimango', 'Sinoos', 34, '+63-923-345-6789',
'Sinoos@tukodfirm.com', '456 BGC, Taguig, PH', '2019-09-10'),
CREATE TABLE COSTING (
PA_ID INT,
project_id INT,
project_name VARCHAR(255) NOT NULL,
client_name VARCHAR(255),
cost_type VARCHAR(50), -- Material, Labor, Equipment, etc.
cost_description TEXT,
cost_amount DECIMAL(15, 2),
cost_date DATE,
labor_hours DECIMAL(10, 2) DEFAULT 0, -- Relevant only for labor costs
labor_rate DECIMAL(10, 2) DEFAULT 0, -- Relevant only for labor costs
material_quantity DECIMAL(10, 2) DEFAULT 0, -- Relevant only for materials
material_unit_price DECIMAL(15, 2) DEFAULT 0, -- Relevant only for materials
PRIMARY KEY (project_id, cost_type, cost_description, cost_date)
FOREIGN KEY (PA_ID) REFERENCES ProjectAccounting (PA_ID)
);
INSERT INTO COSTING
(PA_ID, project_id, project_name, client_name, cost_type, cost_description, cost_amount, cost_date,
labor_hours, labor_rate, material_quantity, material_unit_price)
VALUES
(‘1-1-1-3’’, 1, 'Downtown Office Tower', 'XYZ Enterprises', 'Material', 'Glass Facade Panels', 15000,
'2025-03-20', 72, 3000, 500, 50),
(‘1-1-1-3’’, 2, 'Downtown Office Tower', 'XYZ Enterprises', 'Labor', 'Masonry Work', 100000, '2025-03-
22', 200, 30.00, 0, 0),
(‘1-1-1-3’’, 3, 'City Mall Expansion', 'RetailCorp', 'Equipment', 'Forklift Rental', 1200.00, '2025-03-23', 0,
0, 0, 0),
(‘1-1-1-3’’, 4, 'City Mall Expansion', 'RetailCorp', 'Overhead', 'Project Management Fees', 5000.00,
'2025-03-24', 0, 0, 0, 0),
(‘1-1-1-3’’, 5, 'Suburban Housing Development', 'HomeBuild Ltd.', 'Contingency', 'Additional
Landscaping Costs', 1500.00, '2025-03-25', 0, 0, 0, 0);
CREATE TABLE Operations_Department (
BOD_ID INT,
OD_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references BoardOfDirectors (BOD_ID)
);
INSERT INTO Operations_Department (
BOD_ID, OD_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
VALUES
(‘’, ‘’, 'Operation Manager', 'Elana', 'Ramuelez', 'Fezo', 39, '+63-921-456-6890', 'Fezo@tukodfirm.com',
'123 Makati Ave, Makati, PH', '2019-06-15'),
CREATE TABLE Pre_Construction (
OD_ID INT,
PC_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (OD_ID) references Operations_Department (OD_ID)
Foreign Key (PA_ID) references ProjectAccounting (PA_ID)
);
CREATE TABLE Pre_Construction (
OD_ID INT,
C_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (OD_ID) references Operations_Department (OD_ID)
);
INSERT INTO Construction (
OD_ID, C_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
VALUES
(‘’,’’, 'Chief Operating Officer', 'Alice', 'L', 'Williams', 50, '555-9876', 'alice.williams@example.com', '101
Business Blvd, New York, NY', '2010-05-15'),
CREATE TABLE ENGINEERS (
C_ID INT,
ENGR_ID INT,
Project_ID,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (C_ID) references Construction (C_ID)
);
INSERT INTO ENGINEERS (C_ID, ENGR_ID, Project_ID, Position, FirstName, MiddleName, LastName, Age,
PhoneNumber, EmailAddress, Address, DateEmployed)
VALUES
(‘’, ‘’, 1, 'Civil Engineer', 'John', 'A', 'Doe', 30, '555-1234', 'john.doe@gmail.com', '123 Elm St, New York,
NY', '2018-05-01'),
(‘’,’’, 2, 'Civil Engineer', 'Emma', 'B', 'Taylor', 27, '555-2345', 'emma.taylor@ gmail.com', '456 Oak Rd,
New York, NY', '2019-02-15'),
(‘’,’’, 3, 'Civil Engineer', 'David', 'C', 'Smith', 33, '555-3456', 'david.smith@ gmail.com', '789 Pine Ave, Los
Angeles, CA', '2017-11-23'),
(‘’,’’, 4, 'Civil Engineer', 'Sophia', 'D', 'Jones', 29, '555-4567', 'sophia.jones@ gmail.com', '101 Maple St,
Chicago, IL', '2018-07-12'),
(‘’,’’, 5, 'Civil Engineer', 'Michael', 'E', 'Brown', 35, '555-5678', 'michael.brown@ gmail.com', '112 Birch
Rd, Dallas, TX', '2016-04-10');
CREATE TABLE FOREMAN (
C_ID INT,
FM_ID INT,
Project_ID,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (C_ID) references Construction (C_ID)
);
INSERT INTO FOREMAN (C_ID, FM_ID, Project_ID, Position, FirstName, MiddleName, LastName, Age,
PhoneNumber, EmailAddress, Address, DateEmployed)
VALUES
(‘’,’’,1, 'Foreman', 'James', 'A', 'Wilson', 40, '555-1234', 'james.wilson@example.com', '123 Elm St, New
York, NY', '2015-05-01'),
(‘’,’’,2, 'Foreman', 'Oliver', 'B', 'Martinez', 38, '555-2345', 'oliver.martinez@example.com', '456 Oak Rd,
New York, NY', '2016-03-15'),
(‘’,’’,3, 'Foreman', 'Liam', 'C', 'Garcia', 42, '555-3456', 'liam.garcia@example.com', '789 Pine Ave, Los
Angeles, CA', '2014-11-23'),
(‘’,’’,4, 'Foreman', 'Benjamin', 'D', 'Rodriguez', 45, '555-4567', 'benjamin.rodriguez@example.com', '101
Maple St, Chicago, IL', '2013-07-12'),
(‘’,’’,5, 'Foreman', 'Lucas', 'E', 'Hernandez', 37, '555-5678', 'lucas.hernandez@example.com', '112 Birch
Rd, Dallas, TX', '2017-02-10');
CREATE TABLE WORKERS (
C_ID INT,
WORKER_ID,
Project_ID,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (C_ID) references Construction (C_ID)
);
INSERT INTO WORKERS (C_ID, WORKER_ID, Project_ID, Position, FirstName, MiddleName, LastName,
Age, PhoneNumber, EmailAddress, Address, DateEmployed)
VALUES
("", "", 1, "Skilled", "Michael", "Andrew", "Johnson", 35, "9876543210", "michael.johnson@email.com",
"123 Main St, Cityville", "2023-06-15"),
("", "", 2, "Semi Skilled", "Robert", "William", "Smith", 40, "9876543211", "robert.smith@email.com",
"456 Oak St, Townsville", "2023-07-10"),
("", "", 3, "Welder", "James", "Edward", "Brown", 28, "9876543212", "james.brown@email.com", "789
Pine St, Villagetown", "2023-05-22"),
("", "", 4, "Skilled", "John", "Christopher", "Davis", 32, "9876543213", "john.davis@email.com", "159
Maple St, Suburbia", "2023-08-18"),
("", "", 5, "Semi Skilled", "David", "Joseph", "Wilson", 45, "9876543214", "david.wilson@email.com",
"753 Elm St, Metrocity", "2023-09-30"),
("", "", 1, "Welder", "Richard", "Daniel", "Martinez", 38, "9876543215", "richard.martinez@email.com",
"951 Birch St, Newtown", "2023-10-11"),
("", "", 2, "Skilled", "Charles", "Anthony", "Anderson", 29, "9876543216",
"charles.anderson@email.com", "852 Cedar St, Rivercity", "2023-11-25"),
("", "", 3, "Semi Skilled", "Joseph", "Henry", "Thomas", 37, "9876543217", "joseph.thomas@email.com",
"369 Walnut St, Hilltown", "2023-12-12"),
("", "", 4, "Welder", "Christopher", "Patrick", "Harris", 33, "9876543218", "chris.harris@email.com", "951
Spruce St, Lakeside", "2023-06-05"),
("", "", 5, "Skilled", "Matthew", "Steven", "Clark", 42, "9876543219", "matthew.clark@email.com", "123
Fir St, Baytown", "2023-07-19"),
("", "", 1, "Semi Skilled", "Daniel", "Michael", "Rodriguez", 31, "9876543220",
"daniel.rodriguez@email.com", "789 Cedar St, Downtown", "2023-08-22"),
("", "", 2, "Welder", "Paul", "Gregory", "Lewis", 36, "9876543221", "paul.lewis@email.com", "951
Chestnut St, Uptown", "2023-09-14"),
("", "", 3, "Skilled", "Mark", "Timothy", "Walker", 39, "9876543222", "mark.walker@email.com", "357
Hickory St, Greenfield", "2023-10-30"),
("", "", 4, "Semi Skilled", "Steven", "Francis", "Hall", 27, "9876543223", "steven.hall@email.com", "468
Redwood St, Sunnytown", "2023-11-18"),
("", "", 5, "Welder", "Kevin", "Raymond", "Allen", 34, "9876543224", "kevin.allen@email.com", "159
Hemlock St, Westville", "2023-12-21"),
("", "", 1, "Skilled", "Brian", "Nicholas", "Young", 30, "9876543225", "brian.young@email.com", "357
Mahogany St, Eastport", "2023-07-02"),
("", "", 2, "Semi Skilled", "Edward", "Samuel", "King", 41, "9876543226", "edward.king@email.com",
"753 Sycamore St, Southend", "2023-08-14"),
("", "", 3, "Welder", "George", "Vincent", "Wright", 26, "9876543227", "george.wright@email.com", "258
Larch St, Northgate", "2023-09-25"),
("", "", 4, "Skilled", "Donald", "Jeffrey", "Lopez", 35, "9876543228", "donald.lopez@email.com", "357
Teak St, Eastwood", "2023-10-12"),
("", "", 5, "Semi Skilled", "Ronald", "Howard", "Hill", 38, "9876543229", "ronald.hill@email.com", "468
Sequoia St, Oldtown", "2023-11-03"),
("", "", 1, "Welder", "Kenneth", "Alexander", "Scott", 29, "9876543230", "kenneth.scott@email.com",
"159 Cedar St, Beachside", "2023-12-05"),
("", "", 2, "Skilled", "Timothy", "Douglas", "Green", 33, "9876543231", "timothy.green@email.com", "753
Hickory St, Mountainview", "2023-06-07"),
("", "", 3, "Semi Skilled", "Jason", "Walter", "Adams", 40, "9876543232", "jason.adams@email.com",
"123 Fir St, Hillside", "2023-07-08"),
("", "", 4, "Welder", "Jeffrey", "Lawrence", "Baker", 36, "9876543233", "jeffrey.baker@email.com", "789
Maple St, Valleytown", "2023-08-19"),
("", "", 5, "Skilled", "Ryan", "Eric", "Nelson", 31, "9876543234", "ryan.nelson@email.com", "951 Pine St,
Seaside", "2023-09-22"),
("", "", 1, "Semi Skilled", "Gary", "Russell", "Carter", 45, "9876543235", "gary.carter@email.com", "357
Walnut St, Countryside", "2023-10-14"),
("", "", 2, "Welder", "Jacob", "Shawn", "Mitchell", 27, "9876543236", "jacob.mitchell@email.com", "258
Redwood St, Lakeview", "2023-11-28"),
("", "", 3, "Skilled", "Eric", "Dennis", "Perez", 32, "9876543237", "eric.perez@email.com", "468 Birch St,
Midtown", "2023-12-09"),
("", "", 4, "Semi Skilled", "Stephen", "Bryan", "Roberts", 39, "9876543238",
"stephen.roberts@email.com", "951 Chestnut St, Harborcity", "2023-06-23");
CREATE TABLE IT_DEPARTMENT (
BOD_ID INT,
IT_ID INT,
Assignment VARCHAR(50),
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references BoardOfDirectors (BOD_ID)
);
INSERT INTO IT_DEPARTMENT (
BOD_ID, IT_ID, Position, Assignment, FirstName, MiddleName, LastName, Age, PhoneNumber,
EmailAddress, Address, DateEmployed
VALUES
(‘’,’’, 'IT Manager, 'Mobile Pages', 'John', 'Arnaez', 'Doe', 30, '123-456-7890', 'johndoe@email.com', '123
Main St, City, Country', '2020-01-15'),
(‘’,’’,, 'IT Manager, 'Company Management Software', 'Jane', 'Bolatre', 'Smith', 28, '987-654-3210',
'janesmith@email.com', '456 Elm St, City, Country', '2021-03-22');
CREATE TABLE LEGAL_DEPARTMENT (
BOD_ID INT,
LD_ID INT,
Assignment VARCHAR(50),
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references LEGAL_DEPARTMENT (BOD_ID)
);
INSERT INTO LEGAL_DEPARTMENT (
BOD_ID, LD_ID, Position, Assignment, FirstName, MiddleName, LastName, Age, PhoneNumber,
EmailAddress, Address, DateEmployed
VALUES
(‘’,’’,'Legal Counsel', 'Contract Review', 'Alice', 'Malaha', 'Johnson', 35, '555-123-4567',
'alice.johnson@company.com', '789 Oak St, City, Country', '2018-06-01'),
(‘’,’’,'Legal Assistant', 'Compliance Documentation', 'Bob', 'Lobneton', 'Brown', 28, '555-987-6543',
'bob.brown@company.com', '321 Pine St, City, Country', '2020-11-15');
CREATE TABLE SALES_AND_MARKETING_DEPARTMENT (
BOD_ID INT,
SMD_ID INT,
Assignment VARCHAR(50),
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references LEGAL_DEPARTMENT (BOD_ID)
);
INSERT INTO SALES_AND_MARKETING_DEPARTMENT (
BOD_ID, SMD_ID, Position, Assignment, FirstName, MiddleName, LastName, Age, PhoneNumber,
EmailAddress, Address, DateEmployed
VALUES
(‘’,’’, 'Sales Manager', 'New Client Acquisition', 'Michael', 'T.', 'Davis', 40, '555-111-2233',
'michael.davis@company.com', '100 Business Ave, City, Country', '2015-03-10'),
(‘’,’’, 'Marketing Specialist', 'Advertising Campaigns', 'Sarah', 'P.', 'Miller', 32, '555-222-3344',
'sarah.miller@company.com', '200 Corporate Rd, City, Country', '2018-07-22');
CREATE TABLE HUMAN_RESOURCE_DEPARTMENT (
BOD_ID INT,
HR_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (BOD_ID) references LEGAL_DEPARTMENT (BOD_ID)
);
INSERT INTO HUMAN_RESOURCE_DEPARTMENT (
BOD_ID, HR_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
)
(‘’,’’, 'HR Manager', 'Mitel', 'Tan', 'David', 40, '555-111-2233', 'michael.davis@company.com', '100
Business Ave, City, Country', '2015-03-10'),
CREATE TABLE STAFFING_MANAGEMENT (
HR_ID INT,
S_ID INT,
Position VARCHAR(50),
FirstName VARCHAR(50),
MiddleName VARCHAR(50),
LastName VARCHAR(50),
Age INT,
PhoneNumber VARCHAR(13),
EmailAddress VARCHAR(50),
Address TEXT,
DateEmployed DATE,
Foreign Key (HR_ID) references HUMAN_RESOURCE_DEPARTMENT (HR_ID)
);
INSERT INTO STAFFING (
HR_ID, S_ID, Position, FirstName, MiddleName, LastName, Age, PhoneNumber, EmailAddress,
Address, DateEmployed
(‘’,’’, 'Staffing_Manager', 'Mila', 'Ampoan', 'Rameulez', 25, '555-212-1433', 'mila.ampoan@company.com',
'100 Business Ave, Calbayog City, Ph', '2020-03-10')
CREATE TABLE EMPLOYEES_HEADS (
EmployeeID INT PRIMARY KEY,
Position VARCHAR(50),
FirstName VARCHAR(50),
LastName VARCHAR(50),
Department VARCHAR(50),
Foreign Key references STAFFING
);
INSERT INTO EMPLOYEES_HEADS (EmployeeID, Position, FirstName, LastName, Department)
VALUES
(‘1’,'Owner', 'Junah', ‘Yu’, 'Milca', 'Tukod_Firm’),
('2’, ‘Owner', 'Prime Jade', ‘Dulatre’, 'Bagallon', 'Tukod_Firm”),
(‘12-1’, 'Finance Director', 'Maria', 'Santos', 'Lopez', ‘Board_of_Directors),
(‘12-2’, 'Operations Director', 'Carlos', 'Reyes', 'Gonzales', ‘Board_of_Directors),
(‘12-3’, 'Technology & Information Director', 'Rafael', 'Torres', 'Santiago', ‘Board_of_Directors),
(‘12-4’, 'Legal Director', 'Ana', 'Martinez', 'Velasco', ‘Board_of_Directors),
(‘12-5’, 'Sales & Marketing Director', 'Miguel', 'Fernandez', 'Ramos', ‘Board_of_Directors),
(‘12-6’, 'Admin & HR Director', 'Lucia', 'Domingo', 'Castillo', ‘Board_of_Directors),
(’1’, ’1-1’, 'Finance_Manager', 'Elena', 'Reyes', 'Fernandez', ‘Finance_Department’),
(’1-1’,’1-1-1’, 'Accounting_Manager', 'Daniel', 'Cruz', ‘Finance_Department’),
(’1-1-1’,’1-1-1-1’, 'Payroll_Manager', 'Emanuell', 'Cruz', 'Detos', ‘Finance_Department’),
(’1-1-1’,’1-1-1-2’, 'Asset_Manager', 'Doniel', 'Dimango', 'Sinoos', ‘Finance_Department’),
(‘1-1-1’,’1-1-1-3’, 'Estimator', 'Doniel', 'Dimango', 'Sinoos', ‘Finance_Department’),
(‘2-1’, ‘’, 'Operation Manager', 'Elana', 'Ramuelez', 'Fezo', ‘Operations’),
(’2-1’,’2-1-1’, 'Chief Operating Officer', 'Alice', 'L', 'Williams', ‘Operations’),
(‘2-1-1’, ‘2-1-1-1’, 'Civil Engineer', 'John', 'A', 'Doe', ‘Operations’),
(‘2-1-1’,’2-1-1-2’, 'Civil Engineer', 'Emma', 'B', 'Taylor', ‘Operations’),
(‘2-1-1’,’2-1-1-3’, 'Civil Engineer', 'David', 'C', 'Smith', ‘Operations’),
(‘2-1-1’,’2-1-1-4’, 'Civil Engineer', 'Sophia', 'D', 'Jones', ‘Operations’),
(‘2-1-1’,’2-1-1-5’, 'Civil Engineer', 'Michael', 'E', 'Brown', ‘Operations’),
(‘3’,’3-1’, 'IT Manager', 'Mobile Pages', 'John', 'Arnaez', 'Doe', ‘IT_Department’)
(‘3’,’3-2’,, 'IT Manager', 'Company Management Software', 'Jane', 'Bolatre', 'Smith', ‘IT_Department’)
(‘4’,’4-1’,'Legal Counsel', 'Alice', 'Malaha', 'Johnson', ‘Legal_Department),
(4‘’,’4-2’,'Legal Assistant', 'Bob', 'Lobneton', 'Brown', ‘Legal_Department),
(‘5’,’5-1’, 'Sales Manager', 'New Client Acquisition', 'Michael', 'T.', 'Davis',
‘Sales_And_Marketing_Department),
(‘5’,’5-2’, 'Marketing Specialist', 'Advertising Campaigns', 'Sarah', 'P.', 'Miller',
‘Sales_And_Marketing_Department),
(‘6’,’6-1’, 'HR Manager', 'Mitel', 'Tan', 'David', ‘HUMAN_RESOURCE_DEPARTMENT
‘),
(‘6-1’,’6-1-1’, 'Staffing_Manager', 'Mila', 'Ampoan', 'Rameulez', ‘HUMAN_RESOURCE_DEPARTMENT
‘),
CREATE TABLE WORKERS (
HEAD_ID INT,
WORKER_ID INT PRIMARY KEY,
Position VARCHAR(50),
FirstName VARCHAR(50),
LastName VARCHAR(50),
Department VARCHAR(50),
Foreign Key references STAFFING
);
INSERT INTO EMPLOYEES_HEADS (HEAD_ID, WORKER_ID, Position, FirstName, LastName, Department)
VALUES
(‘1’,’1-1’,’2-1-1’,'Foreman', 'James', 'A', 'Wilson', ‘Operations’),
(‘2’’,’2-1’,'Foreman', 'Oliver', 'B', 'Martinez', ‘Operations’),
(‘3’’,’2-2’, 'Foreman', 'Liam', 'C', 'Garcia', ‘Operations’),
(‘4’’,’2-3’, 'Foreman', 'Benjamin', 'D', 'Rodriguez', ‘Operations’),
(‘5’’,’2-4’, 'Foreman', 'Lucas', 'E', 'Hernandez', ‘Operations’),
("1", "1-1", "Skilled", "Michael", "Andrew", "Johnson", ‘Operations’),
("2", "2-1", "Semi Skilled", "Robert", "William", "Smith", ‘Operations’),
("3", "3-1", "Welder", "James", "Edward", "Brown", ‘Operations’),
("4", "4-1", "Skilled", "John", "Christopher", "Davis", ‘Operations’),
("5", "5-1", "Semi Skilled", "David", "Joseph", "Wilson", ‘Operations’),
("1", "1-2", "Welder", "Richard", "Daniel", "Martinez", ‘Operations’),
("2", "2-2", "Skilled", "Charles", "Anthony", "Anderson", ‘Operations’),
("3", "3-2", "Semi Skilled", "Joseph", "Henry", "Thomas", ‘Operations’),
("4", 4-2"", "Welder", "Christopher", "Patrick", "Harris", ‘Operations’),
("5", "5-2", "Skilled", "Matthew", "Steven", "Clark", ‘Operations’),
("1", "1-3" "Semi Skilled", "Daniel", "Michael", "Rodriguez", ‘Operations’),
("2", "2-3", "Welder", "Paul", "Gregory", "Lewis", ‘Operations’),
("3", "3-3”, "Skilled", "Mark", "Timothy", "Walker", ‘Operations’),
("4", "4-3”, "Semi Skilled", "Steven", "Francis", "Hall", ‘Operations’),
("5", "5-3”, "Welder", "Kevin", "Raymond", "Allen", ‘Operations’),
("1", "1-4", "Skilled", "Brian", "Nicholas", "Young", ‘Operations’),
("2", "2-4", "Semi Skilled", "Edward", "Samuel", "King", ‘Operations’),
("3", “3-4”, "Welder", "George", "Vincent", "Wright", ‘Operations’),
("4", "4-4”, "Skilled", "Donald", "Jeffrey", "Lopez", ‘Operations’),
("5", "5-4", "Semi Skilled", "Ronald", "Howard", "Hill", ‘Operations’)