Skip to content

Commit

Permalink
feat: tables update customer creditcard, support, email
Browse files Browse the repository at this point in the history
  • Loading branch information
We1337-alpha committed Mar 12, 2024
1 parent 1f39395 commit fb0217d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 40 deletions.
68 changes: 28 additions & 40 deletions database/customer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,49 +33,37 @@ CREATE TABLE `Transfer` (
FOREIGN KEY (`RecipientID`) REFERENCES `Customers`(`CustomerID`) ON DELETE CASCADE
);

-- Fake data for Customers table
INSERT INTO `Customers` (`FirstName`, `LastName`, `Email`, `PhoneNumber`, `Password`, `Address`, `City`, `State`, `ZipCode`, `Country`, `RegistrationDate`)
CREATE TABLE `CreditCard` (
`CreditCardID` INT PRIMARY KEY AUTO_INCREMENT,
`CustomerID` INT NOT NULL,
`CardNumber` VARCHAR(20) NOT NULL,
`CardHolderName` VARCHAR(100) NOT NULL,
`ExpirationDate` DATE NOT NULL,
`CVV` VARCHAR(4) NOT NULL,
`CreationDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (`CustomerID`) REFERENCES `Customers`(`CustomerID`) ON DELETE CASCADE
);

-- Inserting more fake data into Customers table
INSERT INTO Customers (FirstName, LastName, Email, PhoneNumber, Password, Address, City, State, ZipCode, Country, RegistrationDate)
VALUES
('John', 'Doe', '[email protected]', '123-456-7890', 'password123', '123 Main St', 'Anytown', 'CA', '12345', 'USA', '2022-01-01'),
('Jane', 'Smith', '[email protected]', '987-654-3210', 'securepass', '456 Oak St', 'Another City', 'NY', '54321', 'USA', '2022-02-15'),
('Bob', 'Johnson', '[email protected]', '555-123-4567', 'pass123', '789 Pine St', 'Somewhere', 'TX', '67890', 'USA', '2022-03-20'),
('Alice', 'Johnson', '[email protected]', '111-222-3333', 'pass123', '456 Oak St', 'Cityville', 'CA', '54321', 'USA', '2022-04-10'),
('Charlie', 'Davis', '[email protected]', '444-555-6666', 'securepass', '789 Pine St', 'Townsville', 'TX', '98765', 'USA', '2022-05-15'),
('John', 'Doe', '[email protected]', '123-456-7890', 'password123', '123 Main St', 'Anytown', 'CA', '12345', 'USA', '2022-01-01'),
('Jane', 'Smith', '[email protected]', '987-654-3210', 'securepass', '456 Oak St', 'Another City', 'NY', '54321', 'USA', '2022-02-15'),
('Bob', 'Johnson', '[email protected]', '555-123-4567', 'pass123', '789 Pine St', 'Somewhere', 'TX', '67890', 'USA', '2022-03-20'),
('Alice', 'Johnson', '[email protected]', '111-222-3333', 'pass123', '456 Oak St', 'Cityville', 'CA', '54321', 'USA', '2022-04-10'),
('Charlie', 'Davis', '[email protected]', '444-555-6666', 'securepass', '789 Pine St', 'Townsville', 'TX', '98765', 'USA', '2022-05-15');
('Alice', 'Johnson', '[email protected]', '111-222-3333', 'pass123', '789 Maple St', 'Villageton', 'Stateland', '67890', 'Countryland', '2022-03-01'),
('Bob', 'Miller', '[email protected]', '555-444-3333', 'secret123', '456 Pine St', 'Cityburg', 'Stateland', '45678', 'Countryland', '2022-04-01');

-- Inserting more fake data into Deposit table
INSERT INTO Deposit (CustomerID, Amount)
VALUES
(3, 1200.00),
(4, 800.75);

-- Fake data for Deposit table
INSERT INTO `Deposit` (`CustomerID`, `Amount`)
-- Inserting more fake data into Transfer table
INSERT INTO Transfer (CustomerID, RecipientID, RecipientName, PhoneNumber, Amount)
VALUES
(1, 1000.50),
(2, 500.25),
(3, 750.75),
(4, 1200.75),
(5, 800.50),
(6, 1000.50),
(7, 500.25),
(8, 750.75),
(9, 1200.75),
(10, 800.50);
(3, 4, 'Bob Miller', '555-444-3333', 300.00),
(4, 3, 'Alice Johnson', '111-222-3333', 150.00);

-- Fake data for Transfer table
INSERT INTO `Transfer` (`CustomerID`, `RecipientID`, `RecipientName`, `PhoneNumber`, `Amount`)
-- Inserting more fake data into CreditCard table
INSERT INTO CreditCard (CustomerID, CardNumber, CardHolderName, ExpirationDate, CVV)
VALUES
(1, 2, 'Jane Smith', '987-654-3210', 200.00),
(2, 3, 'Bob Johnson', '555-123-4567', 150.50),
(3, 1, 'John Doe', '123-456-7890', 300.25),
(4, 1, 'John Doe', '123-456-7890', 300.00),
(5, 2, 'Jane Smith', '987-654-3210', 150.25),
(1, 4, 'Alice Johnson', '111-222-3333', 200.50),
(2, 5, 'Charlie Davis', '444-555-6666', 100.75),
(6, 1, 'Jane Smith', '987-654-3210', 200.00),
(2, 7, 'Bob Johnson', '555-123-4567', 150.50),
(3, 1, 'John Doe', '123-456-7890', 300.25),
(10, 9, 'John Doe', '123-456-7890', 300.00),
(5, 2, 'Jane Smith', '987-654-3210', 150.25),
(9, 8, 'Alice Johnson', '111-222-3333', 200.50),
(2, 7, 'Charlie Davis', '444-555-6666', 100.75);
(3, '1111222233334444', 'Alice Johnson', '2025-05-01', '789'),
(4, '5555666677778888', 'Bob Miller', '2026-08-01', '012');
16 changes: 16 additions & 0 deletions database/email.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE `AdminEmail` (
`EmailID` INT PRIMARY KEY AUTO_INCREMENT,
`EmailUser` VARCHAR(255) NOT NULL,
`EmailSender` VARCHAR(255) NOT NULL,
`EmailReciver` VARCHAR(255) NOT NULL,
`EmailTitle` VARCHAR(255) NOT NULL,
`EmailMessage` VARCHAR(1000) NOT NULL,
`EmailTime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Inserting fake data into the AdminEmail table
INSERT INTO `AdminEmail` (`EmailUser`, `EmailSender`, `EmailReciver`, `EmailTitle`, `EmailMessage`)
VALUES
('[email protected]', 'John Doe', '[email protected]', 'Meeting Tomorrow', 'Hi Alice, Let\'s meet tomorrow at 2 PM to discuss the project.'),
('[email protected]', 'Mary Jones', '[email protected]', 'Important Update', 'Dear Bob, I wanted to inform you about the latest changes to the schedule. Please review the attached document.'),
('[email protected]', 'Admin User', '[email protected]', 'System Maintenance', 'Dear Users, We will be conducting system maintenance on Saturday from 10 PM to 2 AM. Expect some downtime during this period.');
26 changes: 26 additions & 0 deletions database/support.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE `Workers` (
`WorkerID` INT PRIMARY KEY AUTO_INCREMENT,
`FirstName` VARCHAR(50) NOT NULL,
`LastName` VARCHAR(50) NOT NULL,
`Email` VARCHAR(100) NOT NULL,
`Password` VARCHAR(100) NOT NULL,
`PhoneNumber` VARCHAR(20),
`Address` VARCHAR(255),
`City` VARCHAR(50),
`State` VARCHAR(50),
`ZipCode` VARCHAR(10),
`Country` VARCHAR(50),
`HireDate` DATE NOT NULL,
`Position` VARCHAR(50) NOT NULL,
`Salary` DECIMAL(15, 2) NOT NULL,
`SupervisorID` INT,
FOREIGN KEY (`SupervisorID`) REFERENCES `Workers`(`WorkerID`) ON DELETE SET NULL
);

-- Insert Fake Data
INSERT INTO Workers (`FirstName`, `LastName`, `Email`, `Password`, `PhoneNumber`, `Address`, `City`, `State`, `ZipCode`, `Country`, `HireDate`, `Position`, `Salary`, `SupervisorID`)
VALUES
('John', 'Doe', '[email protected]', 'password123', '123-456-7890', '123 Main St', 'Cityville', 'Stateville', '12345', 'Countryland', '2022-01-01', 'Manager', 60000.00, NULL),
('Jane', 'Smith', '[email protected]', 'securepass', '987-654-3210', '456 Oak St', 'Townsville', 'Stateville', '54321', 'Countryland', '2022-02-01', 'Developer', 55000.00, 1),
('Alice', 'Johnson', '[email protected]', 'pass123', '111-222-3333', '789 Maple St', 'Villageton', 'Stateland', '67890', 'Countryland', '2022-03-01', 'Analyst', 50000.00, 1),
('Bob', 'Miller', '[email protected]', 'secret123', '555-444-3333', '456 Pine St', 'Cityburg', 'Stateland', '45678', 'Countryland', '2022-04-01', 'Teller', 45000.00, 2);

0 comments on commit fb0217d

Please sign in to comment.