数据库表的建立

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)

-> );

相关推荐
broadview_java16 小时前
使用 ConstraintLayout 构建自适应界面
android
wy31362282119 小时前
android——开发中的常见Bug汇总与解决方案(闪退)
android·bug
小小测试开发20 小时前
实战派SQL性能优化:从语法层面攻克项目中的性能瓶颈
android·sql·性能优化
QuantumLeap丶21 小时前
《Flutter全栈开发实战指南:从零到高级》- 26 -持续集成与部署
android·flutter·ios
StarShip1 天前
从Activity.setContentView()开始
android
千里马学框架1 天前
重学SurfaceFlinger之Layer显示区域bounds计算剖析
android·智能手机·sf·安卓framework开发·layer·surfaceflinger·车载开发
nono牛1 天前
安卓休眠与唤醒流程
android
二流小码农1 天前
鸿蒙开发:个人开发者如何使用华为账号登录
android·ios·harmonyos
StarShip1 天前
Android View框架概览
android·计算机图形学
愤怒的代码1 天前
解析Android内存分析的指标
android·app