数据库表的建立

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)

-> );

相关推荐
程序者王大川1 小时前
【鸿蒙学习】java后端学鸿蒙开发有什么好处呢?
android·java·开发语言·经验分享·学习·华为·harmonyos
命运之手1 小时前
【Android】根据URI获取文件扩展名或MimeType
android·extension·uri·mimetype
菠萝加点糖4 小时前
Android 设置动态库依赖路径
android·动态库·jni
EQ-雪梨蛋花汤4 小时前
【Sceneform-EQR】scenefrom-eqr中的几种背景实现(不仅用于AR、三维场景,在图片、视频播放器中也适用)
android·音视频·移动端ar
剁椒排骨5 小时前
polarctf靶场[WEB]Don‘t touch me、机器人、uploader、扫扫看
android·前端·网络安全·web·ctf·变量覆盖·robot协议
居安思危_Ho5 小时前
【Android Kotlin】Kotlin协程介绍
android·开发语言·kotlin·协程·kotlin协程
程序猿陌名!5 小时前
Android活动(activity)与服务(service)进行通信
android
A Master5 小时前
网络安全之DC-1靶机渗透实验
android·安全·web安全
黑心的奥利奥7 小时前
安卓APK重签名并查看MD5值-2024最新版
android
marsjin7 小时前
自定义Android 应用对话框组件 - CustomDialog
android