SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE DATABASE WeddingPlanningDB; USE WeddingPlanningDB; CREATE TABLE Users ( ID INT AUTO_INCREMENT PRIMARY KEY, Name VARCHAR(100) NOT NULL, ContactInfo VARCHAR(255), Role VARCHAR(50) NOT NULL ); CREATE TABLE Events ( ID INT AUTO_INCREMENT PRIMARY KEY, Name VARCHAR(100) NOT NULL, Date DATE NOT NULL, Time TIME NOT NULL, Place VARCHAR(255) NOT NULL, UserID INT, FOREIGN KEY (UserID) REFERENCES Users(ID) ); CREATE TABLE Tasks ( ID INT AUTO_INCREMENT PRIMARY KEY, Description TEXT NOT NULL, Status VARCHAR(50) NOT NULL, DueDate DATE NOT NULL, EventID INT, FOREIGN KEY (EventID) REFERENCES Events(ID) ); CREATE TABLE Vendors ( ID INT AUTO_INCREMENT PRIMARY KEY, Name VARCHAR(100) NOT NULL, Service VARCHAR(100), ContactInfo VARCHAR(255), Price DECIMAL(10,2) NOT NULL, EventID INT, FOREIGN KEY (EventID) REFERENCES Events(ID) ); CREATE TABLE Budget ( ID INT AUTO_INCREMENT PRIMARY KEY, Category VARCHAR(100) NOT NULL, AllocatedAmount DECIMAL(10,2) NOT NULL, Expended DECIMAL(10,2) DEFAULT 0, EventID INT, FOREIGN KEY (EventID) REFERENCES Events(ID) ); ALTER TABLE Tasks ADD Priority VARCHAR(50); INSERT INTO Users (Name, ContactInfo, Role) VALUES ('Alice Johnson', 'alice.johnson@example.com', 'Planner'), ('Bob Smith', 'bob.smith@example.com', 'Client'), ('Charlie Lee', 'charlie.lee@example.com', 'Planner'), ('Diana Prince', 'diana.prince@example.com', 'Client'), ('Eve Adams', 'eve.adams@example.com', 'Planner'), ('Frank Miller', 'frank.miller@example.com', 'Client'), ('Grace Hopper', 'grace.hopper@example.com', 'Planner'), ('Hank Green', 'hank.green@example.com', 'Client'), ('Ivy Chen', 'ivy.chen@example.com', 'Planner'), ('Jack Black', 'jack.black@example.com', 'Client'), ('Karen White', 'karen.white@example.com', 'Planner'), ('Leo Brown', 'leo.brown@example.com', 'Client'), ('Mia Wilson', 'mia.wilson@example.com', 'Planner'), ('Noah Davis', 'noah.davis@example.com', 'Client'), ('Olivia Martinez', 'olivia.martinez@example.com', 'Planner'), ('Paul Harris', 'paul.harris@example.com', 'Client'), ('Quinn Taylor', 'quinn.taylor@example.com', 'Planner'), ('Rita Evans', 'rita.evans@example.com', 'Client'), ('Sam Collins', 'sam.collins@example.com', 'Planner'), ('Tina Morgan', 'tina.morgan@example.com', 'Client'), ('Uma Scott', 'uma.scott@example.com', 'Planner'), ('Victor Young', 'victor.young@example.com', 'Client'), ('Wendy Brooks', 'wendy.brooks@example.com', 'Planner'), ('Xander Hall', 'xander.hall@example.com', 'Client'), ('Yara James', 'yara.james@example.com', 'Planner'), ('Zane Clark', 'zane.clark@example.com', 'Client'), ('Abby Grant', 'abby.grant@example.com', 'Planner'), ('Ben Harper', 'ben.harper@example.com', 'Client'), ('Cathy Lane', 'cathy.lane@example.com', 'Planner'); INSERT INTO Events (Name, Date, Time, Place, UserID) VALUES ('Wedding of Alice and Bob', '2025-06-15', '14:00:00', 'Central Park', 2), ('Corporate Gala', '2025-07-20', '19:00:00', 'Hilton Hotel', 1), ('Birthday Party', '2025-08-10', '16:00:00', 'Private Residence', 4), ('Charity Auction', '2025-09-05', '18:00:00', 'City Hall', 1), ('Wedding of Mia and Noah', '2025-05-22', '12:00:00', 'Beachside Resort', 6), INSERT INTO Tasks (Description, Status, DueDate, EventID) VALUES ('Book venue', 'Completed', '2025-04-01', 1), ('Send invitations', 'Pending', '2025-05-01', 1), ('Hire photographer', 'In Progress', '2025-04-15', 1), INSERT INTO Vendors (Name, Service, ContactInfo, Price, EventID) VALUES ('Floral Creations', 'Florist', 'florist@example.com', 500.00, 1), ('Elegant Catering', 'Catering', 'catering@example.com', 1500.00, 1), ('Sound Solutions', 'DJ', 'dj@example.com', 800.00, 1), INSERT INTO Budget (Category, AllocatedAmount, Expended, EventID) VALUES ('Venue', 3000.00, 2500.00, 1), ('Catering', 2000.00, 1500.00, 1), ('Photography', 1200.00, 800.00, 1),

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear