The document contains SQL commands to insert data into various tables including users, products, cart, cart_items, orders, order_items, transactions, and product_history. It includes details such as user roles, product categories, and transaction information. The data covers a range of items like books, CDs, LP records, and DVDs with associated attributes like price, stock quantity, and order status.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views3 pages
Sample Data
The document contains SQL commands to insert data into various tables including users, products, cart, cart_items, orders, order_items, transactions, and product_history. It includes details such as user roles, product categories, and transaction information. The data covers a range of items like books, CDs, LP records, and DVDs with associated attributes like price, stock quantity, and order status.
INSERT INTO order_items (order_id, product_id, quantity, price) VALUES (1, 1, 2, 100000), -- 2 cuốn "The Great Gatsby" (1, 5, 1, 130000), -- 1 CD "Abbey Road" (2, 9, 1, 140000), -- 1 DVD "Inception" (2, 7, 2, 160000), -- 2 LP "Dark Side of the Moon" (3, 3, 2, 110000), -- 2 cuốn "1984" (4, 2, 1, 95000), -- 1 cuốn "Pride and Prejudice" (4, 10, 2, 135000), -- 2 DVD "The Matrix" (5, 6, 1, 125000), -- 1 CD "Thriller" (5, 12, 1, 150000); -- 1 DVD "Spirited Away"
-- 7. Thêm dữ liệu vào bảng transactions
INSERT INTO transactions (order_id, transaction_vnpay_id, amount, content, created_at) VALUES (1, 'VNPAY_001', 245000, 'Payment for order 1', CURRENT_TIMESTAMP), (2, 'VNPAY_002', 320000, 'Payment for order 2', CURRENT_TIMESTAMP), (4, 'VNPAY_003', 450000, 'Payment for order 4', CURRENT_TIMESTAMP), (5, 'VNPAY_004', 135000, 'Refund for order 5', CURRENT_TIMESTAMP);
-- 8. Thêm dữ liệu vào bảng product_history
INSERT INTO product_history (product_id, operation, description, user_id, created_at) VALUES (1, 'ADD', 'Added new book: The Great Gatsby', 3, CURRENT_TIMESTAMP), (5, 'ADD', 'Added new CD: Abbey Road', 3, CURRENT_TIMESTAMP), (7, 'EDIT', 'Updated stock quantity for Dark Side of the Moon', 4, CURRENT_TIMESTAMP), (9, 'ADD', 'Added new DVD: Inception', 3, CURRENT_TIMESTAMP), (3, 'EDIT', 'Updated price for 1984', 4, CURRENT_TIMESTAMP), (2, 'ADD', 'Added new book: Pride and Prejudice', 3, CURRENT_TIMESTAMP), (10, 'DELETE', 'Removed The Matrix due to discontinuation', 4, CURRENT_TIMESTAMP), (6, 'ADD', 'Added new CD: Thriller', 3, CURRENT_TIMESTAMP), (12, 'ADD', 'Added new DVD: Spirited Away', 3, CURRENT_TIMESTAMP), (1, 'EDIT', 'Updated publisher for The Great Gatsby', 4, CURRENT_TIMESTAMP);