数据库表的建立

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)

-> );

相关推荐
王者鳜錸11 小时前
Android 接入 AIKit 轻量版语音合成实战
android·交互·多语种·离线合成·多种发音人
『 时光荏苒 』11 小时前
SQL 中常用的查询条件分类汇总,每个都配有“大白话注释”和示例,方便你对照学习
android·java·开发语言
智购科技自动贩卖机12 小时前
自动售货机SaaS多租户数据库实战:分库分表与租户隔离~YH
android·java·linux·开发语言·javascript·网络
遥不可及zzz13 小时前
Android 接入 Helpshift SDK 详细教程(Java 实战):客服聊天、FAQ、用户登录及消息推送
android·helpshift
Digitally13 小时前
通过蓝牙将文件从 iPhone 传输到 Android
android
程序猿老A13 小时前
轻量应用服务器怎么配置mysql
android·mysql·adb
weixin_394758031 天前
CRMEB Pro 优惠券:下单怎么核销,取消/退款怎么返券
android
alexhilton1 天前
Android 17 内存预算成为必修课
android·kotlin·android jetpack
AI2中文网1 天前
App Inventor 对接 OneNet:手机收数据
android·鸿蒙·app inventor
好的佩奇1 天前
Dart 之文件读写
android·flutter·dart