数据库表的建立
1.create database mydb6_product;
2.use mydb6_product;
3.mysql> create table employees(
-> id int(5) primary key,
-> name varchar(50) not null,
-> age int(10),
-> gender varchar(10) not null,
-> salary float(10,2)
-> );
4.mysql> create table orders(
-> id int(10) primary key,
-> name varchar(100) not null,
-> price float(10,2),
-> quantity int(10),
-> category char(50)
-> );
5.mysql> create table invoices(
-> order_id int ,
-> in_date date,
-> total_amount decimal(2,10) check (total_amount > 0),
-> foreign key (order_id) references orders(id)
-> );
原文地址:https://blog.csdn.net/2301_78530830/article/details/140500281
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!