数据库表的建立

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)

-> );

相关推荐
我不会插花弄玉31 分钟前
7.函数【由浅入深-MySQL】
android·数据库·mysql
vilya1 小时前
手机端 Agent 怎么动起来:Kotlin 与 Python 之间的桥
android·agent
高晶1 小时前
Android 新手实战:从零搭建 WebRTC 在线直播系统
android·程序员
alexhilton1 小时前
为什么你的 LazyColumn 仍然卡顿
android·kotlin·android jetpack
>Andre<3 小时前
系统架构全景
android
hai_android7 小时前
Android 嵌套滑动冲突:内部拦截 vs 外部拦截实战
android·android studio·android jetpack
木子欢儿9 小时前
Zabbix 7.4 Alpine 版 Docker Compose 部署
android·运维·docker·容器·zabbix
素师良码9 小时前
第9篇:Android驱动踩坑实录:DSI RX FIFO前置脏0、数据错位复盘
android
夜雪一千10 小时前
如何在MySQL中实现字段级加密
android·数据库·mysql
夜雪一千10 小时前
MySQL 如何存储经纬度坐标:选型、建表、空间查询实战
android·mysql·adb