mysql 第一次作业

employees:

       代码: CREATE TABLE `employees` (
  `id` int NOT NULL,
  `name` varchar(50) NOT NULL,
  `age` int DEFAULT NULL,
  `gender` varchar(10) NOT NULL DEFAULT 'unknown',
  `salary` float DEFAULT NULL,
  PRIMARY KEY (`id`)
);invoices:

        代码: CREATE TABLE `invoices` (
  `number` int NOT NULL AUTO_INCREMENT,
  `order_id` int DEFAULT NULL,
  `in_date` date DEFAULT NULL,
  `total_amount` float DEFAULT NULL,
  PRIMARY KEY (`number`),
  KEY `order_id` (`order_id`),
  CONSTRAINT `invoices_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
  CONSTRAINT `invoices_chk_1` CHECK ((`total_amount` > 0))
);

orders:

        代码: orders | CREATE TABLE `orders` (
  `id` int NOT NULL,
  `name` varchar(100) NOT NULL,
  `price` float DEFAULT NULL,
  `quantity` int DEFAULT NULL,
  `category` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 05:38:01       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 05:38:01       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 05:38:01       58 阅读
  4. Python语言-面向对象

    2024-07-18 05:38:01       69 阅读

热门阅读

  1. Django+vue自动化测试平台(28)-- ADB获取设备信息

    2024-07-18 05:38:01       23 阅读
  2. 2024牛客暑期多校训练营1 I.Mirror Maze(题解)

    2024-07-18 05:38:01       21 阅读
  3. 浅谈Git

    浅谈Git

    2024-07-18 05:38:01      22 阅读
  4. 力扣649.Dota2参议院

    2024-07-18 05:38:01       25 阅读
  5. 将数据集转为hdf5格式

    2024-07-18 05:38:01       22 阅读
  6. 【大模型】如何书写好的prompt

    2024-07-18 05:38:01       21 阅读
  7. 设计模式大白话之装饰者模式

    2024-07-18 05:38:01       19 阅读
  8. 8个步骤彻底清理Docker镜像

    2024-07-18 05:38:01       27 阅读
  9. C#调用非托管dll,并从dll中再调用C#中的方法

    2024-07-18 05:38:01       23 阅读
  10. tomcat日志与log4j日志保留最近7天

    2024-07-18 05:38:01       23 阅读