Database
This commit is contained in:
85
Petstoredata.sql
Normal file
85
Petstoredata.sql
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
DROP DATABASE IF EXISTS Petstoredb;
|
||||
CREATE DATABASE Petstoredb;
|
||||
USE Petstoredb;
|
||||
|
||||
INSERT INTO store_location (store_name, address, phone, email)
|
||||
VALUES
|
||||
('Downtown Branch', '123 Main St', '123-456-7890', 'downtown@petshop.com'),
|
||||
('North Branch', '456 North Ave', '987-654-3210', 'north@petshop.com');
|
||||
|
||||
|
||||
|
||||
INSERT INTO employee (first_name, last_name, email, phone, role, is_active)
|
||||
VALUES
|
||||
('John', 'Doe', 'john@petshop.com', '111-222-3333', 'Manager', TRUE),
|
||||
('Sara', 'Smith', 'sara@petshop.com', '444-555-6666', 'Staff', TRUE);
|
||||
|
||||
INSERT INTO employee_store (employee_id, store_id)
|
||||
VALUES
|
||||
(1, 1),
|
||||
(2, 1),
|
||||
(2, 2);
|
||||
|
||||
INSERT INTO customer (first_name, last_name, email, phone)
|
||||
VALUES
|
||||
('Alex', 'Brown', 'alex@gmail.com', '777-888-9999'),
|
||||
('Emily', 'Clark', 'emily@gmail.com', '666-555-4444');
|
||||
|
||||
INSERT INTO pet (pet_name, pet_species, pet_breed, pet_age, pet_status, pet_price)
|
||||
VALUES
|
||||
('Buddy', 'Dog', 'Labrador', 2, 'Available', 500.00),
|
||||
('Milo', 'Cat', 'Persian', 1, 'Available', 300.00);
|
||||
|
||||
INSERT INTO adoption (pet_id, customer_id, adoption_date, adoption_status)
|
||||
VALUES
|
||||
(1, 1, '2026-01-15', 'Completed');
|
||||
|
||||
INSERT INTO supplier (sup_company, sup_contact_first_name, sup_contact_last_name, sup_email, sup_phone)
|
||||
VALUES
|
||||
('PetFood Inc', 'Robert', 'King', 'contact@petfood.com', '888-111-2222');
|
||||
|
||||
INSERT INTO category (category_name, category_type)
|
||||
VALUES
|
||||
('Dog Food', 'Product'),
|
||||
('Cat Toys', 'Product');
|
||||
|
||||
INSERT INTO product (prod_name, prod_sku, prod_price, category_id, prod_desc)
|
||||
VALUES
|
||||
('Premium Dog Food', 'DF001', 50.00, 1, 'High quality dog food'),
|
||||
('Cat Toy Ball', 'CT001', 10.00, 2, 'Colorful toy for cats');
|
||||
|
||||
INSERT INTO product_supplier (sup_id, prod_id)
|
||||
VALUES
|
||||
(1, 1),
|
||||
(1, 2);
|
||||
|
||||
INSERT INTO inventory (prod_id, quantity)
|
||||
VALUES
|
||||
(1, 100),
|
||||
(2, 200);
|
||||
|
||||
INSERT INTO service (service_name, service_desc, service_duration, service_price)
|
||||
VALUES
|
||||
('Pet Grooming', 'Full grooming service', 60, 40.00);
|
||||
|
||||
INSERT INTO appointment (service_id, customer_id, appointment_date, appointment_time, appointment_status)
|
||||
VALUES
|
||||
(1, 2, '2026-02-01', '10:30:00', 'Booked');
|
||||
|
||||
INSERT INTO appointment_pet (appointment_id, pet_id)
|
||||
VALUES
|
||||
(1, 2);
|
||||
|
||||
INSERT INTO sale (sale_date, total_amount, payment_method, employee_id, store_id)
|
||||
VALUES
|
||||
(NOW(), 60.00, 'Card', 2, 1);
|
||||
|
||||
INSERT INTO sale_item (sale_id, prod_id, quantity, unit_price)
|
||||
VALUES
|
||||
(1, 2, 2, 10.00);
|
||||
|
||||
INSERT INTO activity_log (employee_id, activity)
|
||||
VALUES
|
||||
(1, 'Created new sale'),
|
||||
(2, 'Booked appointment');
|
||||
Reference in New Issue
Block a user