CREATE TABLE B ( Bno INT(10) PRIMARY KEY, Bname VARCHAR(50), Bauthor VARCHAR(50), Bprice DECIMAL(10, 2), Pname VARCHAR(50), Pdate DATE ); CREATE TABLE C ( Cno INT(10) PRIMARY KEY, Cname VARCHAR(50), Csex VARCHAR(10), Cbirthday DATE, Caddress VARCHAR(100), Cmobile VARCHAR(20) ); CREATE TABLE S ( Sno INT(10) PRIMARY KEY, Bno INT(10), Cno INT(10), Scount INT(10), Ssum DECIMAL(10, 2), Sdate DATE, FOREIGN KEY (Bno) REFERENCES B(Bno), FOREIGN KEY (Cno) REFERENCES C(Cno) ); -- 创建库存表BW: CREATE TABLE BW ( Bno INT(10), Wno INT(10), num INT(10), PRIMARY KEY (Bno, Wno), FOREIGN KEY (Bno) REFERENCES B(Bno), FOREIGN KEY (Wno) REFERENCES W(Wno) ); -- 创建仓库表W: CREATE TABLE W ( Wno INT(10) PRIMARY KEY, Wname VARCHAR(50), Waddress VARCHAR(100) );给出上述表的几组数据并给出插入语句
时间: 2024-02-10 11:33:15 浏览: 55
给出表B的数据和插入语句:
| Bno | Bname | Bauthor | Bprice | Pname | Pdate |
| --- | ----------| ----------| ------ | --------| ----------|
| 101 | Book A | Author A | 50.00 | Publisher A | 2021-01-01 |
| 102 | Book B | Author B | 80.00 | Publisher B | 2021-02-02 |
| 103 | Book C | Author C | 60.50 | Publisher C | 2021-03-03 |
插入语句:
INSERT INTO B (Bno, Bname, Bauthor, Bprice, Pname, Pdate) VALUES
(101, 'Book A', 'Author A', 50.00, 'Publisher A', '2021-01-01'),
(102, 'Book B', 'Author B', 80.00, 'Publisher B', '2021-02-02'),
(103, 'Book C', 'Author C', 60.50, 'Publisher C', '2021-03-03');
给出表C的数据和插入语句:
| Cno | Cname | Csex | Cbirthday | Caddress | Cmobile |
| --- | --------| -----| ----------| ----------------| ----------|
| 201 | Customer A | Male | 1990-01-01 | Address A, City A | 1234567890 |
| 202 | Customer B | Female | 1995-02-02 | Address B, City B | 2345678901 |
| 203 | Customer C | Male | 1985-03-03 | Address C, City C | 3456789012 |
插入语句:
INSERT INTO C (Cno, Cname, Csex, Cbirthday, Caddress, Cmobile) VALUES
(201, 'Customer A', 'Male', '1990-01-01', 'Address A, City A', '1234567890'),
(202, 'Customer B', 'Female', '1995-02-02', 'Address B, City B', '2345678901'),
(203, 'Customer C', 'Male', '1985-03-03', 'Address C, City C', '3456789012');
给出表S的数据和插入语句:
| Sno | Bno | Cno | Scount | Ssum | Sdate |
| --- | --- | --- | ------ | ------ | ----------|
| 301 | 101 | 201 | 2 | 100.00 | 2021-04-01 |
| 302 | 102 | 202 | 1 | 80.00 | 2021-05-02 |
| 303 | 103 | 203 | 3 | 181.50 | 2021-06-03 |
插入语句:
INSERT INTO S (Sno, Bno, Cno, Scount, Ssum, Sdate) VALUES
(301, 101, 201, 2, 100.00, '2021-04-01'),
(302, 102, 202, 1, 80.00, '2021-05-02'),
(303, 103, 203, 3, 181.50, '2021-06-03');
给出表W的数据和插入语句:
| Wno | Wname | Waddress |
| --- | -----------| -----------------|
| 1 | Warehouse A| Address A, City A |
| 2 | Warehouse B| Address B, City B |
| 3 | Warehouse C| Address C, City C |
插入语句:
INSERT INTO W (Wno, Wname, Waddress) VALUES
(1, 'Warehouse A', 'Address A, City A'),
(2, 'Warehouse B', 'Address B, City B'),
(3, 'Warehouse C', 'Address C, City C');
给出表BW的数据和插入语句:
| Bno | Wno | num |
| --- | --- | --- |
| 101 | 1 | 20 |
| 101 | 2 | 30 |
| 102 | 2 | 50 |
| 103 | 3 | 10 |
插入语句:
INSERT INTO BW (Bno, Wno, num) VALUES
(101, 1, 20),
(101, 2, 30),
(102, 2, 50),
(103, 3, 10);
阅读全文