![](https://i-blog.csdnimg.cn/direct/85f5c064992c45c584c5f4fca8d6621f.png)
创建数据库
mysql> create database mydb6_product;
Query OK, 1 row affected (0.00 sec)
mysql> use mydb6_product;
Database changed
mysql> select database();
+---------------+
| database() |
+---------------+
| mydb6_product |
+---------------+
employees表
create table employees(
id int primary key,
name char(50) not null,
age int,gender char(10) not null default "unknown",
salary float);
orders表
create table orders(
id int primary key,
name char(100) not null,
price float,
quantity int,
category char(50));
invoices表
create table invoices (
number int primary key,
order_id int,
in_date date,
total_amount float not null,
foreign key (order_id) references orders(id));