数据库表的建立

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)

-> );

相关推荐
MasterLi802325 分钟前
我的读书清单
android·linux·学习
怪兽20141 小时前
fastjson在kotlin不使用kotlin-reflect库怎么使用?
android·开发语言·kotlin
彭同学学习日志1 小时前
Kotlin Fragment 按钮跳转报错解决:Unresolved reference ‘floatingActionButton‘
android·开发语言·kotlin
Gracker2 小时前
Android Perfetto 系列 9 - CPU 信息解读
android
Gracker2 小时前
Android Perfetto 系列 8:深入理解 Vsync 机制与性能分析
android
Gracker2 小时前
Android Perfetto 系列 07 - MainThread 和 RenderThread 解读
android
Gracker2 小时前
Android Perfetto 系列 5:Android App 基于 Choreographer 的渲染流程
android
Gracker3 小时前
Android Perfetto 系列 6:为什么是 120Hz?高刷新率的优势与挑战
android
apigfly3 小时前
Flutter,Compose,Web 在Android平台上从布局到屏幕的机制探究
android·flutter·webview
czhc11400756634 小时前
Java1112 基类 c#vscode使用 程序结构
android·java·数据库