基础语句示范
create database sn_order;
-- 创建订单表
create table sn_order_20210412(id varchar(100),order_money float,member_id int,create_time datetime,status int);
-- 插入数据
insert into sn_order_20210412(id,order_money,member_id,create_time,status) values ('A002',100,2,'2017-04-01 14:23:12',2);
sn_order_20210412
id | order_money | member_id | create_time | status |
A002 | 100 | 2 | 2017/4/1 14:23:12 | 2 |
A003 | 12.1 | 3 | 2017/1/1 13:23:12 | 2 |
A004 | 200.15 | 4 | 2017/1/1 13:23:12 | 2 |
A005 | 1200.15 | 5 | 2017/1/1 13:23:12 | 2 |
A006 | 0.15 | 11 | 2017/1/1 17:23:12 | 2 |
A007 | 1215.1 | 31 | 2017/1/1 10:23:12 | 2 |
A008 | 100.75 | 15 | 2017/1/1 14:23:12 | 2 |
A009 | 100.15 | 8 | 2017/1/1 15:23:12 | 2 |
A010 | 20.15 | 9 | 2017/1/1 16:23:12 | 2 |
A011 | 110.15 | 21 | 2017/1/1 14:23:12 | 2 |
A012 | 1.15 | 13 | 2017/1/1 13:03:12 | 2 |
A012 | 1.15 | 13 | 2017/1/1 13:03:12 | 2 |
A014 | 30.15 | 15 | 2017/3/1 13:23:12 | 2 |
A015 | 40.5 | 13 | 2017/1/1 13:23:12 | 2 |
A016 | 65 | 1 | 2016/1/1 13:23:12 | 2 |
A017 | 78.15 | 1 | 2016/3/1 9:23:12 | 1 |
A018 | 88.15 | 1 | 2016/11/1 20:23:12 | 2 |
A019 | 99 | 12 | 2017/2/11 13:23:12 | 1 |
A020 | 10.3 | 13 | 2017/4/1 13:23:12 | 2 |
A001 | 100.15 | 1 | 2017/1/1 13:23:12 | 2 |
A001 | 100.15 | 1 | 2017/1/1 13:23:12 | 2 |
A2222 | 78.15 | 1 | 2017/2/11 13:23:12 | 1 |
A2222 | 78.15 | 1 | 2017/2/11 13:23:12 | 2 |
A00000 | | 9999 | | |
A11111 | 0 | 9999 | | |
A22222 | 20 | 9999 | | |
A2222 | 200 | 9999 | | |
A5555 | 200 | 9999 | | |
A002 | 100.15 | 1 | 2017/2/11 13:23:12 | 2 |
sn_orderitem_20210412
id | order_id | item_id | item_name | price | item_num |
AB001 | A001 | 1001 | A | 0.15 | 1 |
AB002 | A001 | 1002 | B | 20 | 1 |
AB003 | A001 | 1003 | C | 40 | 2 |
AB004 | A005 | 1001 | A | 0.15 | 1 |
AB005 | A005 | 1004 | D | 200 | 6 |
AB0015 | A015 | 1005 | E | 40.5 | 1 |
AB0016 | A019 | 1006 | F | 50 | 1 |
AB0017 | A019 | 1007 | G | 24.5 | 2 |
AB0018 | A020 | 1008 | H | 10.3 | 1 |
AB0001 | | | | | |
字段的数据类型
![](https://i-blog.csdnimg.cn/blog_migrate/203ec35355cdac05a3ce0977909fd971.png)
![](https://i-blog.csdnimg.cn/blog_migrate/9ff9252dfeb89d27c17ea2bc131fb635.png)