数据库表的建立

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)

-> );

相关推荐
StackNoOverflow1 天前
MySQL Explain 返回列详解:从入门到实战,附 SQL 与避坑大全
android
CYRUS_STUDIO1 天前
Frida 检测与对抗实战:进程、maps、线程、符号全特征清除
android·逆向
csj501 天前
安卓基础之《(28)—Service组件》
android
lhbian2 天前
PHP、C++和C语言对比:哪个更适合你?
android·数据库·spring boot·mysql·kafka
catoop2 天前
Android 最佳实践、分层架构与全流程解析(2025)
android
ZHANG13HAO2 天前
Android 13 特权应用(Android Studio 开发)调用 AOSP 隐藏 API 完整教程
android·ide·android studio
田梓燊2 天前
leetcode 142
android·java·leetcode
angerdream2 天前
Android手把手编写儿童手机远程监控App之JAVA基础
android
菠萝地亚狂想曲2 天前
Zephyr_01, environment
android·java·javascript
sTone873752 天前
跨端框架通信机制全解析:从 URL Schema 到 JSI 到 Platform Channel
android·前端