数据库表的建立

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)

-> );

相关推荐
好的佩奇6 小时前
Dart 之扩展方法
android·flutter·dart
三少爷的鞋8 小时前
换个思路理解:非阻塞挂起
android
好的佩奇9 小时前
蓝牙之经典蓝牙
android·flutter·蓝牙
传奇开心果编程11 小时前
【Flutter踩坑排雷】第19课:路由硬编码坑|字符串路由书写错误,页面跳转失败排查
android·flutter·ios·移动开发·跨平台·ui框架·声明式ui
微小的鱼14 小时前
Linux的渲染与显示系统链路
android·java·linux
道尔柯南1 天前
C++ string 类详解:从常用接口到深拷贝,彻底掌握字符串处理
android·java·c++
唐诺1 天前
5、Android JNI 动态注册中的“签名“详解
android·jni
zhaoshuzhaoshu1 天前
Android 系统启动与调试中的日志抓取方式全解析
android
雨声不在1 天前
android 动画掉帧
android
在多学一点1 天前
MYSQL第二次作业
android·数据库·mysql