source: DML.sql

main
Last change on this file was dfe03b8, checked in by Ceyda <ceyda.huseini@…>, 23 hours ago

Initialize StockMaster project

  • Property mode set to 100644
File size: 2.5 KB
Line 
1TRUNCATE TABLE users, customer, category, supplier, product, warehouse,
2 sale, purchase_order, sale_item, purchase_order_item, warehouse_stock
3RESTART IDENTITY CASCADE;
4
5INSERT INTO users (username, password, full_name, email, role, is_active) VALUES
6('ceyda_admin', 'test123', 'Ceyda Huseini', 'ceyda@gmail.com', 'Admin', true),
7('test_admin', 'admin123', 'Admin User', 'admin@gmail.com', 'Admin', true);
8
9INSERT INTO customer (name, email, phone, address) VALUES
10('Ana Anevska', 'ana@email.com', '+1 555 123 456', '10 Liberty Ave, New York'),
11('Elena Dimitrievska', 'elena@email.com', '+1 555 987 654', '45 Broad Street, Chicago'),
12('Marko Markoski', 'marko@email.com', '+1 555 555 444', '22 Oak Drive, Los Angeles');
13
14INSERT INTO category (name, description) VALUES
15('IT Equipment', 'Computers, laptops and networking equipment'),
16('Office Furniture', 'Office furniture and supplies');
17
18INSERT INTO supplier (name, contact_person, phone, email, address) VALUES
19('Global Telecom', 'David Cole', '+1 555 100 000', 'contact@globaltelekom.com', '13 Commerce Blvd, New York'),
20('TechMart PC Store', 'Brian Jones', '+1 555 111 888', 'sales@techmart.com', 'Central Shopping Mall, Chicago'),
21('Office Pro Supplies', 'Anna Roberts', '+1 555 222 111', 'info@officepro.com', 'Industrial Zone, Los Angeles');
22
23INSERT INTO warehouse (name, location, capacity) VALUES
24('New York Central Warehouse', 'Industrial Zone, New York', 10000),
25('Chicago Distribution Center', 'West Road, Chicago', 4000);
26
27INSERT INTO product (name, description, sku, unit_price, reorder_level, category_id, supplier_id) VALUES
28('Dell 24" Monitor', 'Full HD IPS Monitor', 'DELL-24-IPS', 9500.00, 10, 1, 2),
29('HP 250 G8 Laptop', 'Core i5, 8GB RAM, 256GB SSD', 'HP-250-G8', 32000.00, 5, 1, 2),
30('Ergonomic Office Chair', 'Black leather, adjustable height', 'CHAIR-ERG-01', 6500.00, 15, 2, 3);
31
32INSERT INTO warehouse_stock (warehouse_id, product_id, quantity_on_hand) VALUES
33(1, 1, 45),
34(1, 2, 12),
35(2, 2, 5),
36(2, 3, 30);
37
38INSERT INTO sale (total_amount, user_id, customer_id, warehouse_id) VALUES
39(41500.00, 3, 1, 1),
40(6500.00, 3, 2, 2);
41
42INSERT INTO sale_item (sale_id, product_id, quantity, unit_price_at_sale) VALUES
43(1, 2, 1, 32000.00),
44(1, 1, 1, 9500.00),
45(2, 3, 1, 6500.00);
46
47INSERT INTO purchase_order (expected_delivery_date, status, supplier_id, warehouse_id) VALUES
48('2026-03-08', 'Pending', 2, 1),
49('2026-03-05', 'Confirmed', 3, 2);
50
51INSERT INTO purchase_order_item (po_id, product_id, quantity, unit_cost) VALUES
52(1, 2, 10, 28000.00),
53(2, 3, 20, 5000.00);
Note: See TracBrowser for help on using the repository browser.