0% found this document useful (0 votes)
38 views

Inventory DB

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Inventory DB

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Postgres

Inventory DB

CREATE DATABASE inventory;

CREATE TABLE Employee(


inventory(# emp_id INT PRIMARY KEY NOT NULL,
inventory(# emp_fname VARCHAR(100) NOT NULL,
inventory(# emp_lname VARCHAR(100) NOT NULL,
inventory(# password VARCHAR(100) NOT NULL,
inventory(# emp_type VARCHAR(100) NOT NULL,
inventory(# emp_dept VARCHAR(100) NOT NULL);

CREATE TABLE Equip_status(


inventory(# Equip_status_id INT PRIMARY KEY NOT NULL,
inventory(# Equip_status_detail VARCHAR(500) NOT NULL);

CREATE TABLE Equip_type(


inventory(# Equip_type_id INT PRIMARY KEY NOT NULL,
inventory(# Equip_type_detail VARCHAR(500) NOT NULL);

CREATE TABLE equip_fund(


inventory(# Equip_fund_id INT PRIMARY KEY NOT NULL,
inventory(# Equip_fund_detail VARCHAR(500) NOT NULL);

CREATE TABLE Emp_dept(


inventory(# Emp_dept_id INT PRIMARY KEY NOT NULL,
inventory(# Emp_dept_name VARCHAR(500) NOT NULL,
inventory(# Emp_dept_date DATE NOT NULL,
inventory(# emp_id_dept INT REFERENCES Employee(emp_id));

CREATE TABLE Equipment(


inventory(# equip_id INT PRIMARY KEY NOT NULL,
inventory(# equip_name VARCHAR(500) NOT NULL,
inventory(# fund_id INT REFERENCES equip_fund(equip_fund_id),
inventory(# type_id INT REFERENCES equip_type(equip_type_id),
inventory(# stat_id INT REFERENCES equip_status(equip_status_id));

employee
INSERT INTO employee(emp_id, emp_fname, emp_lname, password, emp_type) VALUES (1532,
'Emerald', 'Llunar', 'postgres', 'JO');
INSERT INTO employee(emp_id, emp_fname, emp_lname, password, emp_type) VALUES (1533, 'Carlo',
'Torres', 'Ctorres', 'Permanent');
INSERT INTO employee(emp_id, emp_fname, emp_lname, password, emp_type) VALUES (1535, 'Anna',
'Casais', 'Acasais', 'Permanent');
INSERT INTO employee(emp_id, emp_fname, emp_lname, password, emp_type) VALUES (1536,
'Jessica', 'Morales', 'Jmorales', 'Faculty');

Equip_fund
INSERT INTO equip_fund(equip_fund_id,Equip_fund_detail) VALUES (104,'From Internal Funding');
INSERT INTO equip_fund(equip_fund_id,Equip_fund_detail) VALUES (106,'From External Funding');
Equip_status
INSERT INTO equip_status(equip_status_id,equip_status_detail) VALUES (1,'Condemned');
INSERT INTO equip_status(equip_status_id,equip_status_detail) VALUES (2,'Returned');
INSERT INTO equip_status(equip_status_id,equip_status_detail) VALUES (3,'Working');

Equip_type
INSERT INTO equip_type(equip_type_id,equip_type_detail) VALUES (1,'Consumable');
INSERT INTO equip_type(equip_type_id,equip_type_detail) VALUES (2,'Semi-Expendable');
INSERT INTO equip_type(equip_type_id,equip_type_detail) VALUES (3,'Expensive');

Emp_dept

INSERT INTO emp_dept(emp_dept_id,emp_dept_name,emp_dept_date,emp_id_dept) VALUES (1, 'BU-


ICTO', '09-01-21','1534')
INSERT INTO emp_dept(emp_dept_id,emp_dept_name,emp_dept_date,emp_id_dept) VALUES (2, 'BU-
ICTO', '09-01-21','1532')

equipment
INSERT INTO equipment(equip_id, equip_name, fund_id, type_id, stat_id) VALUES (1,'Printer L-
Series134',104,2,3);

INSERT INTO equipment(equip_id, equip_name, fund_id, type_id, stat_id) VALUES (2,'Desktop


photocopier',104,3,3);

INSERT INTO equipment(equip_id, equip_name, fund_id, type_id, stat_id) VALUES (3,'Copy Bond
Paper',104,1,3);

INSERT INTO equipment(equip_id, equip_name, fund_id, type_id, stat_id) VALUES (5,'Aoc Computer
Monitor',106,2,3);

DELETE FROM table_name  WHERE condition;
NEW DATABASE (10/12/2021)

CREATE TABLE employee(


emp_id VARCHAR(100) PRIMARY KEY,
emp_fname VARCHAR(100) NOT NULL,
emp_lname VARCHAR(100) NOT NULL
);

CREATE TABLE user_tbl(


user_id SERIAL PRIMARY KEY,
user_password VARCHAR(100) NOT NULL,
user_emp_id VARCHAR(100) REFERENCES employee(emp_id)
);

CREATE TABLE item_fund(


item_fund_id SERIAL PRIMARY KEY,
item_fund VARCHAR(200) NOT NULL
);

CREATE TABLE item_type(


item_type_id SERIAL PRIMARY KEY,
item_type VARCHAR(200) NOT NULL
);

CREATE TABLE item_status(


item_status_id SERIAL PRIMARY KEY,
item_status VARCHAR(100) NOT NULL
);

CREATE TABLE item(


item_id SERIAL PRIMARY KEY,
item_code VARCHAR(100),
item_name VARCHAR(200) NOT NULL,
item_desc VARCHAR(5000) NOT NULL,
item_qty INT,
item_unt_of_msr VARCHAR(200),
supplier VARCHAR(1000),
item_fund_fk SERIAL REFERENCES item_fund(item_fund_id),
item_type_fk SERIAL REFERENCES item_type(item_type_id)
);

CREATE TABLE inventory(


inventory_id SERIAL PRIMARY KEY,
unit VARCHAR(100) NOT NULL,
date_acquire DATE NOT NULL,
amount VARCHAR(5000) NOT NULL,
inventory_qty INT NOT NULL,
inv_emp_id VARCHAR(100) REFERENCES employee(emp_id),
inv_item_id SERIAL REFERENCES item(item_id),
inv_item_stat_id SERIAL REFERENCES item_status(item_status_id)
);

CREATE TABLE emp_dept(


emp_dept_id SERIAL PRIMARY KEY,
department VARCHAR(100) NOT NULL,
dept_desc VARCHAR(500) NOT NULL
);
CREATE TABLE emp_desig(
emp_desig_id SERIAL PRIMARY KEY,
designation VARCHAR(100) NOT NULL
);

CREATE TABLE emp_details(


emp_det_id SERIAL PRIMARY KEY,
employment_date DATE NOT NULL,
emp_det_desig_id SERIAL REFERENCES emp_desig(emp_desig_id),
emp_det_dept_id SERIAL REFERENCES emp_dept(emp_dept_id),
emp_id_fk VARCHAR REFERENCES employee(emp_id),
emp_det_type_id SERIAL REFERENCES emp_type(emp_type_id)
);INSERT DATA:
EMPLOYEE:
INSERT INTO employee(emp_id, emp_fname, emp_lname, emp_type) VALUES ('2021-001-387',
'Emerald', 'Llunar', 'JO');
INSERT INTO employee(emp_id, emp_fname, emp_lname, emp_type) VALUES ('2021-001-004', 'Khune',
'Aguero', 'JO');
INSERT INTO employee(emp_id, emp_fname, emp_lname, emp_type) VALUES ('2021-001-001', 'Carlo',
'Torres', 'Permanent');
INSERT INTO employee(emp_id, emp_fname, emp_lname, emp_type) VALUES ('2021-001-002', 'Ana',
'Casais', 'Permannet');
INSERT INTO employee(emp_id, emp_fname, emp_lname, emp_type) VALUES ('2021-001-003', 'Jess',
'Morales', 'JO');

USER_TBL:
INSERT INTO user_tbl(user_password, user_emp_id) VALUES ('postgres','2021-001-387')
INSERT INTO user_tbl(user_password, user_emp_id) VALUES ('kaguero','2021-001-004')

FUND:
INSERT INTO item_fund(item_fund) VALUES ('101/ORS')
INSERT INTO item_fund(item_fund) VALUES ('164/BURS')

TYPE:
INSERT INTO item_type(item_type) VALUES('Supply')
INSERT INTO item_type(item_type) VALUES('IT Equipment')

ITEM:
INSERT INTO item(item_code,item_name, item_desc, item_qty, item_unt_of_msr, supplier,
item_fund_fk, item_type_fk)
VALUES ('P-001','Printer','L-Series134/ Black', 4, 'Per Piece', 'Denvers Computer Shoppe', 1, 1)

INSERT INTO item(item_code,item_name, item_desc, item_qty, item_unt_of_msr, supplier,


item_fund_fk, item_type_fk)
VALUES ('','Ballpoint','Faber-Castell Blue', 5, 'box', '', 1, 2)

INSERT INTO item(item_code,item_name, item_desc, item_qty, item_unt_of_msr, supplier,


item_fund_fk, item_type_fk)
VALUES ('Mntr-001','Computer Monitor','54.6 cm (21.5 inch) VA Panel Full HD Resolution I 250 Nits
Brightness I 178 / 178 View Angle', 3, 'Per Piece', 'Denvers Computer Shoppe', 1, 1)
INSERT INTO item(item_id,item_code,item_name, item_desc, item_qty, item_unt_of_msr, supplier,
item_fund_fk, item_type_fk)
VALUES (4,'','Battery','cylindrical batteries 10.5 mm (0.41 inch) in diameter and 44.5 mm (1.75 inch) in
length', 25, 'pair', 'CitiHardware', 1, 1)

SELECT item_name, inventory_qty, item_unt_of_msr, item_desc, date_acquire, amount, item_status,


CONCAT(emp_fname,' ', emp_lname)
FROM inventory, employee, item, item_status
WHERE employee.emp_id=inventory.inv_emp_id AND item.item_id=inventory.inv_item_id AND
item_status.item_status_id=inventory.inv_item_stat_id

Inventory:

INSERT INTO inventory(date_acquire, amount, inventory_qty, inv_emp_id, inv_item_id,


inv_item_stat_id)
VALUES ('2021-10-13', '6000', 1, '2021-001-002', 3,1)

INSERT INTO inventory(date_acquire, amount, inventory_qty, inv_emp_id, inv_item_id,


inv_item_stat_id)
VALUES ('2021-10-13', '12,000', 9, '2021-001-003', 3, 2)

INSERT INTO inventory(date_acquire, amount, inventory_qty, inv_emp_id, inv_item_id,


inv_item_stat_id)
VALUES ('2021-10-19', '10,000', 1, '2021-001-004', 1, 1)

INSERT INTO inventory(date_acquire, amount, inventory_qty, inv_emp_id, inv_item_id,


inv_item_stat_id)
VALUES ('2021-10-19', '3,000', 5, '2021-001-001', 2, 3)

INSERT INTO inventory(date_acquire, amount, inventory_qty, inv_emp_id, inv_item_id,


inv_item_stat_id)
VALUES ('2021-10-19', '1,000', 50, '2021-001-004', 4, 3)

EMP_DEPT:
INSERT INTO emp_dept(department, dept_desc)
VALUES ('ICTO', 'Information and Computer Office');

INSERT INTO emp_dept(department, dept_desc)


VALUES ('Supply', 'Supply Office');

INSERT INTO emp_dept(department, dept_desc)


VALUES ('Accounting', 'Accounting Office');

INSERT INTO emp_dept(department, dept_desc)


VALUES ('Registrar', 'Registrar Office');

INSERT INTO emp_dept(department, dept_desc)


VALUES ('Cashier', 'Cashier Office');

Emp_desig

INSERT INTO emp_desig(designation)


VALUES ('Computer Programmer');

INSERT INTO emp_Desig(designation)


VALUES ('Supply Officer');

INSERT INTO emp_desig(designation)


VALUES ('Accounting 1');

INSERT INTO emp_desig(designation)


VALUES ('Registrar 1');

INSERT INTO emp_desig(designation)


VALUES ('Cashier');

INSERT INTO emp_desig(designation)


VALUES ('Office Staff');

Emp_type:

INSERT INTO emp_type(emp_type)


VALUES('Permanent');

INSERT INTO emp_type(emp_type)


VALUES ('Job Order');

Emp_details:

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2021-09-01', 1, 1, '2021-001-387', 2);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2019-04-02', 6, 4, '2021-001-001', 2);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2015-10-05', 4, 4, '2021-001-002', 1);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2017-05-07', 5, 5, '2021-001-003', 1);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2020-04-07', 6, 1, '2021-001-004', 2);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2016-03-05', 3, 3, '2016-001-123', 1);

INSERT INTO emp_details(employment_date, emp_det_desig_id, emp_det_dept_id, emp_id_fk,


emp_det_type_id)
VALUES ('2010-07-05', 2, 2, '2010-001-144', 1);

3rd New database for inventory (11-08-21):

CREATE TABLE equipment(


Serial_no VARCHAR(500) PRIMARY KEY,
Equip_name VARCHAR(500) NOT NULL,
Equip_mfr VARCHAR(500) NOT NULL,
Equip_model VARCHAR(500) NOT NULL,
equip_wty DATE NOT NULL,
equip_life_ex INTEGER NOT NULL,
equip_supplier VARCHAR(500) NOT NULL,
equip_unt_msr VARCHAR(100) NOT NULL,
equip_ors_burs VARCHAR(500) NOT NULL,
equip_desc VARCHAR(1000) NOT NULL,
equip_qty INTEGER NOT NULL,
equip_amount INTEGER NOT NULL,
purchase_date DATE NOT NULL,
property_no VARCHAR(500) NOT NULL,
equip_con_fk SERIAL REFERENCES equip_condition(equip_con_id),
equip_cat_fk SERIAL REFERENCES equip_category(equip_cat_id),
equip_fund_id SERIAL REFERENCES item_fund(item_fund_id),
type_id SERIAL REFERENCES equip_type(equip_type_id),
equip_stat_fk SERIAL REFERENCES equip_status(equip_status_id),
prop_type_fk SERIAL REFERENCES property_type(prop_type_id),
equip_sup_id SERIAL REFERENCES item_supplier(supplier_id)
);
CREATE TABLE supply(
supply_id SERIAL PRIMARY KEY,
sup_name VARCHAR(500) NOT NULL,
sup_desc VARCHAR(1000) NOT NULL,
sup_unit_msr VARCHAR(100) NOT NULL,
Sup_ors_burs VARCHAR(500) NOT NULL,
sup_supplier VARCHAR(500),
sup_fund_id SERIAL REFERENCES item_fund(item_fund_id),
sup_qty_fk SERIAL REFERENCES supply_qty(sup_qty_id)

);

CREATE TABLE supply_qty(


sup_qty_id SERIAL PRIMARY KEY,
sup_qty INTEGER NOT NULL,
sup_qty_date DATE NOT NULL
);

CREATE TABLE equip_status(


equip_status_id SERIAL PRIMARY KEY,
equip_status VARCHAR(500) NOT NULL
);

CREATE TABLE equip_category(


equip_cat_id SERIAL PRIMARY KEY,
equip_category VARCHAR(500) NOT NULL
);

CREATE TABLE equip_condition(


equip_con_id SERIAL PRIMARY KEY,
equip_condition VARCHAR(500) NOT NULL
);

CREATE TABLE sup_inventory(


sup_inv_id SERIAL PRIMARY KEY,
sup_inv_qty INTEGER NOT NULL,
sup_inv_date DATE NOT NULL,
sup_amount INTEGER NOT NULL,
sup_emp_id VARCHAR(100) REFERENCES employee(emp_id),
sup_id_fk SERIAL REFERENCES supply(supply_id)
);
CREATE TABLE equip_inventory(
equip_inv_id SERIAL PRIMARY KEY,
date_acquired DATE NOT NULL,
//equip_amount INTEGER NOT NULL,
//equip_con_fk SERIAL REFERENCES equip_condition(equip_con_id),
equip_id_fk VARCHAR(500) REFERENCES equipment(serial_no),
equip_emp_id VARCHAR(500) REFERENCES employee(emp_id),
equip_inv_stat_fk SERIAL REFERENCES equip_inv_status(inv_status_id)
);

CREATE TABLE equip_inv_status(


inv_status_id SERIAL PRIMARY KEY,
inv_status VARCHAR(500) NOT NULL
)

CREATE TABLE equip_type(


equip_type_id SERIAL PRIMARY KEY,
equip_type VARCHAR(500) NOT NULL
);

CREATE TABLE property_type(


prop_type_id SERIAL PRIMARY KEY,
prop_type VARCHAR(500) NOT NULL
);

INSERT DATA:

INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2021-001-387', 'Emerald', 'Llunar');


INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2021-001-004', 'Khun', 'Aguero');
INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2021-001-001', 'Carlo', 'Torres');
INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2021-001-002', 'Ana', 'Casais');
INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2021-001-003', 'Jess', 'Morales');
INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2016-001-123', 'Charmaine Grace',
'Cabria');
INSERT INTO employee(emp_id, emp_fname, emp_lname) VALUES ('2010-001-144', 'Agnes', 'Caro');

INSERT INTO equip_status(equip_status)


VALUES ('In Use');
INSERT INTO equip_status(equip_status)
VALUES ('In Storage');
INSERT INTO equip_status(equip_status)
VALUES ('Untraceable');
INSERT INTO equip_status(equip_status)
VALUES ('Out For Repair');
INSERT INTO equip_condition(equip_condition)
VALUES ('Good');
INSERT INTO equip_condition(equip_condition)
VALUES ('New');
INSERT INTO equip_condition(equip_condition)
VALUES ('Fair');
INSERT INTO equip_condition(equip_condition)
VALUES ('Poor');

SELECT * FROM equip_category

INSERT INTO equip_category(equip_category)


VALUES ('Laptop');
INSERT INTO equip_category(equip_category)
VALUES ('Keyboard');
INSERT INTO equip_category(equip_category)
VALUES ('Monitor');
INSERT INTO equip_category(equip_category)
VALUES ('Mouse');
INSERT INTO equip_category(equip_category)
VALUES ('Chair');
INSERT INTO equip_category(equip_category)
VALUES ('Laptop');
INSERT INTO equip_category(equip_category) VALUES ('Printer');
INSERT INTO equip_category(equip_category) VALUES ('UPS');

INSERT INTO equip_type(equip_type)


VALUES ('IT equipment');
INSERT INTO equip_type(equip_type)
VALUES ('Office equipment');

INSERT INTO property_type(prop_type)


VALUES ('Plant And Equipment');

INSERT INTO property_type(prop_type)


VALUES ('Semi-expendable');
INSERT INTO supply(Sup_name, sup_desc, sup_qty, sup_unit_msr, sup_ors_burs, sup_supplier,
sup_fund_id)
VALUES ('Copy Bond Paper', 'Hard Copy Bond Paper Sub.20 70gsm', 10, 'Ream', 'ORS NO. 02-101101-
2018-05-185 dtd 5-5-17','Procurement Service DBM',3);
INSERT INTO supply(Sup_name, sup_desc, sup_qty, sup_unit_msr, sup_ors_burs, sup_supplier,
sup_fund_id)
VALUES ('3-Ring Binder', 'Smarty 3 Ring Binder 2" thick D1000 A4 / LD100 Long', 20, 'Piece', 'ORS NO. 02-
101101-2020-05-114 dtd 6-3-20','Procurement Service DBM',3);
INSERT INTO supply(Sup_name, sup_desc, sup_qty, sup_unit_msr, sup_ors_burs, sup_supplier,
sup_fund_id)
VALUES ('Battery(AAA size)', 'cylindrical batteries 10.5 mm (0.41 inch) in diameter and 44.5 mm (1.75
inch) in length', 25, 'Piece', 'ORS NO. 02-101101-2020-05-114 dtd 6-3-20','Legazpi Jebson
Trading ',3);
INSERT INTO supply(Sup_name, sup_desc, sup_qty, sup_unit_msr, sup_ors_burs, sup_supplier,
sup_fund_id)
VALUES ('3-Ring Binder', 'Smarty 3 Ring Binder 2" thick D1000 A4 / LD100 Long', 20, 'Pair', 'ORS NO. 02-
101101-2019-01-021 dtd 1-24-19 ','Procurement Service DBM',3);
INSERT INTO supply(Sup_name, sup_desc, sup_qty, sup_unit_msr, sup_ors_burs, sup_supplier,
sup_fund_id)
VALUES ('Ballpoint', 'Faber-Castell Blue', 16, 'Box', 'ORS NO. 02-101101-2020-04-097 dtd 3-6-20
','Procurement Service DBM',3);

INSERT INTO equipment(serial_no, equip_name, equip_mfr, equip_model, equip_wty, equip_life_ex,


equip_supplier, equip_unt_msr, equip_ors_burs, equip_desc, equip_stat_fk,
equip_cat_fk, equip_con_fk, equip_fund_id, type_id,
equip_qty, equip_amount)
VALUES('BLC445799', 'HP 2000 Laptop', 'HP', 'Notebook 2000', '2022-11-10', 5, 'Denvers Computer
Shoppe Inc', 'Unit', 'ORS NO. 02-101101-2020-10-235 dtd 10-12-20',
'15.6-inch HD LED displays, HD webcam, and built-in mic', 6, 1, 2, 3, 1, 1, 9500)

Equip_inventory

INSERT INTO equip_inventory(date_acquired, equip_con_fk, equip_id_fk, equip_emp_id)


VALUES ('11-11-21', 1, 'AEZG5R00010', '2021-001-002' )

NEW equip and supply DB design

CREATE TABLE item_supplier(


supplier_id SERIAL PRIMARY KEY,
supplier_name VARCHAR(500) NOT NULL
);

CREATE TABLE equipment(


Serial_no VARCHAR(500) PRIMARY KEY,
Equip_name VARCHAR(500) NOT NULL,
Equip_mfr VARCHAR(500) NOT NULL,
Equip_model VARCHAR(500) NOT NULL,
equip_wty DATE NOT NULL,
equip_life_ex INTEGER NOT NULL,
equip_unt_msr VARCHAR(100) NOT NULL,
equip_ors_burs VARCHAR(500) NOT NULL,
equip_desc VARCHAR(1000) NOT NULL,
equip_qty INTEGER NOT NULL,
equip_amount INTEGER NOT NULL,
purchase_date DATE NOT NULL,
equip_cat_fk SERIAL REFERENCES equip_category(equip_cat_id),
equip_fund_id SERIAL REFERENCES item_fund(item_fund_id),
type_id SERIAL REFERENCES equip_type(equip_type_id),
equip_stat_fk SERIAL REFERENCES equip_status(equip_status_id),
equip_con_fk SERIAL REFERENCES equip_condition(equip_con_id),
equip_sup_id SERIAL REFERENCES item_supplier(supplier_id)
);

CREATE TABLE equip_inventory(


equip_inv_id SERIAL PRIMARY KEY,
date_acquired DATE NOT NULL,
equip_id_fk VARCHAR(500) REFERENCES equipment(serial_no),
equip_emp_id VARCHAR(500) REFERENCES employee(emp_id)
);

CREATE TABLE supply(


supply_id SERIAL PRIMARY KEY,
sup_name VARCHAR(500) NOT NULL,
sup_desc VARCHAR(1000) NOT NULL,
sup_init_qty INTEGER NOT NULL,
sup_unit_msr VARCHAR(100) NOT NULL,
Sup_ors_burs VARCHAR(500) NOT NULL,
sup_fund_id SERIAL REFERENCES item_fund(item_fund_id),
sup_supplier_id SERIAL REFERENCES item_supplier(supplier_id)
);

CREATE TABLE supply_qty(


sup_qty_id SERIAL PRIMARY KEY,
sup_qty INTEGER NOT NULL,
sup_qty_date DATE NOT NULL,
sup_id_qty SERIAL REFERENCES supply(supply_id)
);

INSERT INTO item_supplier(supplier_name)


VALUES ('Procurement Service DBM');

INSERT INTO item_supplier(supplier_name)


VALUES ('Denvers Computer Shoppe Inc');

INSERT INTO item_supplier(supplier_name)


VALUES ('Legazpi Jebson Trading');

INSERT INTO supply_qty(sup_qty, sup_qty_date, sup_id_qty)


VALUES (3, '2021-11-22', 1)
INSERT INTO equip_inv_status(inv_status) VALUES('Custodian');
INSERT INTO equip_inv_status(inv_status) VALUES('Transferred');
INSERT INTO equip_inv_status(inv_status) VALUES('Returned');

INSERT INTO equip_inventory(date_acquired, equip_id_fk, equip_emp_id, equip_inv_stat_fk)


VALUES ('2021-11-18', 'MNTR001', '2016-001-123', 1)

INSERT INTO equipment(serial_no, equip_name, equip_mfr, equip_model, equip_wty, equip_life_ex,


equip_unt_msr, equip_ors_burs, equip_desc, equip_qty,
equip_amount, purchase_date, property_no,
equip_con_fk, equip_cat_fk, equip_fund_id, type_id, equip_stat_fk, prop_type_fk,
equip_sup_id)
VALUES('ISF0D4005GPH MPIALA38','Lenovo Desktop
Computer','Lenovo','Lenovo A10','10/19/22','10','Unit','ORS NO. 02-164164-2021-19-
001dtd 10-19-21',
'LENOVO A10 520-221KL F0D4005GPH, 21.5" FGD
Display','1','34990','10/19/21','BUGASS-164-2021-15','1','11','4','1','6','1','2')

You might also like