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

File dmlscript2.sql, 5.4 KB (added by 201205, 6 days ago)
Line 
1INSERT INTO User (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
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 (BookId, 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 (BookId, Genre)
24VALUES (1, 'Historical Fiction')
25(2, 'Adventure fiction')
26(3, 'Science fiction,')
27(4, 'Historical Fiction')
28(5, 'Historical Fiction')
29
30INSERT INTO Library (InventoryId, UserId, BookId, Availability, Condition)
31VALUES (1, 1, 1, 'Not Available', 'New')
32(2, 3, 2, 'Available', 'Like New')
33(3, 3, 3, 'Reserved', 'Poor')
34(4, 5, 4, 'Not Available', 'Good')
35(5, 5, 5, 'Available', 'Like New')
36
37INSERT INTO Wishlist (WishId, UserId, BookId, Priority)
38VALUES (1, 1, 1, 'High')
39(2, 2, 2, NULL)
40(2, 3, 3, NULL)
41(4, 4, 4, 'Medium')
42(5, 5, 5, 'Low')
43
44INSERT INTO LibraryBook(BookId, InventoryId)
45VALUES(1, 1)
46(2, 2)
47(3, 3)
48(4, 4)
49(5, 5)
50
51INSERT INTO Wishlist(BookId, WishId)
52VALUES(1, 1)
53(3,2)
54(2,3)
55(4,4)
56(5,5)
57
58INSERT INTO BookRequest(RequestId, RequesterId, OwnerId, BookId, InventoryId, RequestStatus, RequestDate)
59VALUES (1, 1, 2, 1, 1, 'Approved', '15.04.2025')
60(2, 1, 4, 3, 2, 'Pending', '23.06.2025')
61(3, 3, 2, 2, 4, 'Approved', '11.03.2025')
62(4, 2, 5, 3, 1, 'Pending', '16.02.2025')
63(5, 3, 3, 4, 5, 'Declined', '09.01.2025')
64
65INSERT INTO Transaction (TransactionId, RequestId, BorrowerId, LenderId, InventoryId, BorrowDate, ReturnDate, BorrowDuration, SwapTransactionId)
66VALUES (1, 1, 2, 3, 1, '15.04.2025', '25.04.2025', 10, NULL)
67(2, 2, 3, 2, 2, '23.06.2025', '28.06.2025', 5, 3)
68(3, 3, 2, 1, 3, '23.06.2025', '28.06.2025', 5, 2)
69(4, 4, 1, 2, 4, '16.02.2025', '26.02.2025', 10, 5)
70(5, 5, 4, 5, 5, '16.02.2025', '26.02.2025', 10, 4)
71
72INSERT INTO TransactionBook (TransactionId, BookId)
73VALUES (1, 1)
74(2, 2)
75(3, 3)
76(4, 4)
77(5, 5)
78
79INSERT INTO Review (ReviewId, TransactionId, ReceiverId, GiverId, Rating, ReviewerComment, Date)
80VALUES (1, 1, 2, 1, 5, 'They were great!', '10.10.2025')
81(2, 2, 3, 2, 4, 'Returned my book on time!', '22.02.2025')
82(3, 3, 4, 1, 5, NULL, '12.11.2025')
83(4, 4, 2, 2, 1, 'Destoryed my book!', '25.04.2025')
84(5, 5, 5, 4, 5, NULL, '01.02.2025')
85
86INSERT INTO Message (MessageId, SenderId, ReceiverId, Time, Date, MessageContent)
87VALUES ( 1, 1, 2, '14:34:54', '01.05.2025' , 'Hi! I finished the book early!')
88( 2, 2, 1, '22:14:47', '08.03.2025' , 'Did you like Daisy Jones?')
89( 3, 3, 2, '12:02:04', '01.05.2025' , 'I didn't get to read it yet.')
90( 4, 4, 2, '11:53:11', '21.05.2025' , 'Would you consider buying the hardcover?')
91( 5, 5, 4, '23:34:32', '07.05.2025' , 'I love this book!')
92
93INSERT INTO FriendRequest (FriendshipId, SenderId, ReceiverId, DateCreated, Status)
94VALUES (1, 2, 1, '01.01.2025', 'Accepted')
95(2, 2, 3, '04.02.2025', 'Accepted')
96(3, 3, 4, '17.03.2025', 'Declined')
97(4, 1, 4, '14.04.2025', 'Blocked')
98(5, 5, 2, '21.04.2025', 'Pending')
99
100INSERT INTO Report (ReportId, ReportedUserId, ReportingUserId, ReportType, ReportDate, Details, ReportStatus, ReportedEntity)
101VALUES (1, 2, 1, 'Harassment', '21.01.2025', NULL, 'Approved', 'Message')
102(2, 3, 2, 'Harassment', '22.02.2025', NULL, 'Pending', 'Rating')
103(3, 1, 5, 'Bullying', '23.03.2025', NULL, 'Approved', 'Profile')
104(4, 4, 2, 'Hate speech', '24.04.2025', 'Example text', 'Approved', 'Message')
105(5, 5, 3, 'Spamming', '25.05.2025', 'Example text', 'Pending', 'Library')
106
107INSERT INTO Notification (NotificationId, TransactionId, MessageId, FriendRequestId, BookRequestId, Type, Time, Date, Description, Status)
108VALUES (1, 1, NULL, NULL, NULL, 'Transaction', '14:34:54', '01.05.2025', 'Ongoing Transaction!', 'Unread')
109(2, NULL, NULL, NULL, NULL, 'System Update', '22:14:47', '08.03.2025', 'System update!', 'Dismissed')
110(3, NULL, 2, NULL, NULL, 'Message', '12:02:04', '01.05.2025', 'Anya sent you a message!', 'Unread')
111(4, NULL, NULL, 3, NULL, 'Friend Request', '11:53:11', '21.05.2025', 'Sonny sent you a friend request!', 'Read')
112(5, NULL, NULL, NULL, 4, 'Book Request', '23:34:32', '07.05.2025', 'Elena sent you a book request!', 'Unread')
113
114INSERT INTO UserNotification (UserId, NotificationId)
115VALUES (1, 1)
116(2, 2)
117(3, 3)
118(4, 4)
119(5, 5)