Логички и физички дизајн - Креирање база податоци (со SQL DDL): dmlscript3.sql

File dmlscript3.sql, 5.3 KB (added by 201205, 4 days ago)
Line 
1INSERT INTO AppUser (UserId, FirstName, LastName, Email, Username, Password, City, Neighborhood, Bio, Quote)
2VALUES (1, 'Ana', 'Aneva', 'ana.aneva@mail.com', 'anna3aneva', '123456', 'Skopje', 'Karpos', 'Avid reader', 'Be yourself; everyone else is already taken. - Oscar Wilde'),
3(2, 'Mila', 'Mileva', 'mila.mileva@mail.com', 'mileva00', '123123', 'Skopje', 'Kisela Voda', 'Scuba diver and instructor', NULL),
4(3, 'Marko', 'Markov', 'marko.markov@mail.com', 'mark2', '321321', 'Skopje', 'Centar', NULL, NULL),
5(4, 'Daniela', 'Daneva', 'danii@mail.com', 'danidani', '456465', 'Skopje', 'Cair', NULL, NULL),
6(5, 'Davor', 'Davorov', 'davorov@mail.com', 'davorov1', '123456', 'Skopje', 'Karpos', NULL, NULL);
7
8INSERT INTO Book (BookId, Title, Author, Language, ImageURL)
9VALUES (01, 'The First Fifteen Lives of Harry August', 'Claire North', 'English', 'https://www.google.mk/books/edition/The_First_Fifteen_Lives_of_Harry_August/AZShAQAAQBAJ?hl=en'),
10(2, 'Tomorrow, and Tomorrow, and Tomorrow', 'Gabrielle Zevin', 'English', 'https://www.google.mk/books/edition/Tomorrow_and_Tomorrow_and_Tomorrow/JrpHEAAAQBAJ?hl=en'),
11(3, 'The Midnight Library', 'Matt Haig', 'Spanish', 'https://www.google.mk/books/edition/The_Midnight_Library/exTZzQEACAAJ?hl=en'),
12(4, 'Daisy Jones & The Six', 'Taylor Jenkins Reid', 'French', NULL),
13(5, 'The Seven Husbands of Evelyn Hugo', 'Taylor Jenkins Reid', 'English', 'https://www.google.mk/books/edition/The_Seven_Husbands_of_Evelyn_Hugo/NdAmDwAAQBAJ?hl=en&gbpv=1&dq=The+Seven+Husbands+of+Evelyn+Hugo&printsec=frontcover');
14
15INSERT INTO BookISBN (BookId, ISBN)
16VALUES (1, '0-356-50257-0'),
17(2, '0-356-50257-0'),
18(3, '978-0593321201'),
19(4, '0-323-12333-2'),
20(5, '0-116-5577-1');
21
22INSERT INTO Genre (BookId, Genre)
23VALUES (1, 'Historical Fiction'),
24(2, 'Adventure fiction'),
25(3, 'Science fiction,'),
26(4, 'Historical Fiction'),
27(5, 'Historical Fiction');
28
29INSERT INTO Library (InventoryId, UserId, BookId, Availability, Condition)
30VALUES (1, 1, 1, 'Not Available', 'New'),
31(2, 3, 2, 'Available', 'Like New'),
32(3, 3, 3, 'Reserved', 'Poor'),
33(4, 5, 4, 'Not Available', 'Good'),
34(5, 5, 5, 'Available', 'Like New');
35
36INSERT INTO Wishlist (WishId, UserId, BookId, Priority)
37VALUES (1, 1, 1, 'High'),
38(2, 2, 2, NULL),
39(3, 3, 3, NULL),
40(4, 4, 4, 'Medium'),
41(5, 5, 5, 'Low');
42
43INSERT INTO BookRequest(RequestId, RequesterId, OwnerId, BookId, InventoryId, RequestStatus, RequestDate)
44VALUES (1, 1, 2, 1, 1, 'Approved', '2024-04-15'),
45(2, 1, 4, 3, 2, 'Pending', '2024-06-23'),
46(3, 3, 2, 2, 4, 'Approved', '2024-03-11'),
47(4, 2, 5, 3, 1, 'Pending', '2024-02-16'),
48(5, 3, 3, 4, 5, 'Declined', '2024-01-09');
49
50INSERT INTO Transaction (TransactionId, RequestId, BorrowerId, LenderId, InventoryId, BorrowDate, ReturnDate, BorrowDuration, SwapTransactionId)
51VALUES (1, 1, 2, 3, 1, '2024-04-15', '2024-04-25', 10, NULL),
52(2, 2, 3, 2, 2, '2024-06-23', '2024-06-28', 5, 3),
53(3, 3, 2, 1, 3, '2024-06-23', '2024-06-28', 5, 2),
54(4, 4, 1, 2, 4, '2024-02-16', '2024-02-26', 10, 5),
55(5, 5, 4, 5, 5, '2024-02-16', '2024-02-26', 10, 4);
56
57INSERT INTO TransactionBook (TransactionId, BookId)
58VALUES (1, 1),
59(2, 2),
60(3, 3),
61(4, 4),
62(5, 5);
63
64
65INSERT INTO Review (ReviewId, TransactionId, ReceiverId, GiverId, Rating, ReviewerComment, Date)
66VALUES (1, 1, 2, 1, 5, 'They were great!', '2025-10-10'),
67(2, 2, 3, 2, 4, 'Returned my book on time!', '2025-02-22'),
68(3, 3, 4, 1, 5, NULL, '2025-11-12'),
69(4, 4, 2, 2, 1, 'Destoryed my book!', '2025-04-25'),
70(5, 5, 5, 4, 5, NULL, '2025-02-01');
71
72INSERT INTO Message (MessageId, SenderId, ReceiverId, Time, Date, MessageContent)
73VALUES ( 1, 1, 2, '14:34:54', '2024-05-01' , 'Hi! I finished the book early!'),
74( 2, 2, 1, '22:14:47', '2024-03-08' , 'Did you like Daisy Jones?'),
75( 3, 3, 2, '12:02:04', '2024-05-01' , 'I did not get to read it yet.'),
76( 4, 4, 2, '11:53:11', '2024-05-21' , 'Would you consider buying the hardcover?'),
77( 5, 5, 4, '23:34:32', '2024-05-07' , 'I love this book!');
78
79
80INSERT INTO FriendRequest (FriendshipId, SenderId, ReceiverId, DateCreated, Status)
81VALUES (1, 2, 1, '2025-01-01', 'Accepted'),
82(2, 2, 3, '2025-02-04', 'Accepted'),
83(3, 3, 4, '2025-03-05', 'Declined'),
84(4, 1, 4, '2025-04-09', 'Blocked'),
85(5, 5, 2, '2025-04-11', 'Pending');
86
87INSERT INTO Report (ReportId, ReportedUserId, ReportingUserId, ReportType, ReportDate, Details, ReportStatus, ReportedEntity)
88VALUES (1, 2, 1, 'Harassment', '2025-01-05', NULL, 'Accepted', 'Message'),
89(2, 3, 2, 'Harassment', '2025-02-04', NULL, 'Pending', 'Rating'),
90(3, 1, 5, 'Bullying', '2025-03-08', NULL, 'Rejected', 'Profile'),
91(4, 4, 2, 'Hate speech', '2025-05-09', 'Example text', 'Resolved', 'Message'),
92(5, 5, 3, 'Spamming', '2025-06-21', 'Example text', 'Pending', 'Library');
93
94INSERT INTO Notification (NotificationId, TransactionId, MessageId, FriendRequestId, BookRequestId, Type, Time, Date, Description, Status)
95VALUES (1, 1, NULL, NULL, NULL, 'Transaction', '14:34:54', '2025-01-02', 'Ongoing Transaction!', 'Unread'),
96(2, NULL, NULL, NULL, NULL, 'System Update', '22:14:47', '2025-02-03', 'System update!', 'Dismissed'),
97(3, NULL, 2, NULL, NULL, 'Message', '12:02:04', '2025-03-04', 'Anya sent you a message!', 'Unread'),
98(4, NULL, NULL, 3, NULL, 'Friend Request', '11:53:11', '2025-04-01', 'Sonny sent you a friend request!', 'Read'),
99(5, NULL, NULL, NULL, 4, 'Book Request', '23:34:32', '2025-07-27', 'Elena sent you a book request!', 'Unread');
100
101INSERT INTO UserNotification (UserId, NotificationId)
102VALUES (1, 1),
103(2, 2),
104(3, 3),
105(4, 4),
106(5, 5);
107