ATE TABLE ORDER_DETAILS ( OrderDetailID NUMBER PRIMARY KEY, OrderID NUMBER, ProductID NUMBER, ProductName VARCHAR2(100), Price NUMBER, Quantity NUMBER, Subtotal NUMBER, CONSTRAINT FK_ORDER_DETAILS_ORDER FOREIGN KEY (OrderID) REFERENCES "ORDER"(OrderID), CONSTRAINT FK_ORDER_DETAILS_PRODUCT FOREIGN KEY (ProductID) REFERENCES PRODUCT(ProductID) ); CREATE TABLE PRODUCT ( ProductID NUMBER PRIMARY KEY, ProductName VARCHAR2(100), Description VARCHAR2(200), Price NUMBER, Category VARCHAR2(50) ); CREATE TABLE STORE ( StoreID NUMBER PRIMARY KEY, StoreName VARCHAR2(100), Location VARCHAR2(200), HoursOfOperation VARCHAR2(100) ); CREATE TABLE INVENTORY ( ProductID NUMBER, StoreID NUMBER, QuantityOnHand NUMBER, ReorderPoint NUMBER, PRIMARY KEY (ProductID, StoreID), CONSTRAINT FK_INVENTORY_PRODUCT FOREIGN KEY (ProductID) REFERENCES PRODUCT(ProductID), CONSTRAINT FK_INVENTORY_STORE FOREIGN KEY (StoreID) REFERENCES STORE(StoreID) ); CREATE TABLE "TRANSACTION" ( TransactionID NUMBER PRIMARY KEY, TransactionDate DATE, TransactionType VARCHAR2(20), TotalAmount NUMBER, CustomerID NUMBER, CONSTRAINT FK_TRANSACTION_CUSTOMER FOREIGN KEY (CustomerID) REFERENCES CUSTOMER(CustomerID) ); CREATE TABLE TRANSACTION_DETAILS ( TransactionDetailID NUMBER PRIMARY KEY, TransactionID NUMBER, ProductID NUMBER, ProductName VARCHAR2(100), Price NUMBER, Quantity NUMBER, Subtotal NUMBER, CONSTRAINT FK_TRANSACTION_DETAILS_TRANSACTION FOREIGN KEY (TransactionID) REFERENCES "TRANSACTION"(TransactionID), CONSTRAINT FK_TRANSACTION_DETAILS_PRODUCT FOREIGN KEY (ProductID) REFERENCES PRODUCT(ProductID) ); CREATE TABLE EMPLOYEE ( EmployeeID NUMBER PRIMARY KEY, Name VARCHAR2(100), Address VARCHAR2(200), Phone VARCHAR2(20), Email VARCHAR2(100), Position VARCHAR2(50) ); CREATE TABLE SALARY ( EmployeeID NUMBER, StartDate DATE, SalaryAmount NUMBER, EndDate DATE, PRIMARY KEY (EmployeeID, StartDate), CONSTRAINT FK_SALARY_EMPLOYEE FOREIGN KEY (EmployeeID) REFERENCES EMPLOYEE(EmployeeID) ); CREATE TABLE SHIFT ( ShiftID NUMBER PRIMARY KEY, StartTime TIMESTAMP, EndTime TIMESTAMP, StoreID NUMBER, EmployeeID NUMBER, CONSTRAINT FK_SHIFT_EMPLOYEE FOREIGN KEY (EmployeeID) REFERENCES EMPLOYEE(EmployeeID), CONSTRAINT FK_SHIFT_STORE FOREIGN KEY (StoreID) REFERENCES STORE(StoreID) ); CREATE TABLE REVIEW ( ReviewID NUMBER PRIMARY KEY, CustomerID NUMBER, ProductID NUMBER, ReviewText VARCHAR2(200), ReviewDate DATE, CONSTRAINT FK_REVIEW_CUSTOMER FOREIGN KEY (CustomerID) REFERENCES CUSTOMER(CustomerID), CONSTRAINT FK_REVIEW_PRODUCT FOREIGN KEY (ProductID) REFERENCES PRODUCT(ProductID) ); CREATE TABLE RATING ( RatingID NUMBER PRIMARY KEY, CustomerID NUMBER, ProductID NUMBER, RatingValue NUMBER, RatingDate DATE, CONSTRAINT FK_RATING_CUSTOMER FOREIGN KEY (CustomerID) REFERENCES CUSTOMER(CustomerID), CONSTRAINT FK_RATING_PRODUCT FOREIGN KEY (ProductID) REFERENCES PRODUCT(ProductID) );你能帮我给每个表插入至少十条数据不
时间: 2023-07-15 16:13:10 浏览: 120
好的,以下是每个表插入至少十条数据的 SQL 语句:
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (1, 1, 1, 'Product A', 10.99, 2, 21.98);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (2, 1, 2, 'Product B', 5.99, 3, 17.97);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (3, 2, 3, 'Product C', 7.50, 1, 7.50);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (4, 3, 4, 'Product D', 15.00, 2, 30.00);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (5, 3, 5, 'Product E', 12.99, 1, 12.99);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (6, 4, 6, 'Product F', 8.75, 4, 35.00);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (7, 4, 7, 'Product G', 9.99, 2, 19.98);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (8, 5, 8, 'Product H', 20.00, 1, 20.00);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (9, 5, 9, 'Product I', 6.50, 3, 19.50);
INSERT INTO ORDER_DETAILS (OrderDetailID, OrderID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (10, 5, 10, 'Product J', 3.99, 5, 19.95);
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (1, 'Product A', 'This is product A', 10.99, 'Category 1');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (2, 'Product B', 'This is product B', 5.99, 'Category 1');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (3, 'Product C', 'This is product C', 7.50, 'Category 2');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (4, 'Product D', 'This is product D', 15.00, 'Category 2');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (5, 'Product E', 'This is product E', 12.99, 'Category 2');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (6, 'Product F', 'This is product F', 8.75, 'Category 3');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (7, 'Product G', 'This is product G', 9.99, 'Category 3');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (8, 'Product H', 'This is product H', 20.00, 'Category 4');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (9, 'Product I', 'This is product I', 6.50, 'Category 4');
INSERT INTO PRODUCT (ProductID, ProductName, Description, Price, Category)
VALUES (10, 'Product J', 'This is product J', 3.99, 'Category 4');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (1, 'Store A', '123 Main St, Anytown USA', 'M-F: 9am-9pm, Sat-Sun: 10am-6pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (2, 'Store B', '456 Oak Ave, Anytown USA', 'M-F: 10am-8pm, Sat-Sun: 11am-5pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (3, 'Store C', '789 Pine St, Anytown USA', 'M-F: 8am-10pm, Sat-Sun: 9am-9pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (4, 'Store D', '321 Elm St, Anytown USA', 'M-F: 9am-9pm, Sat-Sun: 10am-6pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (5, 'Store E', '654 Maple Ave, Anytown USA', 'M-F: 10am-8pm, Sat-Sun: 11am-5pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (6, 'Store F', '987 Oak St, Anytown USA', 'M-F: 8am-10pm, Sat-Sun: 9am-9pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (7, 'Store G', '246 Elm Ave, Anytown USA', 'M-F: 9am-9pm, Sat-Sun: 10am-6pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (8, 'Store H', '369 Pine St, Anytown USA', 'M-F: 10am-8pm, Sat-Sun: 11am-5pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (9, 'Store I', '852 Maple St, Anytown USA', 'M-F: 8am-10pm, Sat-Sun: 9am-9pm');
INSERT INTO STORE (StoreID, StoreName, Location, HoursOfOperation)
VALUES (10, 'Store J', '753 Oak Ave, Anytown USA', 'M-F: 9am-9pm, Sat-Sun: 10am-6pm');
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (1, 1, 20, 10);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (2, 1, 30, 15);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (3, 2, 12, 5);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (4, 3, 25, 10);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (5, 3, 18, 8);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (6, 4, 40, 20);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (7, 4, 15, 7);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (8, 5, 8, 3);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (9, 5, 22, 10);
INSERT INTO INVENTORY (ProductID, StoreID, QuantityOnHand, ReorderPoint)
VALUES (10, 5, 35, 15);
INSERT INTO "TRANSACTION" (TransactionID, TransactionDate, TransactionType, TotalAmount, CustomerID)
VALUES (1, SYSDATE, 'Sale', 35.96, 1);
INSERT INTO "TRANSACTION" (TransactionID, TransactionDate, TransactionType, TotalAmount, CustomerID)
VALUES (2, SYSDATE, 'Return', 7.50, 2);
INSERT INTO "TRANSACTION" (TransactionID, TransactionDate, TransactionType, TotalAmount, CustomerID)
VALUES (3, SYSDATE, 'Sale', 60.99, 3);
INSERT INTO "TRANSACTION" (TransactionID, TransactionDate, TransactionType, TotalAmount, CustomerID)
VALUES (4, SYSDATE, 'Sale', 55.98, 4);
INSERT INTO "TRANSACTION" (TransactionID, TransactionDate, TransactionType, TotalAmount, CustomerID)
VALUES (5, SYSDATE, 'Sale', 37.44, 5);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (1, 1, 1, 'Product A', 10.99, 2, 21.98);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (2, 1, 2, 'Product B', 5.99, 3, 17.97);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (3, 2, 3, 'Product C', 7.50, 1, 7.50);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (4, 3, 4, 'Product D', 15.00, 2, 30.00);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (5, 3, 5, 'Product E', 12.99, 1, 12.99);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (6, 4, 6, 'Product F', 8.75, 4, 35.00);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (7, 4, 7, 'Product G', 9.99, 2, 19.98);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (8, 5, 8, 'Product H', 20.00, 1, 20.00);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (9, 5, 9, 'Product I', 6.50, 3, 19.50);
INSERT INTO TRANSACTION_DETAILS (TransactionDetailID, TransactionID, ProductID, ProductName, Price, Quantity, Subtotal)
VALUES (10, 5, 10, 'Product J', 3.99, 5, 19.95);
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (1, 'John Smith', '123 Main St, Anytown USA', '555-1234', 'johnsmith@email.com', 'Manager');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (2, 'Jane Doe', '456 Oak Ave, Anytown USA', '555-5678', 'janedoe@email.com', 'Sales Associate');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (3, 'Bob Johnson', '789 Pine St, Anytown USA', '555-9012', 'bobjohnson@email.com', 'Cashier');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (4, 'Sarah Lee', '321 Elm St, Anytown USA', '555-3456', 'sarahlee@email.com', 'Stock Clerk');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (5, 'Mike Brown', '654 Maple Ave, Anytown USA', '555-7890', 'mikebrown@email.com', 'Assistant Manager');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (6, 'Karen Wilson', '987 Oak St, Anytown USA', '555-2345', 'karenwilson@email.com', 'Sales Associate');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (7, 'Tom Davis', '246 Elm Ave, Anytown USA', '555-6789', 'tomdavis@email.com', 'Cashier');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (8, 'Lisa Green', '369 Pine St, Anytown USA', '555-0123', 'lisagreen@email.com', 'Stock Clerk');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (9, 'David White', '852 Maple St, Anytown USA', '555-4567', 'davidwhite@email.com', 'Assistant Manager');
INSERT INTO EMPLOYEE (EmployeeID, Name, Address, Phone, Email, Position)
VALUES (10, 'Jennifer Adams', '753 Oak Ave, Anytown USA', '555-8901', 'jenniferadams@email.com', 'Sales Associate');
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (1, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 5000, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (2, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 2000, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (3, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 1500, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (4, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 1800, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (5, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 4000, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SALARY (EmployeeID, StartDate, SalaryAmount, EndDate)
VALUES (6, TO_DATE('01-JAN-2021', 'DD-MON-YYYY'), 2000, TO_DATE('31-DEC-2021', 'DD-MON-YYYY'));
INSERT INTO SAL
阅读全文