数据库表的建立

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)

-> );

相关推荐
e***193510 分钟前
MySQL-触发器(TRIGGER)
android·数据库·mysql
不会写代码的猴子14 分钟前
Android16
android
@游子39 分钟前
SQL注入之文件读写(四)
android·数据库·sql
b***666142 分钟前
【慕伏白教程】Zerotier 连接与简单配置
android·前端·后端
城东米粉儿1 小时前
PropertyValuesHolder与Keyframe 笔记
android
W.Y.B.G1 小时前
vue3项目中集成天地图使用示例
android·前端
Haha_bj1 小时前
二、Kotlin数组(Array)
android·app
t***26591 小时前
万字详解 MySQL MGR 高可用集群搭建
android·mysql·adb
参宿四南河三1 小时前
Android Jetpack 存储篇(DataStore、Room)与 Flow 高效组合
android·app
y***13641 小时前
【MySQL】MVCC详解, 图文并茂简单易懂
android·数据库·mysql