数据库表的建立

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)

-> );

相关推荐
YF02111 小时前
如何进入Android工程模式
android
Kevin Coding2 小时前
JsonConvert:适用于 Android、鸿蒙与 Flutter 的 JSON 转 Model 插件
android·flutter·harmonyos
xcLeigh3 小时前
Go入门:基本数据类型全览与选择指南
android·服务器·golang·教程·go热门
alexhilton3 小时前
规范驱动开发:让AI生成符合预期的KMP代码
android·kotlin·android jetpack
码农coding4 小时前
android12 ActivityManagerService开机启动分析
android
Android-Flutter6 小时前
android 性能优化 详解
android·kotlin
vortex56 小时前
composer.json 可写场景下的利用手段
android·json·composer
studyForMokey6 小时前
【Android 内存管理】JVM 内存模型与 GC 原理
android·jvm
夜雪一千17 小时前
MySQL 全局锁是什么?原理、风险、备份踩坑完整实战
android·mysql·adb