数据库作业1

Windows安装MySql8.0 mis格式:

  1. 前往官方网站下载所需要的安装包
  2. 根据向导安装mysql
  3. 编辑环境变量

安装完成

注:尽量在主机用户名中不要含有汉字

新建产品库mydb6_ product, 新建4张表如下:

employees表

列1: id , 整型, 主键

列2: name, 字符串, 最大长度50, 不能为空

列3: age, 整型

列4: gender, 字符串, 最大长度10, 不能为空, 默认值" unknown"

列5: salary, 浮点型

orders表

列1: id, 整型, 主键

列2: name, 字符串, 最大长度100, 不能为空

列3: price, 浮点型

列4: quantity, 整型

列5: category, 字符串, 最大长度50

invoices表

列1: number, 整型, 主键自增长

列2: order _ id, 整型, 外键关联到 orders表的 id列

列3: in _ date: 日期型

列4: total _ amount: 浮点型, 要求数据大于0

建立数据库mydb6_product:

建立employees表:

建立orders表:

建立invoices表:

show tables:

相关推荐
醇醛酸醚酮酯21 分钟前
Qt项目锻炼——TODO清单(二)
开发语言·数据库·qt
GreatSQL社区1 小时前
用systemd管理GreatSQL服务详解
数据库·mysql·greatsql
掘根1 小时前
【MySQL进阶】错误日志,二进制日志,mysql系统库
数据库·mysql
weixin_438335401 小时前
基础知识:mysql-connector-j依赖
数据库·mysql
小明铭同学1 小时前
MySQL 八股文【持续更新ing】
数据库·mysql
Mr_Xuhhh1 小时前
信号与槽的总结
java·开发语言·数据库·c++·qt·系统架构
Fireworkitte2 小时前
Redis 源码 tar 包安装 Redis 哨兵模式(Sentinel)
数据库·redis·sentinel
qq_339282232 小时前
postgressql 如何修改模式的所有表的所有者
数据库
西岭千秋雪_3 小时前
Redis性能优化
数据库·redis·笔记·学习·缓存·性能优化