数据库表的建立

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)

-> );

相关推荐
nLYA SCOL2 小时前
MySQL数据的增删改查(一)
android·javascript·mysql
Kapaseker2 小时前
高阶函数到底高阶在哪里?
android·kotlin
且随疾风前行.3 小时前
Android 12 (AOSP) 添加自定义系统服务
android
凛_Lin~~3 小时前
Android录音、试听功能实现
android·音频·安卓
三少爷的鞋3 小时前
我是如何把一个传统 Android 协程示例,重构成 Clean Architecture 项目的
android
我重来不说话3 小时前
Android 自动化工作流平台——群控手机
android·智能手机·自动化·工作流·群控
therese_100863 小时前
安卓-触摸事件、事件分发机制及滑动冲突解决方法、CeilingNestedScrollView、常见拖拽容器设计及实现方案
android
张风捷特烈4 小时前
状态管理大乱斗#03 | Provider 源码全面评析
android·前端·flutter
鹏晨互联12 小时前
《Android 自定义 WebView 组件:从封装到路由,打造灵活可复用的混合开发利器》
android
程序员陆业聪12 小时前
AI Code Review:让每一行代码都有AI审查员
android