Skip to content

Commit 246a7c9

Browse files
committed
feat: Init data scripts🫸🌀✏️📗🐧🐳⬆
1 parent 6c6a1be commit 246a7c9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- Insert Users
2+
INSERT INTO Users (username, email, password) VALUES
3+
('johndoe', 'john@example.com', 'password123'),
4+
('janedoe', 'jane@example.com', 'password456');
5+
6+
-- Insert Books
7+
INSERT INTO Books (title, author, isbn, published_date, genre) VALUES
8+
('The Great Gatsby', 'F. Scott Fitzgerald', '9780743273565', '1925-04-10', 'Classic'),
9+
('To Kill a Mockingbird', 'Harper Lee', '9780061120084', '1960-07-11', 'Classic'),
10+
('1984', 'George Orwell', '9780451524935', '1949-06-08', 'Dystopian');
11+
12+
-- Insert Book Instances
13+
INSERT INTO BookInstances (book_id, status, due_date) VALUES
14+
(1, 'available', NULL),
15+
(1, 'checked_out', '2024-07-15'),
16+
(2, 'available', NULL),
17+
(3, 'reserved', '2024-07-20'),
18+
(3, 'available', NULL);
19+
20+
-- Insert Checkouts
21+
INSERT INTO Checkouts (user_id, instance_id, checkout_date, return_date) VALUES
22+
(1, 2, '2024-07-01 10:00:00', NULL), -- John Doe checks out a copy of "The Great Gatsby"
23+
(2, 4, '2024-07-02 11:00:00', NULL); -- Jane Doe reserves a copy of "1984"

0 commit comments

Comments
 (0)