数据库表的建立

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)

-> );

相关推荐
2301_7717172117 小时前
解决mysql报错:1406, Data too long for column
android·数据库·mysql
dvjr cloi17 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
随遇丿而安20 小时前
第2周:`EditText` 不只是输入框,它是 Android 输入体验的第一道门
android
我命由我1234520 小时前
Kotlin 开发 - lateinit 关键字
android·java·开发语言·kotlin·android studio·android-studio·android runtime
一起搞IT吧20 小时前
Android性能系列专题理论之十:systrace/perfetto相关指标知识点细节含义总结
android·嵌入式硬件·智能手机·性能优化
小书房1 天前
Kotlin的by
android·开发语言·kotlin·委托·by
jinanwuhuaguo1 天前
(第二十八篇)OpenClaw成本与感知的奇点——从“Token封建制”到“全民养虾”的本体论地基
android·人工智能·kotlin·拓扑学·openclaw
xxjj998a1 天前
Laravel4.x核心特性全解析
android·mysql·laravel
JoshRen1 天前
2026教程:在Android Termux中集成Gemini 3镜像站实现移动端文档自动处理与摘要生成(附国内免费方案)
android
诸神黄昏EX1 天前
Android Google KEY
android