数据库表的建立

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)

-> );

相关推荐
91刘仁德4 小时前
MYSQL 事务原理及使用
android·mysql·adb
一笑的小酒馆6 小时前
AndroidKMP之瀑布流实现
android
RainyJiang6 小时前
AI时代下,Android的边界正在消失
android·openai·ai编程
Android-Flutter7 小时前
android 内存抖动详解
android
方白羽8 小时前
为什么 Android 非要用 Intent 传值?
android·ios·harmonyos
方白羽10 小时前
Android17 重写 MessageQueue,解决 Handler 隐性卡顿
android·app
蜡台11 小时前
Kotlin 零基础完整版实战教程|从语法入门到Android工程实战
android·开发语言·kotlin
律宏阔12 小时前
Android 车载 USB 开发笔记:USB Host、USB 串口、USB-CAN、HID 与系统 API
android
律宏阔12 小时前
Android 车载串口开发笔记:UART、RS232、RS485、串口配置与数据通信
android
YF021113 小时前
遥控器APP端自动重连方案
android