Mysql Postgresql
Mysql Postgresql
-- SQLINES DEMO *** ững sp sale thì lấy trong bảng SALE_PRODUCTS join với bảng
product
-- SQLINES DEMO *** e có isDeleted = false
-- SQLINES DEMO *** startDate thì bỏ qua
-- SQLINES DEMO *** an sale thì lấy
-- SQLINES DEMO *** te thì
-- SQLINES DEMO *** = true trong SALE_PRODUCT
-- SQLINES DEMO *** alse trong PRODUCT
-- ROLE_USER
ALTER TABLE "USER" ADD CONSTRAINT USER_ROLE_USER_FK FOREIGN KEY(roleID) REFERENCES
ROLE(roleID);
-- INVOICE
ALTER TABLE INVOICE ADD CONSTRAINT INVOICE_USER_FK FOREIGN KEY(userID) REFERENCES
USER(userID);
-- DETAILED_INVOICE
ALTER TABLE DETAILEDINVOICE ADD CONSTRAINT DI_INVOICE_FK FOREIGN KEY(invoiceID)
REFERENCES INVOICE(invoiceID);
ALTER TABLE DETAILEDINVOICE ADD CONSTRAINT DI_PRD_FK FOREIGN KEY(productID)
REFERENCES PRODUCT(productID);
-- SHIPPING_INFO
ALTER TABLE SHIPPINGINFO ADD CONSTRAINT SI_INVOICE_FK FOREIGN KEY(invoiceID)
REFERENCES INVOICE(invoiceID);
-- SALE_PRODUCTS
ALTER TABLE SALEPRODUCT ADD CONSTRAINT SALEPRD_PRD_FK FOREIGN KEY(productID)
REFERENCES PRODUCT(productID);
-- REVIEW
ALTER TABLE REVIEW ADD CONSTRAINT REVIEW_PRD_FK FOREIGN KEY(productID) REFERENCES
PRODUCT(productID);
ALTER TABLE REVIEW ADD CONSTRAINT REVIEW_USER_FK FOREIGN KEY(userID) REFERENCES
USER(userID);
-- SMART WATCH
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, totalReviews, images)
VALUES(1, 2, 5, 'Apple watch series 3', 4000000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 23,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]",9,"['images/watch1.jpeg','images/watch5.jpeg','images/
watch2.jpeg','images/watch6.jpeg']");
-- PC Accessories
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, totalReviews, images)
VALUES(2, 2, 5, 'PlayStation 4', 1200000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 10,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]",2,"['images/console4.jpeg','images/console5.jpeg','images/
console4.jpeg','images/console3.jpeg']");
-- Audio System
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(3, 1, 4.5, 'Audio System Razer', 5000000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
10, 10, 4,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/headphone7.jpeg','images/headphone1.jpeg','images/
headphone4.jpeg','images/headphone6.jpeg']");
-- HeadPhone
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(4, 1, 4.5, 'HeadPhone Logitech', 3100000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
10, 10, 4,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/headphone1.jpeg','images/headphone2.jpeg','images/
headphone3.jpeg','images/headphone6.jpeg']");
-- MOUSE
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(5, 2, 5, 'Logitech G8', 800000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 10,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/mouse2.jpeg','images/mouse1.jpeg','images/
mouse2.jpeg','images/mouse4.jpeg']");
-- Gaming Desk/Chair
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(6, 2, 5, 'Luxury Desk', 1400000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 10,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/desk5.jpeg','images/desk4.jpeg','images/desk2.jpeg','images
/desk4.jpeg']");
-- LAPTOP
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(7, 1, 4.5, 'Macbook Pro 13 2018', 15000000,"['Chip: S5 with 64-bit dual-
core processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery
Life: up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold,
Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
10, 10, 4,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/mac1.jpeg','images/mac5.jpeg','images/mac2.jpeg','images/
mac4.jpeg']");
-- Monitor
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(8, 1, 4.5, 'LCD LED 24inch', 3400000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
10, 10, 4,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/monitor1.jpeg','images/monitor2.jpeg','images/
monitor3.jpeg','images/monitor4.jpeg']");
-- KEYBOARD
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(9, 2, 5, 'Keychrone K8', 230000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 10,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/keyboard6.jpeg','images/keyboard1.jpeg','images/
keyboard2.jpeg','images/keyboard3.jpeg']");
-- SMART PHONE
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO PRODUCT (categoryID, brandID, productRate, productName, productPrice,
shortTech,
shortDescrip, longDescrip, warranty, stock, purchased, specs, images)
VALUES(10, 2, 5, 'Iphone 12', 23000000,"['Chip: S5 with 64-bit dual-core
processor','Retina Display: LTPO OLED (1000 nits)','Capacity: 32GB','Battery Life:
up to 18 hours','Water resistant: 50 meters','Color: Space Gray, Gold, Silver']",
'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Natus incidunt
distinctio saepe laudantium, nam unde quaerat perferendis harum,
aspernatur atque blanditiis rerum possimus! Praesentium dolorum, accusamus repellat
doloribus ex ipsam',
"[{'header': 'The power to bring your creations to life','content': 'The powerful
combination of an Intel® Core™ processor, ample memory and storage make your
creative vision seamlessly come to life faster than ever before.'},{'header':
'Thoughtfully designed','content': 'Sometimes bigger is better. Watch your
creations come to life in accurate, vibrant color on this massive high definition,
micro-edge display.'},{'header': 'Privacy for your peace of mind','content': 'Keep
it confidential with an unhackable camera shutter and dedicated microphone mute
button.'}]",
2, 50, 10,
"[{'tag': 'Color','content': 'Rose Gold'},{'tag': 'Brightness','content': '300
nits'},{'tag': 'Display resolution','content': '24'},{'tag': 'Signal input
connectors','content': '1 HDMI 2.0 (with HDCP support); 1 DisplayPort™ 1.4 (with
HDCP support)'},{'tag': 'Ports','content': '1 analog and digital audio-out; 3 USB
3.0 (1 upstream, 2 downstream)'},{'tag': 'Dimensions (W X D X H)','content': '25.98
x13.07 x 18.62 in Without stand'},{'tag': 'Weight','content': '15.8 lb'},{'tag':
'Display viewing angle','content': '160° vertical; 170° horizontal'},{'tag':
'Display type','content': 'LED
backlight'}]","['images/iphone1.jpeg','images/iphone2.jpeg','images/
iphone3.jpeg','images/iphone4.jpeg']");
-- PRODUCT 2
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 1, '2021-03-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 1, '2021-03-04', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 2, '2021-03-05', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 1, '2021-03-06', 'Sản phẩm tốt', 4);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 2, '2021-03-07', 'Giao hàng quá chậm, sản phẩm có vẻ không chắc chắn như
đã giới thiệu', 2);
-- PRODUCT 3
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (3, 1, '2021-03-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (3, 2, '2021-03-04', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (3, 1, '2021-03-05', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (3, 1, '2021-03-06', 'Sản phẩm tốt', 4);
-- PRODUCT 4
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (4, 1, '2021-03-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (4, 1, '2021-03-04', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (4, 1, '2021-03-05', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- PRODUCT 5
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (5, 1, '2021-03-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (5, 1, '2021-03-04', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (5, 1, '2021-03-05', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- PRODUCT 6
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (6, 1, '2021-03-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (6, 1, '2021-03-04', 'Sản phẩm rất đẹp', 5);
-- PRODUCT 1
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (1, 2, '2021-03-10', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (1, 2, '2021-03-11', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (1, 1, '2021-03-12', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- PRODUCT 2
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 2, '2021-04-03', 'Sản phẩm được gói cẩn thận, chất lượng tốt, mẫu mã như
quảng cáo', 4.5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 2, '2021-05-04', 'Sản phẩm rất đẹp', 5);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 1, '2021-01-05', 'Màu sắc sản phầm không giống quảng cáo', 3);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 2, '2021-02-06', 'Sản phẩm tốt', 4);
-- SQLINES LICENSE FOR EVALUATION USE ONLY
INSERT INTO REVIEW (productID, userID, reviewDate, reviewContent, rate)
VALUES (2, 1, '2021-01-07', 'Giao hàng quá chậm, sản phẩm có vẻ không chắc chắn như
đã giới thiệu', 2);
-- use techshop;
-- SQLINES DEMO *** t productRate = (select SUM(rate)/2 from review where productID
= 6) where productID = 6;
-- SQLINES DEMO *** productRate, totalReviews from product where productID = 6;