Нормализација и подобрувања на дизајнот: dml_2025-Sept.sql

File dml_2025-Sept.sql, 6.2 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@example.com', 'anna3aneva', '123456', 'Skopje', 'Karpos', 'Avid reader', 'Be yourself; everyone else is already taken. - Oscar Wilde'),
3(2, 'Mila', 'Mileva', 'mila.mileva@example.com', 'mileva00', '123123', 'Skopje', 'Kisela Voda', 'Scuba diver and instructor', NULL),
4(3, 'Marko', 'Markov', 'marko.markov@example.com', 'mark2', '321321', 'Skopje', 'Centar', NULL, NULL),
5(4, 'Daniela', 'Daneva', 'danii@example.com', 'danidani', '456465', 'Skopje', 'Cair', NULL, NULL),
6(5, 'Davor', 'Davorov', 'davorov@example.com', 'davorov1', '123456', 'Skopje', 'Karpos', NULL, NULL);
7
8
9INSERT INTO Book (BookId, Title, Author, Language, ImageURL)
10VALUES (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'),
11(2, 'Tomorrow, and Tomorrow, and Tomorrow', 'Gabrielle Zevin', 'English', 'https://www.google.mk/books/edition/Tomorrow_and_Tomorrow_and_Tomorrow/JrpHEAAAQBAJ?hl=en'),
12(3, 'The Midnight Library', 'Matt Haig', 'Spanish', 'https://www.google.mk/books/edition/The_Midnight_Library/exTZzQEACAAJ?hl=en'),
13(4, 'Daisy Jones & The Six', 'Taylor Jenkins Reid', 'French', NULL),
14(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');
15
16INSERT INTO BookISBN (BookISBNId, ISBN)
17VALUES (1, '0-356-50257-0'),
18(2, '0-356-50257-0'),
19(3, '978-0593321201'),
20(4, '0-323-12333-2'),
21(5, '0-116-5577-1');
22
23INSERT INTO Genre (GenreId, Genre)
24VALUES (1, 'Historical Fiction'),
25(2, 'Adventure fiction'),
26(3, 'Science fiction'),
27(4, 'Historical Fiction'),
28(5, 'Historical Fiction');
29
30INSERT INTO Review (ReviewId, ReceiverId, GiverId, Rating, ReviewerComment, ReviewDate)
31VALUES (1, 2, 1, 5, 'They were great!', '2025-10-10'),
32(2, 3, 2, 4, 'Returned my book on time!', '2025-02-22'),
33(3, 4, 1, 5, NULL, '2025-11-12'),
34(4, 2, 2, 1, 'Destoryed my book!', '2025-04-25'),
35(5, 5, 4, 5, NULL, '2025-02-01');
36
37INSERT INTO Report (ReportId, ReportedUserId, ReportingUserId, ReportType, ReportDate, Details, ReportStatus, ReportedEntity)
38VALUES (1, 2, 1, 'Harassment', '2025-01-05', NULL, 'Accepted', 'Message'),
39(2, 3, 2, 'Harassment', '2025-02-04', NULL, 'Pending', 'Rating'),
40(3, 1, 5, 'Bullying', '2025-03-08', NULL, 'Rejected', 'Profile'),
41(4, 4, 2, 'Hate speech', '2025-05-09', 'Example text', 'Resolved', 'Message'),
42(5, 5, 3, 'Spamming', '2025-06-21', 'Example text', 'Pending', 'Library');
43
44INSERT INTO Notification (NotificationId, Type, NotifTime, NotifDate, Description, NotificationStatus)
45VALUES (1, 'BookRequest', '14:34:54', '2025-01-02', 'Anna sent you a book request!', 'Unread'),
46(2, 'Transaction', '22:14:47', '2025-02-03', 'Ongoing Transaction!', 'Dismissed'),
47(3, 'Message', '12:02:04', '2025-03-04', 'Mila sent you a message!', 'Unread'),
48(4, 'Friend Request', '11:53:11', '2025-04-01', 'Mila sent you a friend request!', 'Read'),
49(5, 'Book Request', '23:34:32', '2025-07-27', 'Elena sent you a book request!', 'Unread');
50
51INSERT INTO Transaction (TransactionId, BorrowerId, LenderId, BorrowDate, ReturnDate, BorrowDuration)
52VALUES (1, 2, 3, '2024-04-15', '2024-04-25', 10),
53(2, 3, 2, '2024-06-23', '2024-06-28', 5),
54(3, 2, 1, '2024-06-23', '2024-06-28', 5),
55(4, 1, 2, '2024-02-16', '2024-02-26', 10),
56(5, 4, 5, '2024-02-16', '2024-02-26', 10);
57
58INSERT INTO LibraryBook (InventoryId, Availability, Condition)
59VALUES (1, 'Not Available', 'New'),
60(2, 'Available', 'Like New'),
61(3, 'Reserved', 'Poor'),
62(4, 'Not Available', 'Good'),
63(5, 'Available', 'Like New');
64
65INSERT INTO WishlistBook (WishId, Priority)
66VALUES (1, 'High'),
67(2, NULL),
68(3, NULL),
69(4, 'Medium'),
70(5, 'Low');
71
72INSERT INTO Message (MessageId, MsgSenderId, MsgReceiverId, MsgTime, MsgDate, 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
79INSERT INTO FriendRequest (FriendshipId, FriendshipSenderId, FriendshipReceiverId, DateCreated, FriendshipStatus)
80VALUES (1, 2, 1, '2025-01-01', 'Accepted'),
81(2, 2, 3, '2025-02-04', 'Accepted'),
82(3, 3, 4, '2025-03-05', 'Declined'),
83(4, 1, 4, '2025-04-09', 'Blocked'),
84(5, 5, 2, '2025-04-11', 'Pending');
85
86INSERT INTO BookRequest(RequestId, RequesterId, OwnerId, RequestStatus, RequestDate)
87VALUES (1, 1, 2, 'Approved', '2024-04-15'),
88(2, 1, 4, 'Pending', '2024-06-23'),
89(3, 3, 2, 'Approved', '2024-03-11'),
90(4, 2, 5, 'Pending', '2024-02-16'),
91(5, 3, 3, 'Declined', '2024-01-09');
92
93INSERT INTO Swap(SwapId, TransactionId1, TransactionId2)
94VALUES(1, 2,3);
95
96INSERT INTO GenreLink (GenreId, BookId)
97VALUES (1, 1),
98(2, 2),
99(3, 3),
100(4, 4),
101(5, 5);
102
103INSERT INTO ISBNLink (BookISBNId, BookId)
104VALUES (1, 1),
105(2, 2),
106(3, 3),
107(4, 4),
108(5, 5);
109
110INSERT INTO WishlistBookLink(WishId, BookId UserId)
111VALUES (1, 1, 1),
112(2, 2, 2),
113(3, 3, 3),
114(4, 4, 4),
115(5, 5, 5);
116
117INSERT INTO LibraryBookLink(InventoryId, BookId, UserId)
118VALUES (1, 1, 1),
119(2, 2, 3),
120(3, 3, 3),
121(4, 4, 5),
122(5, 5, 5);
123
124
125INSERT INTO BookRequestLink(RequestId, InventoryId, BookId)
126VALUES (1, 1, 1),
127(2, 3, 2),
128(3, 2, 4),
129(4, 3, 1),
130(5, 4, 5);
131
132
133INSERT INTO ReviewLink(ReviewId, TransactionId)
134VALUES (1, 1),
135(2, 3),
136(3, 2),
137(4, 3),
138(5, 4);
139
140INSERT INTO TransactionLink(TransactionId, RequestId)
141VALUES (1, 1),
142(2, 2),
143(3, 3),
144(4, 4),
145(5, 5);
146
147INSERT INTO BookRequestLink(RequestId, InventoryId)
148VALUES (1, 1),
149(2, 3),
150(3, 4),
151(4, 1),
152(5, 5);
153
154INSERT INTO MessageNotifLink(NotificationId, MessageId)
155VALUES (3, 2);
156
157INSERT INTO FriendNotifLink(NotificationId, FriendshipId)
158VALUES (4, 2);
159
160INSERT INTO BookRequestNotifLink(NotificationId, RequestId)
161VALUES (1,2),
162(5, 4);
163
164INSERT INTO TransactionNotifLink(NotificationId, TransactionId)
165VALUES (2, 1);
166
167
168
169
170
171
172
173
174
175
176