数据库表的建立

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)

-> );

相关推荐
xcLeigh1 小时前
KingbaseES数据库教程:初识数据库,从安装到跑通第一条SQL
android·数据库·sql·安装·数据库教程·kes
TimeFine5 小时前
AI 编码工作流的设计(二)
android·ai编程
2401_881828325 小时前
MySQL操作命令
android·mysql·adb
用户60709759149066 小时前
AOSP 14 OTA 升级指导(三):三条升级链路——Java API、自研 HAL 与 TR069
android
前端小D7 小时前
React Native Android 项目搭建
android·react native·react.js
恋猫de小郭8 小时前
感人,Flutter 居然有了一个超实用提案,期待落地
android·前端·flutter
CS_Zero9 小时前
安卓开发:Linux的android工具命令
android·linux·运维
fellow999 小时前
DSH Desktop - Android Edition
android·agent·deepseek·harness·dsh
Carson带你学Android9 小时前
Android Studio Rabbit 2 发布:除了Gemini,40+ AI Agent 正式入驻!
android·ai编程
三少爷的鞋1 天前
Java 线程自上而下,Kotlin 协程自下而上
android