数据库表的建立

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)

-> );

相关推荐
虎王物联9 分钟前
PHP实现MQTT消息处理:物联网设备数据接收与指令下发
android·物联网·php
我命由我1234531 分钟前
Android 开发 - 获取当前设备屏幕的旋转角度
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
程序员-Benothing2 小时前
MySQL 索引下推是什么?——深入理解 ICP 原理与实践
android·数据库·mysql
怀化纱厂球迷3 小时前
百度地图--android接入百度地图导航
android
AFinalStone3 小时前
Android 7系统无障碍服务(四)AccessibilityEvent 的产生与投递
android·无障碍服务
智购科技无人售货机工厂4 小时前
2026自动售货机热敏打印模块集成:从串口驱动到小票自动裁切的工程实践~YH
android·stm32·单片机·嵌入式硬件·系统架构
A13345554 小时前
苹果安卓手机播放器推荐:2026无广告4K怎么选
android·智能手机
hunterandroid5 小时前
ContentProvider 跨进程数据共享实战
android·前端
天空之城--6 小时前
Android输入法子系统深度解析
android
天空之城--8 小时前
Android全链路性能优化:从原理到实践的终极指南
android·性能优化