数据库表的建立

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)

-> );

相关推荐
YB137510 小时前
jetpack compose 副作用 SideEffect
android·kotlin
CHB12 小时前
uni-app x 蒸汽模式 性能测试基准报告 Benchmark【Android版】
android·ios·uni-app
带娃的IT创业者13 小时前
拆掉那堵墙:LibrePods 如何让 AirPods 在 Android 上重获新生
android·开源项目·airpods·librepods·生态解锁
_阿南_15 小时前
flutter 展示的字体突然奔放了
android·flutter·ios
文人sec17 小时前
MySQL事务与索引做了什么?
android·笔记·mysql
刘洋浪子18 小时前
AndroidStudio保存日志菜单
android
朱涛的自习室18 小时前
从 Prompt 到 Graph:AI 工程的进化史
android·前端·人工智能
2501_9327502619 小时前
Android 中 Serializable 与 Parcelable 的对比与选择
android
FungLeo20 小时前
Flutter 两个反直觉布局坑:ListTile 水波纹 / VerticalDivider 踩坑实录
android·flutter
1570925113420 小时前
ViewBinding与DataBinding区别与选型
android