> For the complete documentation index, see [llms.txt](https://65480539.gitbook.io/gop1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://65480539.gitbook.io/gop1/di-yi-zhang-hou-duan-dai-ma/di-ba-ke.md).

# 第八课

第6-7课没有什么特殊之处，因此略过

本课时主要说的价格表

注意，并非一定要拆表。大部分时候和主表放在一起就可以了。课程里拆表主要是为了实现一些特殊业务逻辑和体现逼格

![](/files/-MNveLUIIYG0e14sXI2w)

#### 建表语句

```
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for course_prices
-- ----------------------------
DROP TABLE IF EXISTS `course_prices`;
CREATE TABLE `course_prices`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`course_id` int(11) NOT NULL COMMENT '商品ID',
`market_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '市场价',
`sale_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '销售价',
`setdate` datetime(0) NULL DEFAULT NULL COMMENT '价格设定时间',
`comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`iscurrent` bit(1) NULL DEFAULT b'0' COMMENT '是否是当前价格',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
```

课后作业

#### 根据前面几课时的内容把 相关字段划分值对象


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://65480539.gitbook.io/gop1/di-yi-zhang-hou-duan-dai-ma/di-ba-ke.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
