数据库表的建立

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)

-> );

相关推荐
赏金术士6 小时前
Kotlin 数据流与单双向绑定
android·开发语言·kotlin
小白学鸿蒙7 小时前
Unity 3D 2023解压安装,配置安卓运行环境后打包安卓应用(踩坑无数之差点放弃)
android·unity·游戏引擎
阿巴斯甜8 小时前
2026小知识点(9)
android
古月-一个C++方向的小白9 小时前
MySQL数据库——数据类型
android·数据库·mysql
张小潇11 小时前
AOSP15 WMS/AMS系统开发 - WindowManagerService finishDraw与prepareSurface流程详解
android
帅次13 小时前
Modifier 链与顺序、测量与命中区域
android·kotlin·compose·modifier
leory14 小时前
请详细描述Handler消息机制的工作原理
android·面试
leory14 小时前
请描述Binder IPC的基本原理和工作流程
android·面试
leory14 小时前
View的事件分发机制是怎样的?dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent的关系?
android·面试
zander25814 小时前
Canal本地部署保姆级教程
android