数据库表的建立

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 小时前
SystemUI 启动与组成机制
android·源码·源码阅读
黄林晴2 小时前
Kotlin 2.4.0 正式稳定!Android 升级、Compose、KMP 全变化详解
android·kotlin
恋猫de小郭4 小时前
Android 官方给 Compose 搞了个不需要 UI 环境的 Composable
android·前端·flutter
珊瑚里的鱼5 小时前
C++的强制类型转换
android·开发语言·c++
问心无愧05135 小时前
ctf show web入门102
android·java·前端·笔记
Kapaseker6 小时前
Kotlin 相等的奥义
android·kotlin
Lyyaoo.6 小时前
【MySQL】锁机制
android·数据库·mysql
DS随心转插件6 小时前
DeepSeek 代码手机端导出与 AI 辅助方案实测
android·人工智能·chatgpt·智能手机·deepseek·ai导出鸭
JohnnyDeng946 小时前
【Android】Flow vs LiveData:选型指南与迁移实践
android·kotlin·livedata·flow
plainGeekDev6 小时前
线程安全集合 → 协程安全替代
android·java·kotlin