added Review Feature
This commit is contained in:
@@ -321,6 +321,9 @@ INSERT INTO
|
||||
Image_URL (URL, ProductID)
|
||||
VALUES
|
||||
('/image1.avif', 1),
|
||||
('/image2.avif', 1),
|
||||
('/image3.avif', 1),
|
||||
('/image8.jpg', 1),
|
||||
('/image1.avif', 2),
|
||||
('/image1.avif', 3),
|
||||
('/image1.avif', 4),
|
||||
@@ -442,3 +445,14 @@ VALUES
|
||||
(3, 1, 8, '2024-10-14 12:20:00', 'Pending'),
|
||||
(4, 2, 10, '2024-10-13 17:10:00', 'Completed'),
|
||||
(5, 2, 4, '2024-10-12 14:30:00', 'Completed');
|
||||
|
||||
INSERT INTO
|
||||
Review (UserID, ProductID, Comment, Rating, Date)
|
||||
VALUES
|
||||
(
|
||||
1,
|
||||
1,
|
||||
'This is a great fake product! Totally recommend it.',
|
||||
5,
|
||||
NOW ()
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ CREATE TABLE Image_URL (
|
||||
|
||||
-- Fixed Review Entity (Many-to-One with User, Many-to-One with Product)
|
||||
CREATE TABLE Review (
|
||||
ReviewID INT PRIMARY KEY,
|
||||
ReviewID INT AUTO_INCREMENT PRIMARY KEY,
|
||||
UserID INT,
|
||||
ProductID INT,
|
||||
Comment TEXT,
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE Review (
|
||||
),
|
||||
Date DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (UserID) REFERENCES User (UserID),
|
||||
FOREIGN KEY (ProductID) REFERENCES Pprint(item[0])roduct (ProductID)
|
||||
FOREIGN KEY (ProductID) REFERENCES Product (ProductID)
|
||||
);
|
||||
|
||||
-- Transaction Entity (Many-to-One with User, Many-to-One with Product)
|
||||
@@ -270,16 +270,16 @@ CREATE TABLE AuthVerification (
|
||||
-- -- WHERE
|
||||
-- -- CategoryID = 6;
|
||||
-- -- -- REVIEW OPERATIONS
|
||||
-- -- INSERT INTO
|
||||
-- -- Review (ReviewID, UserID, ProductID, Comment, Rating)
|
||||
-- -- VALUES
|
||||
-- -- (
|
||||
-- -- 1,
|
||||
-- -- 1,
|
||||
-- -- 1,
|
||||
-- -- 'Great product, very satisfied with the purchase!',
|
||||
-- -- 5
|
||||
-- -- );
|
||||
-- INSERT INTO
|
||||
-- Review (ReviewID, UserID, ProductID, Comment, Rating)
|
||||
-- VALUES
|
||||
-- (
|
||||
-- 1,
|
||||
-- 1,
|
||||
-- 1,
|
||||
-- 'Great product, very satisfied with the purchase!',
|
||||
-- 5
|
||||
-- );
|
||||
-- -- -- TRANSACTION OPERATIONS
|
||||
-- -- INSERT INTO
|
||||
-- -- Transaction (TransactionID, UserID, ProductID, PaymentStatus)
|
||||
|
||||
Reference in New Issue
Block a user