数据库表的建立

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)

-> );

相关推荐
大白菜和MySQL1 小时前
linux系统环境常用命令
android·linux·adb
Ehtan_Zheng1 小时前
彻底告别 AndroidX 依赖:如何在 KMP 中构建 100% 复用的 UI 逻辑层?
android
Hello小赵1 小时前
C语言如何自定义链接库——编译与调用
android·java·c语言
IT枫斗者2 小时前
构建具有执行功能的 AI Agent:基于工作记忆的任务规划与元认知监控架构
android·前端·vue.js·spring boot·后端·架构
用户69371750013843 小时前
XChat 为什么选择 Rust 语言开发
android·前端·ios
林栩link3 小时前
【车载 Android】实践跨进程 UI 融合渲染
android
Paxon Zhang3 小时前
MySQL 大师之路**数据库约束,表设计,CRUD**
android·数据库·mysql
Indoraptor3 小时前
SurfaceFinger FrameTimeline 分析
android·源码阅读
zh_xuan4 小时前
Android 待办事项增加事项统计
android
zopple4 小时前
Laravel 10.x新特性全解析
android