Last active
February 27, 2025 16:19
-
-
Save Cristuker/9e27da6b2c2b24dfcde405bbf9dd4b9d to your computer and use it in GitHub Desktop.
Script to create and populate a simple DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create table for users | |
CREATE TABLE users ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100) NOT NULL, | |
email VARCHAR(255) UNIQUE NOT NULL, | |
created_at TIMESTAMP, | |
updated_at TIMESTAMP | |
); | |
-- Create table for todos | |
CREATE TABLE todos ( | |
id SERIAL PRIMARY KEY, | |
user_id INT NOT NULL, | |
title VARCHAR(255) NOT NULL, | |
description TEXT, | |
status VARCHAR(50) CHECK (status IN ('pending', 'in_progress', 'completed')) NOT NULL, | |
created_at TIMESTAMP, | |
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE cascade, | |
updated_at TIMESTAMP | |
); | |
-- Insert sample users | |
INSERT INTO users (name, email) VALUES | |
('Alice Johnson', '[email protected]'), | |
('Bob Smith', '[email protected]'), | |
('Charlie Davis', '[email protected]'), | |
('Diana Prince', '[email protected]'), | |
('Ethan Hunt', '[email protected]'), | |
('Frank Castle', '[email protected]'), | |
('Grace Hopper', '[email protected]'), | |
('Henry Ford', '[email protected]'), | |
('Isaac Newton', '[email protected]'), | |
('Jane Austen', '[email protected]'), | |
('Kevin Mitnick', '[email protected]'), | |
('Laura Palmer', '[email protected]'), | |
('Michael Scott', '[email protected]'), | |
('Nancy Drew', '[email protected]'), | |
('Oscar Wilde', '[email protected]'), | |
('Peter Parker', '[email protected]'), | |
('Quincy Jones', '[email protected]'), | |
('Rachel Green', '[email protected]'), | |
('Steve Jobs', '[email protected]'), | |
('Tony Stark', '[email protected]'), | |
('Bruce Wayne', '[email protected]'), | |
('Clark Kent', '[email protected]'), | |
('Diana Ross', '[email protected]'), | |
('Elon Musk', '[email protected]'), | |
('Mark Zuckerberg', '[email protected]'); | |
-- Insert sample todos | |
INSERT INTO todos (user_id, title, description, status) VALUES | |
(1, 'Buy groceries', 'Milk, eggs, bread', 'pending'), | |
(1, 'Workout', 'Go for a 5km run', 'in_progress'), | |
(1, 'Read newspaper', 'Stay updated with world news', 'pending'), | |
(2, 'Read a book', 'Finish reading "Clean Code"', 'completed'), | |
(2, 'Update resume', 'Revise and update professional resume', 'pending'), | |
(3, 'Write report', 'Complete the quarterly financial report', 'pending'), | |
(3, 'Call supplier', 'Discuss the new shipment details', 'in_progress'), | |
(3, 'Plan meeting', 'Schedule next team meeting', 'pending'), | |
(4, 'Plan vacation', 'Research and book flights for summer trip', 'pending'), | |
(4, 'Pack luggage', 'Prepare items for travel', 'in_progress'), | |
(5, 'Fix bug', 'Resolve critical issue in production', 'completed'), | |
(5, 'Team meeting', 'Discuss project roadmap and milestones', 'in_progress'), | |
(5, 'Code review', 'Review PRs from team members', 'pending'), | |
(6, 'Design logo', 'Create a new logo for startup', 'in_progress'), | |
(6, 'Build prototype', 'Develop first version of new product', 'pending'), | |
(7, 'Test software', 'Perform QA testing on new release', 'completed'), | |
(7, 'Deploy application', 'Push new version to production', 'pending'), | |
(8, 'Write blog post', 'Draft a new blog post about technology trends', 'pending'), | |
(8, 'Engage on social media', 'Respond to followers and interact', 'in_progress'), | |
(9, 'Research AI', 'Look into the latest AI advancements', 'in_progress'), | |
(9, 'Implement ML model', 'Train and deploy a machine learning model', 'pending'), | |
(10, 'Clean workspace', 'Organize and clean up home office', 'pending'), | |
(10, 'Rearrange furniture', 'Improve office layout for productivity', 'in_progress'), | |
(11, 'Watch documentary', 'Learn about space exploration', 'completed'), | |
(11, 'Write review', 'Post thoughts on the documentary watched', 'pending'), | |
(12, 'Cook dinner', 'Prepare a new recipe for dinner', 'pending'), | |
(12, 'Grocery shopping', 'Buy ingredients for meal prep', 'in_progress'), | |
(13, 'Meditate', 'Practice mindfulness for 15 minutes', 'in_progress'), | |
(13, 'Journal writing', 'Write thoughts and reflections', 'pending'), | |
(14, 'Buy gifts', 'Purchase birthday gifts for friends', 'pending'), | |
(14, 'Wrap gifts', 'Prepare them for delivery', 'in_progress'), | |
(15, 'Plan event', 'Organize office holiday party', 'completed'), | |
(15, 'Send invites', 'Email event details to guests', 'pending'), | |
(16, 'Setup website', 'Deploy personal portfolio site', 'in_progress'), | |
(16, 'Update portfolio', 'Add new projects and achievements', 'pending'), | |
(17, 'Email clients', 'Send follow-up emails to potential leads', 'pending'), | |
(17, 'Schedule calls', 'Arrange virtual meetings with clients', 'in_progress'), | |
(18, 'Prepare presentation', 'Create slides for upcoming meeting', 'in_progress'), | |
(18, 'Rehearse speech', 'Practice delivery for confidence', 'pending'), | |
(19, 'Organize files', 'Sort and archive old documents', 'completed'), | |
(19, 'Shred unnecessary papers', 'Dispose of outdated paperwork', 'pending'), | |
(20, 'Backup data', 'Ensure important files are securely stored', 'pending'), | |
(20, 'Check security logs', 'Review recent access attempts', 'in_progress'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment