数据库表的建立

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)

-> );

相关推荐
东坡大表哥5 小时前
【Ubuntu】Ubuntu 20.04 LTS → 22.04 LTS 升级实录
android·linux·ubuntu
不要试图纠正别人7 小时前
IdleHandler 一次都不跑,问题不在主线程忙
android·性能优化
booboosui7 小时前
记忆装不下时谁删:500 条上限与每回合十行索引
android
好的佩奇21 小时前
Dart 之 JSON
android·flutter·dart
_祝你今天愉快1 天前
Android 事件传递机制:[一] 事件分发机制详解
android
Digitally1 天前
如何将电脑上的联系人传输到安卓手机(4 种方法)
android
Carson带你学Android1 天前
移动开发周报 :一句话出 App、低端机跑 Gemini、手机写代码
android·ai编程
恋猫de小郭1 天前
站起来,Flutter 要支持真正的 3D Texture 了
android·前端·flutter
FungLeo2 天前
FengCMS · PHP+MySQL 升级实录 · 留言模块的六项问题:未审核进公开列表、旧回复覆盖、批量删除恢复
android·mysql·php·工程实践·fengcms
洞见前行2 天前
Android 架构演进全解:从 MVC、MVP、MVVM 到 MVI 的原理、代码实战与得失权衡
android·架构·kotlin