[
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库（Database）是按照数据结构来组织、存储和管理数据的仓库。"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                563,
                105
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "每个数据库都有一个或多个不同的 API 用于创建，访问，管理，搜索和复制所保存的数据。"
                    }
                ]
            },
            "bbox": [
                144,
                112,
                680,
                124
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "我们也可以将数据存储在文件中，但是在文件中读写数据速度相对较慢。"
                    }
                ]
            },
            "bbox": [
                144,
                131,
                573,
                143
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "所以，现在我们使用关系型数据库管理系统（RDBMS）来存储和管理大数据量。所谓的关系型数据库，是建立在关系模型基础上的数据库，借助于集合代数等数学概念和方法来处理数据库中的数据。"
                    }
                ]
            },
            "bbox": [
                144,
                149,
                842,
                181
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "RDBMS 术语"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                193,
                336,
                217
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在我们开始学习MySQL 数据库前，让我们先了解下RDBMS的一些术语："
                    }
                ]
            },
            "bbox": [
                146,
                227,
                584,
                239
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "数据库: 数据库是一些关联表的集合。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "数据表: 表是数据的矩阵。在一个数据库中的表看起来像一个简单的电子表格。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "列: 一列(数据元素) 包含了相同类型的数据, 例如邮政编码的数据。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": " 行：一行（元组，或记录）是一组相关的数据，例如一条用户订阅的数据。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "冗余：存储两倍数据，冗余降低了性能，但提高了数据的安全性。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "主键：主键是唯一的。一个数据表中只能包含一个主键。你可以使用主键来查询数据。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "外键：外键用于关联两个表。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": ". 复合键：复合键（组合键）将多个列作为一个索引键，一般用于复合索引。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "索引：使用索引可快速访问数据库表中的特定信息。索引是对数据库表中一列或多列的值进行排序的一种结构。类似于书籍的目录。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": ". 参照完整性: 参照的完整性要求关系中不允许引用不存在的实体。与实体完整性是关系模型必须满足的完整性约束条件，目的是保证数据的一致性。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "表头(header): 每一列的名称;"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": ". 列(col): 具有相同数据类型的数据的集合;"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "行(row): 每一行用来描述某条记录的具体信息;"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "值(value): 行的具体信息, 每个值必须与该列的数据类型相同;"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "键(key): 键的值在当前列中具有唯一性。、"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                132,
                246,
                845,
                728
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "虽然查找表和视图表在形式上都可以被视为“表”，但它们之间有几个重要的区别："
                    }
                ]
            },
            "bbox": [
                134,
                747,
                626,
                760
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "特性"
                    }
                ]
            },
            "bbox": [
                134,
                778,
                166,
                791
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查找表（物理表）"
                    }
                ]
            },
            "bbox": [
                208,
                778,
                312,
                791
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图表（虚拟表）"
                    }
                ]
            },
            "bbox": [
                403,
                778,
                505,
                791
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据存储"
                    }
                ]
            },
            "bbox": [
                134,
                822,
                193,
                833
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储实际数据"
                    }
                ]
            },
            "bbox": [
                208,
                822,
                294,
                833
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "不存储数据，只包含查询逻辑"
                    }
                ]
            },
            "bbox": [
                416,
                812,
                594,
                825
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "基于查询结果动态生成"
                    }
                ]
            },
            "bbox": [
                403,
                831,
                541,
                843
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "性能"
                    }
                ]
            },
            "bbox": [
                134,
                864,
                166,
                875
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询时直接操作存储的数据"
                    }
                ]
            },
            "bbox": [
                208,
                864,
                373,
                875
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询时动态执行SQL语句，可能会有额外开销"
                    }
                ]
            },
            "bbox": [
                403,
                864,
                673,
                876
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "更新操作 数据可更新，直接修改表中的数据对视图的更新可能会有限制，特别是当视图涉及多个表时"
                    }
                ]
            },
            "bbox": [
                132,
                128,
                742,
                141
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "复杂查询封装不支持复杂的查询封装"
                    }
                ]
            },
            "bbox": [
                132,
                161,
                347,
                174
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "支持复杂查询封装，可以简化访问"
                    }
                ]
            },
            "bbox": [
                401,
                161,
                610,
                174
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询方式 直接查询表"
                    }
                ]
            },
            "bbox": [
                134,
                193,
                280,
                206
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询视图会间接查询底层表。作为表使用"
                    }
                ]
            },
            "bbox": [
                401,
                193,
                650,
                206
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "您可以使用 MySQL 二进制方式进入到 mysql 命令提示符下来连接 MySQL 数据库，格式如下："
                    }
                ]
            },
            "bbox": [
                132,
                225,
                675,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "mysql -u your_username -p "
                    }
                ]
            },
            "bbox": [
                132,
                256,
                290,
                269
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据库技术中的四个名词"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                292,
                485,
                317
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "DB：数据库（Database),DB 是统一管理的相关数据的集合。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "DBMS：数据库管理系统（Database Management System)，DBMS 是位于用户与操作系统之间的一层数据管理软件，为用户或应用程序提供访问DB的方法，包括DB的建立、查询、更新及各种数据控制。DBMS总是基于某种数据模型，可以分为层次型、网状型、关系型、面向对象型 DBMS。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "DBS：数据库系统（Database System),DBS是实现有组织地、动态地存储大量关联数据，方便多用户访问的计算机软件、硬件和数据资源组成的系统，即采用了数据库技术的计算机系统。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "DBA：数据库管理员。是DBS中的一类人员，或者公司的一个岗位名称。是从事管理和维护数据库管理系统(DBMS)的相关工作人员的统称，他属于运维工程师的一个分支，主要负责业务数据库从设计、测试、部署交付到运行监控的全生命周期管理。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "数据库技术：是一门研究数据库结构、存储、管理和使用的软件学科。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                174,
                326,
                853,
                546
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "DBMS的主要功能:"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                556,
                368,
                577
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）数据库的定义功能 DDL打开SSMS（客户端工具：图形化/SQL语句）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）数据库的操纵功能 DML（对数据进行增删改：Insert、delete、Update（更新））"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                159,
                586,
                806,
                620
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）数据库的保护功能(实现保护的四个子系统）安全性、完整性、并发控制、备份恢复访问控制"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4）数据库的存储管理 （物理存储）DBA 工作"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（5）数据库的维护功能 （数据字典：DD元数据：数据的数据 Master数据库中的Sys表，系统配置）"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                623,
                853,
                712
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DBS "
                    }
                ]
            },
            "bbox": [
                147,
                715,
                181,
                728
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.1 DBS 的组成"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                734,
                263,
                749
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DBS是采用了数据库技术的计算机系统。DBS是一个实际可运行的， 按照数据库方法存储、维护和向应用系统提供数据支持的计算机系统。"
                    }
                ]
            },
            "bbox": [
                144,
                753,
                855,
                785
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DBS由四部分组成：数据库(DB)、硬件、软件、数据库用户"
                    }
                ]
            },
            "bbox": [
                144,
                790,
                601,
                804
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库用户可分为：DBA，专业用户，专业程序员，最终用户。"
                    }
                ]
            },
            "bbox": [
                144,
                809,
                630,
                822
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(主要理解 DB 和 DBA)"
                    }
                ]
            },
            "bbox": [
                146,
                827,
                312,
                841
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DBA是控制数据整体结构的人，负责DBS的正常运行。DBA可以是一个人，在大型系统中也可以是由几个人组成的小组。"
                    }
                ]
            },
            "bbox": [
                144,
                845,
                847,
                879
            ]
        },
        {
            "type": "page_header",
            "content": {
                "page_header_content": [
                    {
                        "type": "text",
                        "content": "特性"
                    }
                ]
            },
            "bbox": [
                134,
                95,
                166,
                108
            ]
        },
        {
            "type": "page_header",
            "content": {
                "page_header_content": [
                    {
                        "type": "text",
                        "content": "查找表（物理表）"
                    }
                ]
            },
            "bbox": [
                208,
                95,
                312,
                108
            ]
        },
        {
            "type": "page_header",
            "content": {
                "page_header_content": [
                    {
                        "type": "text",
                        "content": "视图表（虚拟表）"
                    }
                ]
            },
            "bbox": [
                403,
                95,
                507,
                108
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DBA 的主要职责有五点："
                    }
                ]
            },
            "bbox": [
                144,
                112,
                334,
                126
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）概念模式定义"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）内模式定义"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）根据要求修改数据库的概念模式和内模式"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4）对数据库访问的授权"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（5）完整性约束的说明"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                161,
                130,
                517,
                219
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.1 数据库应用软件结构的发展"
                    }
                ],
                "level": 1
            },
            "bbox": [
                152,
                223,
                400,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "从单用户、Client/Server 模式（局域网）、Browser/Server 模式（互联网）、C/S 和 B/S 混合结构"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                847,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "4.2 C/S "
                    }
                ]
            },
            "bbox": [
                146,
                297,
                203,
                310
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "C/S是将需要处理的业务合理地分配到客户端和服务器端，这样可以大大降低通信成本，但是升级维护相对困难。"
                    }
                ]
            },
            "bbox": [
                144,
                315,
                836,
                350
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "了解客户端和服务器端的分工。"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                386,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "4.3 B/S "
                    }
                ]
            },
            "bbox": [
                146,
                390,
                203,
                401
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "B/S结构是随着互联网的发展，web出现后兴起的一种网络结构模式。这种模式统一了客户端，让核心的业务处理在服务端完成。B/S维护和升级方式更简单。由于客户端是浏览器，基本不需要维护，只需要维护升级服务器端。但安全性上不如C/S可控。"
                    }
                ]
            },
            "bbox": [
                144,
                407,
                855,
                461
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据库的体系结构"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                482,
                292,
                497
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "5.1 三级模式结构"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                501,
                284,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "三级模式、二级映像的目的：为了提高数据的独立性。"
                    }
                ]
            },
            "bbox": [
                146,
                519,
                564,
                535
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库的体系结构分为三级：内部级、概念级和外部级(数据抽象的三个级别）"
                    }
                ]
            },
            "bbox": [
                144,
                538,
                749,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)外部级：单个用户所能看到的数据特性；"
                    }
                ]
            },
            "bbox": [
                146,
                557,
                480,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "单个用户使用的数据视图的描述称“外模式”，又称“子模式”。（最接近用户）"
                    }
                ]
            },
            "bbox": [
                152,
                574,
                784,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)概念级：涉及到所有用户的数据定义，是全局的数据视图；"
                    }
                ]
            },
            "bbox": [
                146,
                594,
                620,
                609
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "全局数据视图的描述称“概念模式”，又称“模式”。"
                    }
                ]
            },
            "bbox": [
                152,
                612,
                573,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3)内部级：最接近于物理存储，涉及到实际数据存储的结构；"
                    }
                ]
            },
            "bbox": [
                146,
                631,
                618,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "物理存储视图的描述称为“内模式”。"
                    }
                ]
            },
            "bbox": [
                152,
                649,
                450,
                664
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(进一步理解三级模式的具体含义，并掌握两个映象。)"
                    }
                ]
            },
            "bbox": [
                146,
                668,
                569,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据按外模式的描述提供给用户（应用程序），按内模式的描述存储在磁盘中， 而概念模式提供了连接这两级的相对稳定的中间观点，并使得任何一级的改变都不受另一级的牵制。"
                    }
                ]
            },
            "bbox": [
                144,
                686,
                848,
                738
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)概念模式 （模式）：具体含义；（模式 DDL）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)外模式：具体含义；（外模式 DDL）"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                741,
                514,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外模式又称为“用户模式”或“子模式”，通常是概念模式的逻辑子集。"
                    }
                ]
            },
            "bbox": [
                164,
                778,
                724,
                794
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)内模式：具体含义；（内模式 DDL）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4)模式/内模式映象：用于定义概念模式和内模式之间的对应性。一般在内模式中描述。保证数据的物理独立性。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5)外模式/模式映象：用于定义外模式和概念模式间的对应性。在外模式中描述。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                797,
                835,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "保证数据的逻辑独立性"
                    }
                ]
            },
            "bbox": [
                146,
                872,
                327,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1) 物理数据独立性：修改内模式时尽量不影响概念模式及外模式，从而达到不影响既有应"
                    }
                ]
            },
            "bbox": [
                144,
                890,
                847,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用程序的目的。"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                263,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2) 逻辑数据独立性：修改概念模式时尽量不影响外模式和应用程序，从而达到不影响既有应用程序的目的。"
                    }
                ]
            },
            "bbox": [
                144,
                112,
                847,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                146,
                148,
                381,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：主要是一些基本概念"
                    }
                ]
            },
            "bbox": [
                144,
                168,
                381,
                183
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "三个世界：现实世界、信息世界、数据世界"
                    }
                ]
            },
            "bbox": [
                144,
                204,
                487,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对应模型：信息世界：概念模型（ER 图或者 UML 表达概念模型）"
                    }
                ]
            },
            "bbox": [
                144,
                223,
                643,
                239
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据世界：先设计出逻辑模型再转化为物理模型（我们只讨论关系数据模型，其他模型只需大致了解）"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                847,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对应概念： 对象- 实体 -元组（记录）"
                    }
                ]
            },
            "bbox": [
                144,
                279,
                473,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "一类对象—>实体集—>关系（表）"
                    }
                ]
            },
            "bbox": [
                186,
                297,
                445,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "特性—>属性 属性"
                    }
                ]
            },
            "bbox": [
                201,
                315,
                364,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "域  域"
                    }
                ]
            },
            "bbox": [
                233,
                334,
                307,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "码  码（候选码、主码）"
                    }
                ]
            },
            "bbox": [
                233,
                351,
                436,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对象间的联系—》实体集间的联系—》属性、关系（表），外码"
                    }
                ]
            },
            "bbox": [
                186,
                370,
                685,
                387
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "采用ER方法进行数据库概念设计分成三步进行："
                    }
                ]
            },
            "bbox": [
                144,
                390,
                519,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "实体、属性、实体集、联系、域、码 "
                    }
                ]
            },
            "bbox": [
                144,
                407,
                433,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "联系的类型（阶）：1：1、1：N（或者 N：1）、M：N"
                    }
                ]
            },
            "bbox": [
                144,
                426,
                574,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)设计局部 ER 模式"
                    }
                ]
            },
            "bbox": [
                146,
                482,
                302,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "确定局部结构范围；实体定义；联系定义；属性分配"
                    }
                ]
            },
            "bbox": [
                161,
                501,
                573,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)设计全局ER模式"
                    }
                ]
            },
            "bbox": [
                147,
                520,
                302,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "确定公共实体类型；局部ER模型的合并；消除冲突 "
                    }
                ]
            },
            "bbox": [
                161,
                538,
                563,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3)全局ER模式进行优化"
                    }
                ]
            },
            "bbox": [
                147,
                557,
                337,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "实体类型的合并；冗余属性的消除；冗余联系的消除 "
                    }
                ]
            },
            "bbox": [
                161,
                575,
                573,
                590
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1) 二维表格 在关系模型中，一张二维表格对应一个关系。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2) 元组 表中的一行（即一个记录），表示一个实体；关系是由元组组成的。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3) 域 是一组具有相同数据类型的值的集合。（属性的取值范围）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4) 笛卡尔积域上的一种集合运算。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5) 关系：是一个元数为 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathsf { K } ( \\mathsf { K } > = 1 )"
                            },
                            {
                                "type": "text",
                                "content": "的元组的集合。 一张二维表格对应一个关系。表中的一行称为关系的一个元组；表中的一列称为关系的一个属性。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                594,
                847,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在关系模型中，对关系作了下列规范性的限制：（关系的六条基本性质）"
                    }
                ]
            },
            "bbox": [
                144,
                705,
                705,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系中每一个属性值都是不可分解的；"
                    }
                ]
            },
            "bbox": [
                166,
                732,
                463,
                747
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系中不允许出现相同的元组（没有重复元组)；"
                    }
                ]
            },
            "bbox": [
                166,
                750,
                539,
                766
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "不考虑元组间的顺序，即没有行序；"
                    }
                ]
            },
            "bbox": [
                166,
                770,
                445,
                785
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在理论上，属性间的顺序（即列序）也是不存在的；"
                    }
                ]
            },
            "bbox": [
                166,
                788,
                569,
                803
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "列是同质的，即每一列中的分量是同一类型的数据，来自同一个域；"
                    }
                ]
            },
            "bbox": [
                166,
                806,
                690,
                821
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "不同的列可出自同一个域，不同的属性要给予不同的属性名。"
                    }
                ]
            },
            "bbox": [
                166,
                825,
                638,
                840
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(6) 超码 （Super Key） ： 在关系中能唯一标识元组的属性集称为关系模式的超码；"
                    }
                ]
            },
            "bbox": [
                149,
                852,
                769,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(7) 候选码(Candidate Key)：不含有多余属性的超码称为候选码； 关系中能唯一地标识一个元组而不包含多余属性的属性（或属性组），叫码或者候选码，一个关系可以有多个候选"
                    }
                ]
            },
            "bbox": [
                146,
                870,
                847,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "码。"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                174,
                107
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(8) 主码（Primary Key）：用户选作元组标识的一个候选码。 如果一个关系有多个候选码，则选择其中一个作为主码。"
                    }
                ]
            },
            "bbox": [
                144,
                111,
                855,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在以上概念中，主码一定可作候选码，候选码一定可作超码；反之，则不成立。"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                759,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "比如，在学生表中，如果有“学号”、“姓名”、“出生年月”等字段， 其中学号是唯一的，那么（学号）属于超码，（学号，姓名）的组合也是超码。 同时，（学号）是候选码而（学号，姓名）由于含有多余属性，所以不是候选码。 在这三个概念中，主码的概念最为重要，它是用户选作元组标识的一个关键字。 如果一个关系中有两个或两个以上候选码用户就选其中之一作为主码。"
                    }
                ]
            },
            "bbox": [
                144,
                167,
                845,
                256
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1) 实体完整性规则 要求关系中元组在组成候选码的属性上不能有空值。如果出现空值，那么候选码就起不了唯一标识元组的作用。（对关系的码的约束） 主码 Primary key 也叫主键"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2) 参照完整性规则 要求外码值必须是（另）一个关系的主码的有效值，或者是空值。（对关系外码的约束）"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                260,
                847,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码：（Foreign Key 也叫外键）将一个关系的主码（比如 学生关系 S 中的 S#） 放到另一个关系（比如选课关系SC）中，此时称Sno是关系SC的外码。"
                    }
                ]
            },
            "bbox": [
                166,
                361,
                853,
                395
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意事项："
                    }
                ]
            },
            "bbox": [
                166,
                417,
                250,
                432
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码和相应的主码可以不同名，只要定义在相同值域上即可；"
                    }
                ]
            },
            "bbox": [
                166,
                435,
                638,
                451
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "两个关系可以是同一个关系模式，表示了属性之间的联系。"
                    }
                ]
            },
            "bbox": [
                166,
                454,
                620,
                469
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码值是否允许空，应视具体情况而定"
                    }
                ]
            },
            "bbox": [
                166,
                473,
                472,
                488
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3) 用户定义的完整性规则：这是针对某一具体数据的约束条件，由应用环境决定， 例如，学生的年龄限制为15~30周岁。 用户定义的完整性规则反映某一具体应用涉及的数据必须满足的语义要求。 系统提供定义和检验这类完整性的机制。"
                    }
                ]
            },
            "bbox": [
                144,
                500,
                853,
                552
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3 数据模型和关系数据模型的基本概念"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                560,
                445,
                575
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.1 数据模型三要素"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                579,
                302,
                593
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                146,
                596,
                381,
                612
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：数据结构、数据操作、完整性约束"
                    }
                ]
            },
            "bbox": [
                146,
                615,
                485,
                631
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "结合下面的关系数据模型进行理解"
                    }
                ]
            },
            "bbox": [
                147,
                634,
                420,
                650
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.2 二维表格的基本术语"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                671,
                337,
                686
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                146,
                689,
                381,
                705
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：主要是一些基本概念"
                    }
                ]
            },
            "bbox": [
                146,
                708,
                381,
                722
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1) 二维表格 在关系模型中，一张二维表格对应一个关系。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2) 元组 表中的一行（即一个记录），表示一个实体；关系是由元组组成的。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3) 域 是一组具有相同数据类型的值的集合。（属性的取值范围）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4) 笛卡尔积域上的一种集合运算。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5) 关系：是一个元数为 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathsf { K } ( \\mathsf { K } > = 1 )"
                            },
                            {
                                "type": "text",
                                "content": "的元组的集合。 一张二维表格对应一个关系。表中的一行称为关系的一个元组；表中的一列称为关系的一个属性。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                745,
                833,
                853
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在关系模型中，对关系作了下列规范性的限制：（关系的六条基本性质）"
                    }
                ]
            },
            "bbox": [
                144,
                857,
                704,
                872
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系中每一个属性值都是不可分解的；"
                    }
                ]
            },
            "bbox": [
                169,
                105,
                467,
                123
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系中不允许出现相同的元组（没有重复元组)；"
                    }
                ]
            },
            "bbox": [
                169,
                124,
                542,
                141
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "不考虑元组间的顺序，即没有行序；"
                    }
                ]
            },
            "bbox": [
                169,
                143,
                450,
                159
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在理论上，属性间的顺序（即列序）也是不存在的；"
                    }
                ]
            },
            "bbox": [
                169,
                162,
                573,
                178
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "列是同质的，即每一列中的分量是同一类型的数据，来自同一个域；"
                    }
                ]
            },
            "bbox": [
                169,
                180,
                695,
                197
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "不同的列可出自同一个域，不同的属性要给予不同的属性名。"
                    }
                ]
            },
            "bbox": [
                169,
                199,
                642,
                215
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(6) 超码 （Super Key） ： 在关系中能唯一标识元组的属性集称为关系模式的超码；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(7) 候选码(Candidate Key)：不含有多余属性的超码称为候选码； 关系中能唯一地标识一个元组而不包含多余属性的属性（或属性组），叫码或者候选码，一个关系可以有多个候选码。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(8) 主码（Primary Key）：用户选作元组标识的一个候选码。 如果一个关系有多个候选码，则选择其中一个作为主码。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                227,
                836,
                335
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在以上概念中，主码一定可作候选码，候选码一定可作超码；反之，则不成立。"
                    }
                ]
            },
            "bbox": [
                144,
                338,
                759,
                354
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "比如，在学生表中，如果有“学号”、“姓名”、“出生年月”等字段， 其中学号是唯一的，那么（学号）属于超码，（学号，姓名）的组合也是超码。 同时，（学号）是候选码，而（学号，姓名）由于含有多余属性，所以不是候选码。 在这三个概念中，主码的概念最为重要，它是用户选作元组标识的一个关键字。 如果一个关系中有两个或两个以上候选码，用户就选其中之一作为主码。"
                    }
                ]
            },
            "bbox": [
                156,
                363,
                838,
                456
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.3 关系模型的形式定义"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                466,
                337,
                482
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                146,
                485,
                381,
                501
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：三个组成部分的了解"
                    }
                ]
            },
            "bbox": [
                146,
                504,
                381,
                520
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系模型有三个组成部分：数据结构、数据操作和完整性约束条件"
                    }
                ]
            },
            "bbox": [
                144,
                541,
                662,
                557
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系模型的的数据结构是关系；"
                    }
                ]
            },
            "bbox": [
                146,
                558,
                389,
                575
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系模型提供一组完备的高级关系运算（关系代数 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "^ +"
                    },
                    {
                        "type": "text",
                        "content": "关系演算），支持数据库的各种操作；"
                    }
                ]
            },
            "bbox": [
                144,
                577,
                836,
                613
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系模型包括三类完整性规则。"
                    }
                ]
            },
            "bbox": [
                146,
                615,
                386,
                630
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.4 关系模型的三类完整性规则"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                652,
                389,
                668
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“领会”层次，第四章后达到熟悉掌握，是课程重点之一。"
                    }
                ]
            },
            "bbox": [
                144,
                670,
                722,
                686
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：三类完整性规则的理解"
                    }
                ]
            },
            "bbox": [
                146,
                689,
                398,
                703
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1) 实体完整性规则 要求关系中元组在组成候选码的属性上不能有空值。如果出现空值，那么候选码就起不了唯一标识元组的作用。（对关系的码的约束） 主码 Primary key 也叫主键"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2) 参照完整性规则 要求外码值必须是（另）一个关系的主码的有效值，或者是空值。（对关系外码的约束）"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                726,
                836,
                816
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码：（Foreign Key也叫外键）将一个关系的主码（比如 学生关系S中的S#） 放到另一个关系（比如选课关系SC）中，此时称Sno是关系SC的外码。"
                    }
                ]
            },
            "bbox": [
                169,
                827,
                836,
                863
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意事项："
                    }
                ]
            },
            "bbox": [
                171,
                124,
                253,
                140
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码和相应的主码可以不同名，只要定义在相同值域上即可；"
                    }
                ]
            },
            "bbox": [
                171,
                143,
                642,
                160
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "两个关系可以是同一个关系模式，表示了属性之间的联系。"
                    }
                ]
            },
            "bbox": [
                171,
                162,
                623,
                178
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外码值是否允许空，应视具体情况而定"
                    }
                ]
            },
            "bbox": [
                171,
                181,
                477,
                197
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "假设数据库有如下关系："
                    }
                ]
            },
            "bbox": [
                171,
                217,
                359,
                231
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学生关系 S (S#、SNAME、AGE、SEX)"
                    }
                ]
            },
            "bbox": [
                171,
                236,
                452,
                250
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "课程关系 C（C#、CNAME、TEACHER）"
                    }
                ]
            },
            "bbox": [
                171,
                254,
                458,
                269
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学习关系 SC（S#、C#、GRADE）"
                    }
                ]
            },
            "bbox": [
                171,
                273,
                413,
                288
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "那么"
                    }
                ]
            },
            "bbox": [
                171,
                291,
                211,
                306
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)S#是关系S的主码，因此在关系S中不能为空；（实体完整性规则）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)C#是关系C的主码，因此在关系C中不能为空；（实体完整性规则）"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                171,
                309,
                712,
                344
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系SC中："
                    }
                ]
            },
            "bbox": [
                171,
                347,
                260,
                361
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（S#，C#）的组合为主码，因此S#、C#各自都不能为空；（实体完整性规则）"
                    }
                ]
            },
            "bbox": [
                184,
                365,
                768,
                381
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S#是来自S的外码，因此它必须和关系S中某个元组的S#相同。（参照完整性规则）"
                    }
                ]
            },
            "bbox": [
                171,
                384,
                796,
                418
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "C#是来自C的外码，因此它必须和关系C中某个元组的C#相同。（参照完整性规则）"
                    }
                ]
            },
            "bbox": [
                169,
                420,
                796,
                455
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3) 用户定义的完整性规则：这是针对某一具体数据的约束条件，由应用环境决定， 例如，学生的年龄限制为 15~30 周岁。 用户定义的完整性规则反映某一具体应用涉及的数据必须满足的语义要求。 系统提供定义和检验这类完整性的机制。"
                    }
                ]
            },
            "bbox": [
                144,
                466,
                836,
                521
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4 概念模型向关系数据模型的转化（即 ER 图转化为表结构）"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                539,
                601,
                557
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“熟练掌握”层次"
                    }
                ]
            },
            "bbox": [
                144,
                558,
                416,
                575
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：转换的实际操作"
                    }
                ]
            },
            "bbox": [
                144,
                577,
                346,
                593
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ER模型转换关系数据库的 一般规则："
                    }
                ]
            },
            "bbox": [
                144,
                596,
                431,
                612
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1） 将每一个实体类型转换成一个关系模式，实体的属性为关系模式的属性。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2） 对于二元联系，按各种情况处理，如下面所示。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                166,
                615,
                764,
                649
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/0fa0fc4deb0a98640f4b7c3fb29ebbe7162f736d545ee2543f70778170cd28d9.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>二元\n关系</td><td>ER图</td><td>转换成的关系</td><td>联系的处理</td><td>主码</td><td>外码</td></tr><tr><td>1:1</td><td>A\n1\nA-B\n1\nB</td><td>(2个关系)\n模式A\n模式B</td><td>(有两种)\n处理方式(1)\n(1)把模式B的主码,联系的属性加入模式A\n处理方式(2):\n(2)把模式A</td><td>(略)</td><td>(依据联系的处理方式)\n方式(1):模式B的主码为模式A\n外码\n方式(2):表A的主码为表B的外</td></tr><tr><td></td><td></td><td></td><td>的主码,联系的属性加入模式B</td><td></td><td>码</td></tr><tr><td>1:M</td><td>A\n1\nA-B\nM\nB</td><td>(2个关系)\n模式A\n模式B</td><td>把模式B的主码,联系的属性加入模式A</td><td>(略)</td><td>模式A对应模式B的主码为模式A的外码</td></tr><tr><td>M:N</td><td>A\nN\nA-B\nM\nB</td><td>(3个关系)\n模式A\n模式B\n模式A-B</td><td>联系类型转换成关系模式A-B;模式A-B的属性(a)联系的属性(b)两端实体类型的主码</td><td>两端实体类型的主码一起构成模式A-B主码</td><td>两端实体类型的主码分别为模式A-B的外码</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                149,
                651,
                843,
                897
            ]
        }
    ],
    [
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                149,
                93,
                848,
                520
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQL数据库的体系结构也是三级结构，但术语与传统关系模型术语不同，在SQL中，关系模式称为\"基本表\"，存储模式称为\"存储文件\"，子模式称为\"视图\"，元组称\"行\"，属性称\"列\"。"
                    }
                ]
            },
            "bbox": [
                144,
                544,
                848,
                596
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQL数据库体系的结构要点如下："
                    }
                ]
            },
            "bbox": [
                144,
                618,
                403,
                633
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)一个SQL数据库是表的汇集。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)一个 SQL 表由行集构成，行是列的序列，每列对应一个数据项。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)表或者是基本表，或者是视图。基本表是实际存储在数据库中的表，视图由是由若干基本表或其他视图构成的表的定义。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4)一个基本表可以跨一个或多个存储文件，一个存储文件也可存放一个或多个基本表。存储文件与物理文件对应。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5)用户可以用 SQL 语句对表进行操作，包括视图和基本表。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(6)SQL 的用户可以是应用程序，也可以是终端用户。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                637,
                847,
                783
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "常用SQL语句分为三类："
                    }
                ]
            },
            "bbox": [
                146,
                803,
                334,
                819
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)数据定义：DDL：CREATE、ALTER、DROP，定义 SQL 模式，可以是基本表、视图和索引。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)数据操纵：DML：SELECT、INSERT、UPDATE、DELETE，包括数据查询和数据更新(增、删、改)。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)数据控制：DCL：GRANT、REVOKE，包括对基本表和视图的授权、完整性规则的描述，"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                822,
                845,
                894
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事务控制等。（第四章安全性讲）"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                405,
                108
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.1 SQL提供的基本数据类型"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                112,
                368,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数值型：包括 int、smallint、decimal(p，d)、numeric(p，d)"
                    }
                ]
            },
            "bbox": [
                144,
                131,
                598,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "字符串型：char(n) 、nchar(n)、varchar(n)、nvarchar(n)前 2 者是定长，后 2 者为变长串"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                806,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "时间型：datetime。 。"
                    }
                ]
            },
            "bbox": [
                144,
                168,
                315,
                181
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.2 基本表的创建、修改和撤消"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                205,
                389,
                219
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(1)基本表的创建：(建立表结构)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                223,
                393,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CREATE TABLE 基本表名"
                    }
                ]
            },
            "bbox": [
                154,
                242,
                332,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(列名，类型，"
                    }
                ]
            },
            "bbox": [
                146,
                260,
                250,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                146,
                284,
                176,
                292
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "完整性约束...) "
                    }
                ]
            },
            "bbox": [
                146,
                297,
                257,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "完整性约束包括主键子句(PRIMARY KEY)、检查子句(CHECK)和外键子句(Foreign KEY)."
                    }
                ]
            },
            "bbox": [
                144,
                315,
                784,
                331
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(2)基本表结构的修改"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                334,
                312,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "增加新列："
                    }
                ]
            },
            "bbox": [
                146,
                353,
                228,
                367
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ALTER TABLE 基本表名 ADD 列名 类型"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                430,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "删除原有的列："
                    }
                ]
            },
            "bbox": [
                146,
                388,
                265,
                404
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ALTER TABLE 基本表名 DROP COLUMN 列名"
                    }
                ]
            },
            "bbox": [
                144,
                409,
                468,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "修改数据列，只能修改数据列的数据类型，注意其中的限制："
                    }
                ]
            },
            "bbox": [
                144,
                426,
                616,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ALTER TABLE 基本表名 ALTER COLUMN 列名 新的数据类型"
                    }
                ]
            },
            "bbox": [
                161,
                445,
                598,
                460
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(3)基本表的撤消 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                464,
                275,
                478
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DROP TABLE 基本表名"
                    }
                ]
            },
            "bbox": [
                146,
                483,
                312,
                497
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.3 索引的创建和撤消"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                519,
                319,
                533
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(1)索引的创建："
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                538,
                265,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CREATE [CLUSTERED][UNIQUE] INDEX 索引名 ON 表名(列名[ASC|DESC])"
                    }
                ]
            },
            "bbox": [
                144,
                557,
                670,
                571
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(2)索引的撤消："
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                575,
                265,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DROP INDEX 表名.索引名"
                    }
                ]
            },
            "bbox": [
                146,
                594,
                336,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "索引的作用，索引的分类（聚餐索引和非聚餐索引）"
                    }
                ]
            },
            "bbox": [
                144,
                612,
                544,
                627
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.1 SELECT 语句的基本句法"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                631,
                354,
                645
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“综合应用”层次"
                    }
                ]
            },
            "bbox": [
                146,
                649,
                415,
                664
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：SELECT-FROM-WHERE 句型的应用"
                    }
                ]
            },
            "bbox": [
                144,
                668,
                470,
                683
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(1) SELECT-FROM-WHERE 句型"
                    }
                ],
                "level": 1
            },
            "bbox": [
                159,
                705,
                394,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT 列名表(逗号隔开)"
                    }
                ]
            },
            "bbox": [
                193,
                724,
                386,
                738
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "FROM 基本表或视图序列"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                741,
                339,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE 条件表达式"
                    }
                ]
            },
            "bbox": [
                146,
                760,
                297,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Notice:掌握条件表达式中各种运算符的应用. "
                    }
                ]
            },
            "bbox": [
                144,
                778,
                487,
                794
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "算术比较运算符 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\dot { } = \\mathbf { \\nabla }"
                    },
                    {
                        "type": "text",
                        "content": "， "
                    },
                    {
                        "type": "equation_inline",
                        "content": "> , < , < >"
                    },
                    {
                        "type": "text",
                        "content": "或! "
                    },
                    {
                        "type": "equation_inline",
                        "content": "! = , < = , > ="
                    },
                    {
                        "type": "text",
                        "content": "；"
                    }
                ]
            },
            "bbox": [
                166,
                806,
                450,
                822
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "逻辑运算符AND、OR、NOT；"
                    }
                ]
            },
            "bbox": [
                168,
                825,
                391,
                840
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "集合成员资格运算符：IN，NOT IN；like， not like；between and ；"
                    }
                ]
            },
            "bbox": [
                166,
                844,
                680,
                859
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "谓词:EXISTS(存在量词)，NOT EXISTS；"
                    }
                ]
            },
            "bbox": [
                168,
                862,
                448,
                877
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "聚合函数：（在下面介绍）"
                    }
                ]
            },
            "bbox": [
                168,
                879,
                373,
                896
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(2) SELECT 句型使用实例"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                93,
                334,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "本节内容需要多看例题，多作习题进行掌握。"
                    }
                ]
            },
            "bbox": [
                144,
                112,
                494,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Notice:嵌套的 SELECT 语句的用法 ，体会结构化的含义。"
                    }
                ]
            },
            "bbox": [
                144,
                130,
                569,
                145
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(3)聚合函数"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                149,
                242,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意各个函数的含义："
                    }
                ]
            },
            "bbox": [
                146,
                167,
                317,
                181
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/98a382000ac801dd9bb89b7433d3aedac021c2567a0da305fc806bc0e28c5dbe.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>COUNT (*)</td><td>计算元组的个数</td></tr><tr><td>COUNT (列名)</td><td>求一列中值的计算个数</td></tr><tr><td>COUNT(DISTINCT 列名)</td><td>求一列中值的种类数</td></tr><tr><td>SUM (列名)</td><td>求一列中值的总和</td></tr><tr><td>AVG (列名)</td><td>求一列中值的平均值</td></tr><tr><td>MAX (列名)</td><td>求一列中值的最大值</td></tr><tr><td>MIN (列名)</td><td>求一列中值的最小值</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                144,
                183,
                561,
                451
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如果语句没有 Group By 则返回单个值；如果语句带 Group By 则每个小组返回一个值。"
                    }
                ]
            },
            "bbox": [
                144,
                455,
                796,
                470
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT 列名表(逗号隔开)"
                    }
                ]
            },
            "bbox": [
                146,
                473,
                339,
                489
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM 基本表或视图序列"
                    }
                ]
            },
            "bbox": [
                146,
                492,
                339,
                507
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[WHERE 条件表达式] (行条件子句) "
                    }
                ]
            },
            "bbox": [
                146,
                511,
                410,
                526
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[GROUP BY 列名序列] (分组子句) "
                    }
                ]
            },
            "bbox": [
                146,
                529,
                396,
                545
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[HAVING 组条件表达式] (组条件子句) "
                    }
                ]
            },
            "bbox": [
                161,
                548,
                447,
                563
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ORDER BY 列名[ASC|DESC]..] (排序子句) "
                    }
                ]
            },
            "bbox": [
                146,
                565,
                450,
                582
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(1)SELECT 子句中的规定"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                585,
                332,
                600
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": " 如果要求输出表格中不允许出现重复元组，则在 SELECT 后加一 DISTINCT"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": " SELECT 子句中允许出现 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ + , ^ { - } , ^ { * } , / } ,"
                            },
                            {
                                "type": "text",
                                "content": ",以及列名、常数、函数的算术表达式"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                174,
                602,
                761,
                637
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(2) 条件表达式的算术比较操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                640,
                386,
                656
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " WHERE 子句中可以用 BETWEEN...AND...来限定一个值的范围"
                    }
                ]
            },
            "bbox": [
                174,
                659,
                667,
                674
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(3)列和基本表的改名操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                677,
                347,
                692
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " 同一个基本表在 SELECT语句中多次引用时可用AS来增加别名"
                    }
                ]
            },
            "bbox": [
                174,
                696,
                682,
                711
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(4)字符串的匹配操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                714,
                312,
                730
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " WHERE 子句中字符串匹配用 LIKE 和两个通配符，%和下划线_."
                    }
                ]
            },
            "bbox": [
                174,
                733,
                682,
                749
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(5)集合的并、交、差操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                770,
                347,
                785
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " 查询结果的结构完全一致时，可将两个查询进行并(UNION)、交（InterSect）、差（Except）"
                    }
                ]
            },
            "bbox": [
                174,
                789,
                847,
                822
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(6)空值的比较操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                826,
                294,
                841
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询空值操作不是用 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "= \""
                    },
                    {
                        "type": "text",
                        "content": "null',而是用 IS NULL 来测试。"
                    }
                ]
            },
            "bbox": [
                174,
                844,
                591,
                860
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(7)集合的比较操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                863,
                294,
                878
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " 集合成员资格比较用 IN/NOT IN"
                    }
                ]
            },
            "bbox": [
                176,
                882,
                448,
                897
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " 集合成员算术比较用元组 θ ANY/ALL (θ 是算术比较运算符）（少用）"
                    }
                ]
            },
            "bbox": [
                174,
                93,
                724,
                108
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(8) 导出表的使用"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                112,
                280,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " 使用 INTO 关键字，可以给子查询结果起个表名，保存相关查询数据。"
                    }
                ]
            },
            "bbox": [
                174,
                130,
                736,
                145
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(9) 基本表的连接操作"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                149,
                317,
                164
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "等值连接操作是用 [INNER] JOIN 来实现的。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "外连接：左外连接 LEFT [OUTER] JOIN 、RIGHT [OUTER] JOIN、FULL [OUTER] JOIN自身连接：通过设置别名的方法，一个 SELECT语句中可以对一个表进行多次扫描，实现连接。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                167,
                847,
                237
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据插入方式有两种："
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                241,
                317,
                256
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(1) 元组值的插入"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                260,
                280,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "INSERT INTO 基本表名(列名表)"
                    }
                ]
            },
            "bbox": [
                147,
                279,
                379,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "values(元组值) "
                    }
                ]
            },
            "bbox": [
                147,
                298,
                260,
                312
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "(2) 查询结果的插入"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                316,
                297,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "INSERT INTO 基本表名(列名表)"
                    }
                ]
            },
            "bbox": [
                147,
                334,
                379,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT 查询语句"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                275,
                367
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE子句中使用下列关键字"
                    }
                ]
            },
            "bbox": [
                147,
                370,
                384,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "除了比较符，可以在 WHERE 子句中使用下列"
                    }
                ]
            },
            "bbox": [
                147,
                390,
                494,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关键字"
                    }
                ]
            },
            "bbox": [
                147,
                407,
                203,
                423
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "关键字"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                426,
                203,
                442
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "含义"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                445,
                186,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "IN "
                    }
                ]
            },
            "bbox": [
                147,
                464,
                166,
                476
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否在所给的范围内"
                    }
                ]
            },
            "bbox": [
                147,
                482,
                361,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NOT IN "
                    }
                ]
            },
            "bbox": [
                147,
                501,
                201,
                513
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否不在所给的范围内"
                    }
                ]
            },
            "bbox": [
                147,
                519,
                379,
                535
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "LIKE "
                    }
                ]
            },
            "bbox": [
                147,
                539,
                181,
                551
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否与一个给定的值相似"
                    }
                ]
            },
            "bbox": [
                147,
                556,
                398,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NOT LIKE "
                    }
                ]
            },
            "bbox": [
                147,
                576,
                216,
                588
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否与一个给定的值不相似"
                    }
                ]
            },
            "bbox": [
                147,
                594,
                415,
                609
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "IS NULL "
                    }
                ]
            },
            "bbox": [
                147,
                613,
                205,
                625
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否为空"
                    }
                ]
            },
            "bbox": [
                147,
                631,
                273,
                645
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "IS NOT NULL "
                    }
                ]
            },
            "bbox": [
                147,
                650,
                240,
                662
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否不为空"
                    }
                ]
            },
            "bbox": [
                147,
                668,
                292,
                682
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "AND "
                    }
                ]
            },
            "bbox": [
                147,
                687,
                184,
                699
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断是否满足AND两边所给的条件"
                    }
                ]
            },
            "bbox": [
                147,
                705,
                418,
                719
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "OR "
                    }
                ]
            },
            "bbox": [
                147,
                724,
                171,
                736
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断是否满足OR 两边所给的条件中的一个"
                    }
                ]
            },
            "bbox": [
                147,
                741,
                478,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "BETWEEN…AND "
                    }
                ]
            },
            "bbox": [
                147,
                760,
                265,
                772
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否在所给的值之间"
                    }
                ]
            },
            "bbox": [
                147,
                778,
                361,
                794
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NOT BETWEEN…AND "
                    }
                ]
            },
            "bbox": [
                147,
                797,
                302,
                810
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "判断值是否不在所给的值之间"
                    }
                ]
            },
            "bbox": [
                147,
                816,
                379,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "使用 LIKE 运算符可以完成对字符串的模糊匹配。"
                    }
                ]
            },
            "bbox": [
                147,
                835,
                512,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                854,
                161,
                866
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "基本语法："
                    }
                ]
            },
            "bbox": [
                147,
                872,
                228,
                885
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT select_list "
                    }
                ]
            },
            "bbox": [
                147,
                890,
                277,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM table_sourse "
                    }
                ]
            },
            "bbox": [
                144,
                93,
                292,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE EXPRESSION LIKE ‘STRING’ "
                    }
                ]
            },
            "bbox": [
                146,
                112,
                396,
                126
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                131,
                161,
                143
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "其中，EXPRESSION 为用作选择条件的列或表达式"
                    }
                ]
            },
            "bbox": [
                146,
                148,
                526,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                170,
                161,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "指定的字符串中可以包含通配符，包括："
                    }
                ]
            },
            "bbox": [
                146,
                186,
                458,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "%：代表任意多个字符。例：%jing "
                    }
                ]
            },
            "bbox": [
                149,
                205,
                418,
                221
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "_（下划线）：代表单个字符。例：_ouse"
                    }
                ]
            },
            "bbox": [
                149,
                223,
                473,
                239
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ ]：代表指定范围内的单个字符。例：[mh]ouse "
                    }
                ]
            },
            "bbox": [
                149,
                241,
                519,
                258
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[^ ]：代表不再指定范围内的单个字符。例：[^mh]ouse "
                    }
                ]
            },
            "bbox": [
                149,
                260,
                574,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE子句中，也可以使用逻辑运算符来"
                    }
                ]
            },
            "bbox": [
                144,
                297,
                473,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接多个条件。"
                    }
                ]
            },
            "bbox": [
                146,
                316,
                263,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                337,
                161,
                347
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "主要有逻辑运算符："
                    }
                ]
            },
            "bbox": [
                147,
                351,
                299,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "AND "
                    }
                ]
            },
            "bbox": [
                147,
                372,
                184,
                384
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "OR "
                    }
                ]
            },
            "bbox": [
                147,
                390,
                174,
                401
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NOT "
                    }
                ]
            },
            "bbox": [
                147,
                407,
                183,
                420
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.2 SQL 数据删除"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                426,
                278,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“综合应用”层次"
                    }
                ]
            },
            "bbox": [
                146,
                445,
                416,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DELETE FROM 基本表名 [WHERE 条件表达式]"
                    }
                ]
            },
            "bbox": [
                147,
                483,
                487,
                498
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（语义：从基本表中删除满足条件表达式的元组）"
                    }
                ]
            },
            "bbox": [
                157,
                500,
                527,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意带子查询的数据删除"
                    }
                ]
            },
            "bbox": [
                147,
                519,
                347,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "示例：求有两门以上不及格课程同学的学号及其平均成绩"
                    }
                ]
            },
            "bbox": [
                146,
                538,
                591,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select S#, Avg(Score) From SC "
                    }
                ]
            },
            "bbox": [
                147,
                557,
                363,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where Score "
                    },
                    {
                        "type": "equation_inline",
                        "content": "< 6 0"
                    }
                ]
            },
            "bbox": [
                147,
                576,
                278,
                588
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Group by S# Having Count "
                    },
                    {
                        "type": "equation_inline",
                        "content": "^ { ( * ) } ) { > } 2"
                    },
                    {
                        "type": "text",
                        "content": "; "
                    }
                ]
            },
            "bbox": [
                147,
                594,
                379,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Ø该SQL语句求出的是“该同学那几门不及格课程的平均成绩”，而不是 “该同学所有课程的平均成绩” 。因此正确写法为："
                    }
                ]
            },
            "bbox": [
                146,
                611,
                769,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select S#, Avg(Score) From SC "
                    }
                ]
            },
            "bbox": [
                147,
                649,
                363,
                664
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where S# in "
                    }
                ]
            },
            "bbox": [
                147,
                668,
                238,
                681
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "( Select S# From SC "
                    }
                ]
            },
            "bbox": [
                147,
                686,
                287,
                700
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where Score < 60 "
                    }
                ]
            },
            "bbox": [
                147,
                705,
                278,
                718
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Group by S# Having Count "
                    },
                    {
                        "type": "equation_inline",
                        "content": "^ { ( * ) } ) { > } 2"
                    },
                    {
                        "type": "text",
                        "content": ") "
                    }
                ]
            },
            "bbox": [
                147,
                722,
                383,
                738
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Group by S# "
                    }
                ]
            },
            "bbox": [
                147,
                743,
                238,
                756
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "交叉连接"
                    }
                ]
            },
            "bbox": [
                147,
                760,
                221,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "也叫非限制连接，将两个表不加任何约束的组合起来，即两个表的广义笛卡尔积。"
                    }
                ]
            },
            "bbox": [
                146,
                778,
                564,
                813
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                819,
                161,
                829
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "交叉连接后得到的结果集的行数是两个被连接表的行数的乘积。"
                    }
                ]
            },
            "bbox": [
                146,
                834,
                574,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                873,
                161,
                884
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语法："
                    }
                ]
            },
            "bbox": [
                147,
                890,
                193,
                904
            ]
        }
    ],
    [
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "SELECT select_list  \nFROM table1 CROSS JOIN table2  \n或  \nSELECT select_list  \nFROM table1, table2 "
                    }
                ],
                "code_language": "sql"
            },
            "bbox": [
                146,
                93,
                384,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQL高级语法："
                    }
                ]
            },
            "bbox": [
                147,
                186,
                260,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                147,
                205,
                196,
                218
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "列名"
                    }
                ]
            },
            "bbox": [
                147,
                223,
                184,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ [, 列名] … ] "
                    }
                ]
            },
            "bbox": [
                147,
                242,
                243,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "From 表名 1 [NATURAL] "
                    }
                ]
            },
            "bbox": [
                147,
                261,
                326,
                275
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "[INNER|{LEFT|RIGHT|FULL} [OUTER]] JOIN 表名2 {ON "
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                147,
                279,
                549,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接条件} "
                    }
                ]
            },
            "bbox": [
                147,
                316,
                228,
                332
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ Where 检索条件 ] … ;"
                    }
                ]
            },
            "bbox": [
                147,
                335,
                319,
                350
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接中使用 natural"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                295,
                368
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "q 出现在结果关系中的两个连接关系的元组在公共属性上取值相等，且 公共属性只出现一次"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\varnothing"
                            },
                            {
                                "type": "text",
                                "content": "连接中使用 on <连接条件>"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "q 出现在结果关系中的两个连接关系的元组取值满足连接条件，且公共属性出现两次"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                370,
                715,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "内连接(Inner Join)"
                    }
                ]
            },
            "bbox": [
                149,
                464,
                287,
                480
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                486,
                159,
                494
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "指定了 INNER 关键字的连接是内连接，内连接按照 ON 所指定的连接条件合并两个表，返回满足条件的行。"
                    }
                ]
            },
            "bbox": [
                147,
                501,
                603,
                535
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                541,
                159,
                550
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "内连接是系统默认的，可以省略INNER关键字。使用内连接后仍可使用WHERE子句指定条件。"
                    }
                ]
            },
            "bbox": [
                147,
                556,
                608,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                596,
                159,
                606
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如：<表名1>.<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "1 > < > <"
                    },
                    {
                        "type": "text",
                        "content": "表名 2>.<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > }"
                    },
                    {
                        "type": "text",
                        "content": "2024/6/6102"
                    }
                ]
            },
            "bbox": [
                147,
                612,
                554,
                644
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "等值连接(EquiJoin) "
                    }
                ]
            },
            "bbox": [
                147,
                649,
                294,
                665
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                670,
                159,
                678
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "使用 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "^ { 6 6 } = \\upsilon"
                    },
                    {
                        "type": "text",
                        "content": "关系将表连接起来的查询，其查询结果中列出被连接表中的所有列，包括其中的重复列。"
                    }
                ]
            },
            "bbox": [
                147,
                686,
                527,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                726,
                159,
                734
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "等值连接 "
                    }
                ]
            },
            "bbox": [
                147,
                741,
                221,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接运算符为 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "="
                    },
                    {
                        "type": "text",
                        "content": "的连接操作"
                    }
                ]
            },
            "bbox": [
                147,
                760,
                361,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v [<表名 1>.]<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\uparrow > ="
                    },
                    {
                        "type": "text",
                        "content": "[<表名 2>.]<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > }"
                    }
                ]
            },
            "bbox": [
                147,
                778,
                472,
                794
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "任何子句中引用表1和表2中同名属性时，都必须加表名前缀。引用唯一属性名时可以加也可以省略表名前缀。"
                    }
                ]
            },
            "bbox": [
                147,
                797,
                586,
                832
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                838,
                159,
                847
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "表的连接条件经常采用“主码 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { I } \\equiv \\mathsf { I }"
                    },
                    {
                        "type": "text",
                        "content": "外部码”的形式。2024/6/6103"
                    }
                ]
            },
            "bbox": [
                147,
                853,
                598,
                884
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                892,
                159,
                902
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语法："
                    }
                ]
            },
            "bbox": [
                146,
                93,
                194,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT select_list "
                    }
                ]
            },
            "bbox": [
                146,
                112,
                278,
                126
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM table1 [INNER] JOIN table2 "
                    }
                ]
            },
            "bbox": [
                146,
                129,
                394,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ON table1.column1=table2.column2 "
                    }
                ]
            },
            "bbox": [
                146,
                149,
                411,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "和"
                    }
                ]
            },
            "bbox": [
                146,
                168,
                169,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT select_list "
                    }
                ]
            },
            "bbox": [
                146,
                186,
                277,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM table1 ，table2"
                    }
                ]
            },
            "bbox": [
                146,
                206,
                310,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE table1.column1=table2.column2"
                    }
                ]
            },
            "bbox": [
                146,
                223,
                440,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "⽰例：按“001”号课成绩由⾼到低顺序显⽰所有学生的姓名(⼆表连接)"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                690,
                258
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                146,
                261,
                196,
                273
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Sname From Student, SC "
                    }
                ]
            },
            "bbox": [
                146,
                279,
                332,
                292
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where Student. "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } \\# = \\mathsf { S C } . \\mathsf { S } \\#"
                    },
                    {
                        "type": "text",
                        "content": "and SC.C# = ‘001’ "
                    }
                ]
            },
            "bbox": [
                146,
                297,
                468,
                310
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Order By Score DESC; "
                    }
                ]
            },
            "bbox": [
                146,
                316,
                305,
                330
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "多表连接时，如两个表的属性名相同，则需采用表名. 属性名方式来限定"
                    }
                ]
            },
            "bbox": [
                144,
                334,
                721,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "该 属性是属于哪一个表"
                    }
                ]
            },
            "bbox": [
                146,
                353,
                332,
                367
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "⽰例：按‘数据库’课成绩由⾼到低顺序显⽰所有同学姓名(三表连接)"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                690,
                387
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                146,
                390,
                196,
                403
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Sname From Student, SC, Course "
                    }
                ]
            },
            "bbox": [
                146,
                407,
                389,
                422
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where "
                    }
                ]
            },
            "bbox": [
                146,
                426,
                201,
                439
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Student. "
                    },
                    {
                        "type": "equation_inline",
                        "content": "S \\# = \\Im \\mathbb { C } . S \\#"
                    },
                    {
                        "type": "text",
                        "content": "and SC.C# "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\equiv"
                    },
                    {
                        "type": "text",
                        "content": "Course.C# and Cname "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\equiv"
                    },
                    {
                        "type": "text",
                        "content": "‘数据库"
                    }
                ]
            },
            "bbox": [
                144,
                445,
                616,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Order By Score DESC; "
                    }
                ]
            },
            "bbox": [
                146,
                464,
                305,
                478
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "自然连接"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                482,
                221,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "等值连接的一种特殊情况，自动判断相同名称的列，"
                    }
                ]
            },
            "bbox": [
                146,
                501,
                544,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "而后形成匹配，把目标列中重复的属性列去掉。"
                    }
                ]
            },
            "bbox": [
                146,
                519,
                510,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "<表名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\uparrow > . <"
                    },
                    {
                        "type": "text",
                        "content": "列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\gimel = { < }"
                    },
                    {
                        "type": "text",
                        "content": "表名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > . < }"
                    },
                    {
                        "type": "text",
                        "content": "<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > }"
                    }
                ]
            },
            "bbox": [
                146,
                538,
                438,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                146,
                558,
                159,
                569
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "有些 DBMS 产品，如 SQL Server，不支持"
                    }
                ]
            },
            "bbox": [
                146,
                575,
                458,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NATURAL JOIN连接符，故不能直接实现自然连接"
                    }
                ]
            },
            "bbox": [
                146,
                594,
                522,
                609
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "非等值连接 (Non-EquiJoin)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                630,
                349,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                146,
                652,
                159,
                661
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "非等值连接"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                667,
                240,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接运算符不为 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "="
                    },
                    {
                        "type": "text",
                        "content": "的连接操作"
                    }
                ]
            },
            "bbox": [
                146,
                686,
                379,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                146,
                708,
                159,
                717
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "形式："
                    }
                ]
            },
            "bbox": [
                146,
                722,
                193,
                738
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[<表名 1>.]<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\ L _ { 1 } > <"
                    },
                    {
                        "type": "text",
                        "content": "比较运算符 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "> [ <"
                    },
                    {
                        "type": "text",
                        "content": "<表名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "2 { > } . ] <"
                    },
                    {
                        "type": "text",
                        "content": "<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > }"
                    }
                ]
            },
            "bbox": [
                147,
                741,
                559,
                758
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "比较运算符： "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\therefore x _ { 1 } > = 1 < = 1 1 = ( < 2 )"
                    }
                ]
            },
            "bbox": [
                147,
                760,
                436,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[<表名 1>.]<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\Im \\succ"
                    },
                    {
                        "type": "text",
                        "content": "BETWEEN [<表名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "2 > . ] < \\bar { \\mathcal { G } } ^ { \\mid }"
                    },
                    {
                        "type": "text",
                        "content": "名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "_ { 2 > }"
                    }
                ]
            },
            "bbox": [
                146,
                778,
                522,
                794
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "AND [<表名 2>.]<列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathfrak { 3 } \\mathfrak { > }"
                    }
                ]
            },
            "bbox": [
                146,
                797,
                332,
                813
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "求既学过“001”号课⼜学过 “002”号课的所有学生的"
                    }
                ]
            },
            "bbox": [
                144,
                816,
                559,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学号"
                    }
                ]
            },
            "bbox": [
                146,
                834,
                184,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                146,
                854,
                194,
                866
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S1.S# "
                    }
                ]
            },
            "bbox": [
                146,
                872,
                189,
                884
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "From SC S1, SC "
                    }
                ]
            },
            "bbox": [
                146,
                890,
                258,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S2 Where "
                    }
                ]
            },
            "bbox": [
                146,
                93,
                221,
                105
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } \\mathsf { 1 } . \\mathsf { S } \\# = \\mathsf { S } 2 . \\mathsf { S } \\#"
                    },
                    {
                        "type": "text",
                        "content": "and "
                    }
                ]
            },
            "bbox": [
                146,
                112,
                277,
                124
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } 1 . \\mathsf { C } \\# { } { } = ^ { \\iota } ( 0 0 1 ^ { \\prime }"
                    }
                ]
            },
            "bbox": [
                147,
                130,
                235,
                143
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "and "
                    }
                ]
            },
            "bbox": [
                147,
                149,
                179,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } 2 . \\mathsf { C } \\# = ^ { \\prime } 0 0 2"
                    }
                ]
            },
            "bbox": [
                147,
                167,
                238,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "⽰例：求“001”号课成绩⽐“002”号课成绩⾼的所有学生的"
                    }
                ]
            },
            "bbox": [
                146,
                185,
                608,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学号"
                    }
                ]
            },
            "bbox": [
                147,
                204,
                186,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select S1.S# From SC S1, SC S2 Where "
                    }
                ]
            },
            "bbox": [
                146,
                223,
                423,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } \\mathsf { 1 } . \\mathsf { S } \\# = \\mathsf { S } 2 . \\mathsf { S } \\#"
                    },
                    {
                        "type": "text",
                        "content": "and S1.C#=‘001’ "
                    }
                ]
            },
            "bbox": [
                147,
                241,
                366,
                255
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "and "
                    }
                ]
            },
            "bbox": [
                147,
                261,
                179,
                273
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { S } 2 . \\mathsf { C } \\# { = } ^ { \\prime } 0 0 2 ^ { \\prime }"
                    },
                    {
                        "type": "text",
                        "content": "and S1.Score "
                    },
                    {
                        "type": "equation_inline",
                        "content": ">"
                    },
                    {
                        "type": "text",
                        "content": "S2.Score; "
                    }
                ]
            },
            "bbox": [
                147,
                279,
                416,
                293
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S "
                    }
                ]
            },
            "bbox": [
                147,
                298,
                159,
                309
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "外连接"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                315,
                203,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                337,
                159,
                346
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "指定了OUTER关键字的为外连接，外连接的结果表不但包含满足连接条件的行，还包括相应表中的所有行。"
                    }
                ]
            },
            "bbox": [
                146,
                351,
                489,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                411,
                159,
                420
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外连接中，可以只限制一个表，而对另一个表不加限制（即所有的行都出现在结果集中）。"
                    }
                ]
            },
            "bbox": [
                146,
                426,
                485,
                479
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                485,
                159,
                494
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外连接分为左外连接、右外连接和全外连接。"
                    }
                ]
            },
            "bbox": [
                146,
                500,
                492,
                516
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "自身连接(Self-Join)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                538,
                292,
                554
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                558,
                159,
                569
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "连接操作是在同一张表内进行自身连接，即将同一个表的不同行连接起来。"
                    }
                ]
            },
            "bbox": [
                146,
                574,
                626,
                609
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                615,
                159,
                624
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可看作一张表的两个副本之间进行的连接。"
                    }
                ]
            },
            "bbox": [
                147,
                630,
                475,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                652,
                159,
                661
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "必须为表指定两个别名，使之在逻辑上成为两张表。"
                    }
                ]
            },
            "bbox": [
                146,
                667,
                546,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                689,
                159,
                699
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "由于所有属性名都是同名属性，因此必须使用别名前缀v"
                    }
                ]
            },
            "bbox": [
                147,
                705,
                574,
                734
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "例 36.查询 Employee 表中的同姓的职工。"
                    }
                ]
            },
            "bbox": [
                147,
                741,
                455,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT e1.Ename,e2.Ename "
                    }
                ]
            },
            "bbox": [
                147,
                760,
                352,
                774
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM Employee e1 JOIN Employee e2 "
                    }
                ]
            },
            "bbox": [
                147,
                778,
                428,
                793
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ON left(e1.Ename,1)=left(e2.Ename,1) "
                    }
                ]
            },
            "bbox": [
                147,
                797,
                423,
                812
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE e1.Eno<e2.Eno "
                    }
                ]
            },
            "bbox": [
                147,
                816,
                315,
                829
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "SQL并运算 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                853,
                235,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ØUNION中的每一个查询所涉及的列必须具有相同的列数，相同的数据类型，并以相同的顺序出现。"
                    }
                ]
            },
            "bbox": [
                144,
                871,
                658,
                906
            ]
        }
    ],
    [
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\varnothing"
                            },
                            {
                                "type": "text",
                                "content": "最后结果集中的列名来自第一个 SELECT 语句。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\varnothing"
                            },
                            {
                                "type": "text",
                                "content": "若 UNION 中包含 ORDER BY 子句，则将对最后的结果集排序。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                93,
                626,
                128
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "⽰例：求学过 002 号课的同学或学过 003 号课的同学学号"
                    }
                ]
            },
            "bbox": [
                146,
                130,
                591,
                146
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                147,
                149,
                196,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S# "
                    }
                ]
            },
            "bbox": [
                147,
                168,
                169,
                180
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "From "
                    }
                ]
            },
            "bbox": [
                147,
                187,
                189,
                199
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SC "
                    }
                ]
            },
            "bbox": [
                147,
                206,
                169,
                217
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where "
                    }
                ]
            },
            "bbox": [
                147,
                224,
                201,
                236
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "{ \\tt C } \\# = \\langle 0 0 2 ^ { \\prime }"
                    }
                ]
            },
            "bbox": [
                147,
                241,
                221,
                254
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UNION "
                    }
                ]
            },
            "bbox": [
                147,
                261,
                203,
                273
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                147,
                279,
                196,
                291
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S# "
                    }
                ]
            },
            "bbox": [
                147,
                298,
                169,
                310
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "From "
                    }
                ]
            },
            "bbox": [
                147,
                317,
                189,
                328
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                147,
                335,
                169,
                346
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where "
                    }
                ]
            },
            "bbox": [
                147,
                353,
                201,
                365
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathbf { \\Lambda } _ { C \\# } = \\mathbf { \\Lambda } ^ { \\prime } 0 0 3 ^ { \\prime }"
                    }
                ]
            },
            "bbox": [
                147,
                370,
                226,
                385
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "上述语句也可采用如下不用 UNION 的方式来进行"
                    }
                ]
            },
            "bbox": [
                146,
                390,
                541,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select "
                    }
                ]
            },
            "bbox": [
                147,
                409,
                196,
                420
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S# "
                    }
                ]
            },
            "bbox": [
                147,
                426,
                169,
                439
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "From "
                    }
                ]
            },
            "bbox": [
                147,
                445,
                189,
                458
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SC "
                    }
                ]
            },
            "bbox": [
                147,
                464,
                169,
                476
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Where "
                    }
                ]
            },
            "bbox": [
                147,
                483,
                201,
                495
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "{ \\tt C } \\# = \\langle 0 0 2 ^ { \\prime }"
                    }
                ]
            },
            "bbox": [
                147,
                501,
                221,
                513
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "OR "
                    }
                ]
            },
            "bbox": [
                147,
                521,
                173,
                532
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathbf { \\Lambda } _ { C \\# } = \\mathbf { \\Lambda } ^ { \\prime } 0 0 3 ^ { \\prime }"
                    }
                ]
            },
            "bbox": [
                147,
                538,
                226,
                551
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "内层查询独立进行，没有涉及任何外层查询相关信息的子查询"
                    }
                ]
            },
            "bbox": [
                144,
                574,
                608,
                609
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                615,
                159,
                624
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "子查询可以多次嵌套。"
                    }
                ]
            },
            "bbox": [
                147,
                631,
                317,
                645
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                652,
                159,
                661
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "分为两种：子查询返回单个值和子查询返回一个值列表。"
                    }
                ]
            },
            "bbox": [
                146,
                667,
                581,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                689,
                159,
                699
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "返回单个值，该值被外部查询的比较操作使用，该值可以是子查询中使用集合函数得到的值。"
                    }
                ]
            },
            "bbox": [
                146,
                705,
                591,
                738
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                745,
                159,
                753
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "返回一个值列表，该列表被外部查询的IN、NOT IN、ANY或ALL比较操作使用。"
                    }
                ]
            },
            "bbox": [
                146,
                760,
                586,
                793
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "IN表示属于，NOT IN表示不属于。"
                    }
                ]
            },
            "bbox": [
                149,
                797,
                413,
                812
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ANY和ALL用于一个值与另一个组值的比较"
                    }
                ]
            },
            "bbox": [
                149,
                816,
                485,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                838,
                159,
                847
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE子句中不得直接出现聚合函数。"
                    }
                ]
            },
            "bbox": [
                146,
                853,
                445,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "错误用法："
                    }
                ]
            },
            "bbox": [
                147,
                872,
                228,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT Ename,Age "
                    }
                ]
            },
            "bbox": [
                147,
                891,
                285,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM Employee "
                    }
                ]
            },
            "bbox": [
                144,
                93,
                270,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE Age >AVG(Age); "
                    }
                ]
            },
            "bbox": [
                146,
                111,
                324,
                127
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "相关子查询"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                130,
                240,
                146
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                146,
                151,
                161,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "执行依赖于外部查询，多数情况下是在子查询的WHERE子句中引用了外部查询的表。"
                    }
                ]
            },
            "bbox": [
                144,
                167,
                487,
                202
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                146,
                206,
                161,
                218
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可以使用EXISTS关键字来判断查询结果中是否存在数据，EXISTS在一个子查询至少返回"
                    }
                ]
            },
            "bbox": [
                144,
                222,
                487,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "一行时成立。"
                    }
                ]
            },
            "bbox": [
                146,
                260,
                247,
                275
            ]
        },
        {
            "type": "image",
            "content": {
                "image_source": {
                    "path": "images/9befa48b9bdf61690405bec38c2b72f386915c759717198cd755efd254411539.jpg"
                },
                "image_caption": [],
                "image_footnote": []
            },
            "bbox": [
                151,
                274,
                1000,
                680
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "索引的概念"
                    }
                ],
                "level": 1
            },
            "bbox": [
                551,
                170,
                900,
                222
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "索引是定义在基本表(Table)基础之上，有助于无需检查所有记录位所需记录的一种辅助存储结构，由一系列存储在磁盘上的索引项entries)组成，每一索引项又由两部分构成："
                    }
                ]
            },
            "bbox": [
                270,
                235,
                1000,
                309
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "√索引字段：由Table中某些列(通常是一列)中的值串接而成。索引索引字段的每一个值(也有不是这样的)。索引字段类似于词典中的词条。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "√行指针：指向Table中包含索引字段值的记录在磁盘上的存储位条在书籍、词典中出现的页码。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "·存储索引项的文件为索引文件，相对应，基本表又称为主文"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                270,
                313,
                1000,
                451
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Index-field pointer "
                    }
                ]
            },
            "bbox": [
                344,
                485,
                621,
                508
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Index索引文"
                    }
                ],
                "level": 1
            },
            "bbox": [
                359,
                576,
                443,
                627
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/4b97ea5dcd26b38d182a062114c55b6b48f9d40d78c8196017d40071091cbbca.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td colspan=\"7\">Course</td></tr><tr><td>C#</td><td></td><td>C#</td><td>Chame</td><td>Chours</td><td>Credit</td><td>T</td></tr><tr><td>001</td><td></td><td>001</td><td>数据库</td><td>40</td><td>6</td><td>0</td></tr><tr><td>002</td><td></td><td>003</td><td>数据结构</td><td>40</td><td>6</td><td>0</td></tr><tr><td>003</td><td></td><td>004</td><td>编译原理</td><td>40</td><td>6</td><td>0</td></tr><tr><td>004</td><td></td><td>005</td><td>C语言</td><td>30</td><td>4.5</td><td>0</td></tr><tr><td>005</td><td></td><td>002</td><td>高等数学</td><td>80</td><td>12</td><td>0</td></tr><tr><td>006</td><td></td><td>006</td><td>计算机原理</td><td>40</td><td>6</td><td>0</td></tr><tr><td>007</td><td></td><td>009</td><td>数理逻辑</td><td>40</td><td>6</td><td>0</td></tr><tr><td>008</td><td></td><td>008</td><td>组合数学</td><td>30</td><td>4.5</td><td>0</td></tr></table>",
                "table_type": "complex_table",
                "table_nest_level": 1
            },
            "bbox": [
                450,
                519,
                1000,
                627
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.3 数据修改"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                630,
                250,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“综合应用”层次"
                    }
                ]
            },
            "bbox": [
                146,
                649,
                416,
                665
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UPDATE 基本表名"
                    }
                ]
            },
            "bbox": [
                144,
                686,
                282,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SET 列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "="
                    },
                    {
                        "type": "text",
                        "content": "值表达式,[列名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "="
                    },
                    {
                        "type": "text",
                        "content": "值表达式...]"
                    }
                ]
            },
            "bbox": [
                144,
                705,
                438,
                721
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[WHERE 条件表达式] "
                    }
                ]
            },
            "bbox": [
                146,
                722,
                307,
                739
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(语义：修改基本表中满足条件表达式的那些元组中的列值，需修改的列值在 SET子句中指出）"
                    }
                ]
            },
            "bbox": [
                144,
                741,
                848,
                776
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意带子查询的数据更新"
                    }
                ]
            },
            "bbox": [
                146,
                778,
                346,
                794
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)视图的创建："
                    }
                ]
            },
            "bbox": [
                146,
                816,
                265,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CREATE VIEW 视图名(列名表) AS SELECT 查询语句"
                    }
                ]
            },
            "bbox": [
                146,
                834,
                519,
                850
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)视图的撤消："
                    }
                ]
            },
            "bbox": [
                147,
                852,
                265,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DROP VIEW 视图名 "
                    }
                ]
            },
            "bbox": [
                146,
                872,
                290,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语句格式"
                    }
                ]
            },
            "bbox": [
                151,
                890,
                226,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CREATE VIEW <视图名> [<列名清单>] "
                    }
                ]
            },
            "bbox": [
                144,
                93,
                426,
                109
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "AS <子查询>"
                    }
                ]
            },
            "bbox": [
                146,
                112,
                243,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[WITH CHECK OPTION]"
                    }
                ]
            },
            "bbox": [
                146,
                130,
                317,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                152,
                159,
                161
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "说明"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                167,
                186,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "<视图名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": ">"
                    },
                    {
                        "type": "text",
                        "content": "给出所定义的视图的名称。"
                    }
                ]
            },
            "bbox": [
                149,
                186,
                426,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "<列名清单>，若有则此清单给出了此视图的全部属性的属性名；否则，"
                    }
                ]
            },
            "bbox": [
                147,
                204,
                690,
                218
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "此视图的所有属性名即为子查询中 SELECT 语句中的全部目标列。"
                    }
                ]
            },
            "bbox": [
                146,
                223,
                638,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "<子查询>为任一合法 SELECT 语句（但一般不含有 ORDER BY，"
                    }
                ]
            },
            "bbox": [
                147,
                241,
                613,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UNION 等语法成分）。"
                    }
                ]
            },
            "bbox": [
                146,
                261,
                317,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "有[WITH CHECK OPTION]时，则今后对此视图进行 INSERT、"
                    }
                ]
            },
            "bbox": [
                147,
                279,
                589,
                293
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UPDATE和DELETE操作时，系统自动检查是否符合原定义视图子查"
                    }
                ]
            },
            "bbox": [
                146,
                297,
                658,
                311
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "询中的<条件表达式>。"
                    }
                ]
            },
            "bbox": [
                146,
                316,
                315,
                331
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.4.2 视图的更新"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                334,
                278,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对视图的查询(SELECT)操作，和基本表一样，但是视图的更新操作受到下列三条规则的限制："
                    }
                ]
            },
            "bbox": [
                144,
                351,
                855,
                368
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "如果视图是从多个基本表使用连接操作导出的，则不允许更新。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "如果导出的视图使用了分组和聚合操作，也不允许更新。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                174,
                390,
                695,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如果视图是从单个基本表使用选择、投影操作导出的，并且包括了基本表的主键和没有缺省值的不可为空的列， 那么这样的视图称为“行列子集视图”，则可以执行操作。"
                    }
                ]
            },
            "bbox": [
                144,
                426,
                847,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "有些查询使用一个Select语句完成，可能做不到（也可能是逻辑上太绕），可以使用视图存放中间查询的数据，在后续Select语句中跟视图进行连接查询实现。"
                    }
                ]
            },
            "bbox": [
                144,
                463,
                847,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库完整性是通过 DBMS 的完整性子系统实现的，它有两个功能："
                    }
                ]
            },
            "bbox": [
                146,
                501,
                667,
                516
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)监督事务的执行，并测试是否违反完整性规则。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)如有违反，则采取恰当的操作，如拒绝、报告违反情况，改正错误等方法进行处理。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                538,
                811,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                146,
                575,
                381,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：规则的组成部分及分类"
                    }
                ]
            },
            "bbox": [
                146,
                594,
                396,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库完整性子系统是根据“完整性规则集” 工作的，"
                    }
                ]
            },
            "bbox": [
                144,
                630,
                568,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "完整性规则是由数据库管理员或应用程序员事先向完整性子系统提供有关数据约束的一组规则。"
                    }
                ]
            },
            "bbox": [
                144,
                649,
                847,
                683
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "由三部分组成："
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                705,
                263,
                719
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）什么时候使用规则进行检查；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）要检查什么样的错误；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）若检查出错误，该怎样处理。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                157,
                722,
                413,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在关系数据库中，这些完整性规则可分为三类："
                    }
                ]
            },
            "bbox": [
                144,
                797,
                510,
                812
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）用户定义完整性"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）实体完整性"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）参照完整性"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                161,
                816,
                322,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1）主码约束：可用主码子句或主码短语来定义。"
                    }
                ]
            },
            "bbox": [
                146,
                872,
                519,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如 PRIMARY KEY (S#) (主码子句) "
                    }
                ]
            },
            "bbox": [
                146,
                891,
                384,
                904
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "（2）外码约束：可用外码子句来定义"
                    }
                ],
                "level": 1
            },
            "bbox": [
                157,
                130,
                442,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如 FOREIGN KEY (S#) REFERNCE S(S#) "
                    }
                ]
            },
            "bbox": [
                171,
                149,
                440,
                164
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/03ea6d9dbbb50dbf2567c771b5c03ef056e50ba85a4f4bda59f5c8a5bdf29e22.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>删除基本关系元组时的考虑</td><td>外码子句加&quot;ON DELETE&quot;短语</td></tr><tr><td>修改基本关系中主码值的考虑</td><td>外码子句加&quot;ON UPDATE&quot;短语</td></tr><tr><td colspan=\"2\">三种方式：NO ACTION, RESTRICT, CASCADE, SET NULL (具体含义)</td></tr></table>",
                "table_type": "complex_table",
                "table_nest_level": 1
            },
            "bbox": [
                161,
                164,
                690,
                266
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）属性值约束：包括非空值约束(NOT NULL)；基于属性的检查子句(CHECK) ；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4）全局约束：包括基于元组的检查子句(CHECK)"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                156,
                268,
                754,
                302
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "在 employee 中插入记录，其 dno 值 not null， 但不在 department (dno) 中出现；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "修改 employee 的记录，新 dno 值 not null， 但不在 department (dno) 中出现；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "删除 department 的记录，但相应的 dno 值出现在 employee (dno) 中；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "修改 department 中的记录，但旧的 dno 值出现在 employee (dno) 中。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                305,
                776,
                376
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Restrict（限制策略） ——SQL 的默认策略，"
                    }
                ]
            },
            "bbox": [
                146,
                379,
                475,
                394
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "针对以上四种情况；"
                    }
                ]
            },
            "bbox": [
                146,
                397,
                300,
                413
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " "
                    }
                ]
            },
            "bbox": [
                147,
                417,
                164,
                428
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Cascade（级联策略）——针对以上后两种情况；"
                    }
                ]
            },
            "bbox": [
                146,
                434,
                517,
                450
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " "
                    }
                ]
            },
            "bbox": [
                147,
                454,
                164,
                464
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Set Null（置空策略）——针对以上后两种情况。"
                    }
                ]
            },
            "bbox": [
                146,
                470,
                515,
                487
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " "
                    }
                ]
            },
            "bbox": [
                147,
                489,
                164,
                501
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "三种策略有 On Delete , On Update 可供选"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                508,
                465,
                524
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对约束的命名、撤消和添加操作"
                    }
                ]
            },
            "bbox": [
                146,
                527,
                398,
                542
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（1）约束的命名"
                    }
                ]
            },
            "bbox": [
                157,
                546,
                282,
                561
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在定义时，前面加上关键字CONSTRACT和约束名即可。"
                    }
                ]
            },
            "bbox": [
                154,
                564,
                576,
                579
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（2）在关系上约束的撤消与添加"
                    }
                ]
            },
            "bbox": [
                157,
                583,
                406,
                598
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在 关 系 定义中 ，撤消约 束 用 “ALTER TABLE ...DROP CONSTRAINT...”语 句 ，添加约 束 用“ALTER TABLE ...ADD CONSTRAINT ...”语句"
                    }
                ]
            },
            "bbox": [
                157,
                601,
                847,
                634
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " Check 约束："
                    }
                ]
            },
            "bbox": [
                147,
                638,
                257,
                653
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\star"
                    },
                    {
                        "type": "text",
                        "content": "约束条件可以是任何 Where 中出现的字句；"
                    }
                ]
            },
            "bbox": [
                147,
                657,
                494,
                671
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "故具有很强的表述能力；"
                    }
                ]
            },
            "bbox": [
                147,
                675,
                334,
                690
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\star"
                    },
                    {
                        "type": "text",
                        "content": "常用于数据的值域约束；"
                    }
                ]
            },
            "bbox": [
                147,
                694,
                351,
                709
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "三、User Defined Integrity and Default、Check"
                    }
                ]
            },
            "bbox": [
                147,
                714,
                492,
                728
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Col_constr 列约束"
                    }
                ]
            },
            "bbox": [
                147,
                732,
                285,
                746
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "一种域约束类型，对单一列的值进行约束"
                    }
                ]
            },
            "bbox": [
                147,
                749,
                482,
                765
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "{ NOT NULL | "
                    }
                ]
            },
            "bbox": [
                147,
                768,
                245,
                782
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ CONSTRAINT constraintname ] "
                    }
                ]
            },
            "bbox": [
                147,
                785,
                384,
                801
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "{ UNIQUE "
                    }
                ]
            },
            "bbox": [
                147,
                804,
                221,
                819
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "| PRIMARY KEY "
                    }
                ]
            },
            "bbox": [
                147,
                824,
                263,
                837
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "| CHECK "
                    }
                ]
            },
            "bbox": [
                149,
                841,
                211,
                856
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(search_cond) "
                    }
                ]
            },
            "bbox": [
                147,
                860,
                253,
                875
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//列值非空"
                    }
                ]
            },
            "bbox": [
                147,
                879,
                235,
                894
            ]
        },
        {
            "type": "page_header",
            "content": {
                "page_header_content": [
                    {
                        "type": "text",
                        "content": "S# CHAR (4) PRIMARY KEY (其中，PRIMARY KEY 为主码短语）"
                    }
                ]
            },
            "bbox": [
                146,
                93,
                594,
                109
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//为约束命名，便于以后撤消 "
                    }
                ]
            },
            "bbox": [
                144,
                93,
                376,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//列值是唯一"
                    }
                ]
            },
            "bbox": [
                146,
                112,
                253,
                126
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//列为主键 "
                    }
                ]
            },
            "bbox": [
                146,
                130,
                236,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//列值满足条件,条件只能使用列当前"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                433,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "值 "
                    }
                ]
            },
            "bbox": [
                146,
                168,
                169,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "| REFERENCES tablename [(colname) ] "
                    }
                ]
            },
            "bbox": [
                147,
                185,
                430,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ON DELETE { CASCADE | SET NULL } ] "
                    }
                ]
            },
            "bbox": [
                147,
                204,
                423,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                147,
                223,
                166,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//引用另一表 tablename 的列 colname 的值，如有 ON DELETE CASCADE 或 ONDELETE SET NULL语句，则删除被引用表的某列值v 时，要将本表该列值为 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { v }"
                    },
                    {
                        "type": "text",
                        "content": "的记录删除或列值更新为 null；缺省为无操作 。"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                749,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " Col_constr 列约束：只能应用在单一列上，其后面的约束如"
                    }
                ]
            },
            "bbox": [
                146,
                297,
                621,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UNIQUE, PRIMARY KEY 及 search_cond 只能是单一列唯一、"
                    }
                ]
            },
            "bbox": [
                144,
                316,
                589,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "单一列为主键、和单一列"
                    }
                ]
            },
            "bbox": [
                146,
                334,
                346,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "相关"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                186,
                367
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Col_constr列约束 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                156,
                376,
                324,
                395
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "》一种域约束类型，对单一列的值进行约束"
                    }
                ]
            },
            "bbox": [
                156,
                399,
                440,
                413
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "{ NOT NULL | "
                    }
                ]
            },
            "bbox": [
                156,
                414,
                253,
                429
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                414,
                527,
                426
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ CONSTRAINT constraintname ] "
                    }
                ]
            },
            "bbox": [
                157,
                431,
                389,
                445
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                431,
                616,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "{UNIQUE "
                    }
                ]
            },
            "bbox": [
                157,
                448,
                233,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                448,
                539,
                458
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "PRIMARY KEY "
                    }
                ]
            },
            "bbox": [
                157,
                464,
                270,
                476
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                463,
                527,
                473
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "|CHECK "
                    }
                ]
            },
            "bbox": [
                157,
                480,
                221,
                493
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(search_cond) "
                    }
                ]
            },
            "bbox": [
                277,
                481,
                381,
                494
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                479,
                653,
                489
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                472,
                489,
                484,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "| REFERENCES tablename [(colname)] "
                    }
                ]
            },
            "bbox": [
                260,
                497,
                557,
                511
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                586,
                512,
                608,
                526
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[ON DELETE{CASCADE| SET NULL}] "
                    }
                ]
            },
            "bbox": [
                260,
                513,
                608,
                527
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//引用另一表tablename的列colname的值，如有ONDELETECASCADE或ONDELETESETNULL语句，则删除被引用表的某列值y时，要将本表该列值为y的记录删除或列值更新为null：缺省为无操作。"
                    }
                ]
            },
            "bbox": [
                258,
                527,
                670,
                562
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\gtrdot"
                    },
                    {
                        "type": "text",
                        "content": "Col_constr列约束：只能应用在单一列上，其后面的约束如UNIQUE，PRIMARYKEY及search_cond只能是单一列唯一、单一列为主键、和单一列"
                    }
                ]
            },
            "bbox": [
                258,
                563,
                667,
                604
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "相关"
                    }
                ]
            },
            "bbox": [
                260,
                606,
                292,
                619
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Create Table "
                    }
                ]
            },
            "bbox": [
                163,
                650,
                240,
                661
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Student (S# "
                    }
                ]
            },
            "bbox": [
                277,
                651,
                349,
                661
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "char(8) not null unique, Sname"
                    }
                ]
            },
            "bbox": [
                391,
                651,
                574,
                661
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "char(10), Ssex char(2) constraint ctssex check (Ssex= ‘男’or Ssex=‘女 "
                    }
                ]
            },
            "bbox": [
                163,
                664,
                600,
                675
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                163,
                677,
                186,
                688
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " Sage integer check (Sage>=1 and Sage<150), D# "
                    }
                ]
            },
            "bbox": [
                220,
                677,
                507,
                688
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "char(2) references Dept(D#) on delete cascade, "
                    }
                ]
            },
            "bbox": [
                220,
                690,
                495,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " Sclass char(6) ); "
                    }
                ]
            },
            "bbox": [
                163,
                705,
                260,
                715
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//假定Ssex只能取{男，女},1=<Sage<=150，D#是外键 "
                    }
                ]
            },
            "bbox": [
                163,
                715,
                411,
                727
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "小"
                    }
                ]
            },
            "bbox": [
                176,
                756,
                215,
                763
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Create Table Course (C# char(3)， Cname char(12), Chours integer,"
                    }
                ]
            },
            "bbox": [
                176,
                765,
                665,
                777
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Credit float(1) constraint ctcredit check (Credit >=0.0 and "
                    }
                ]
            },
            "bbox": [
                275,
                777,
                663,
                788
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Credit<=5.0).T# char(3) references Teacher(T#) on delete "
                    }
                ]
            },
            "bbox": [
                275,
                790,
                665,
                804
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "cascade); "
                    }
                ]
            },
            "bbox": [
                275,
                807,
                347,
                819
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                275,
                822,
                438,
                832
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                275,
                833,
                295,
                841
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "》一种关系约束类型，对多列或元组的值进行约束"
                    }
                ]
            },
            "bbox": [
                164,
                98,
                756,
                120
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "[CONSTRAINT constraintname] //为约束命名，便于以后撤消  \n{UNIQUE (colname {, colname..}) //几列值组合在一起是唯一  \n|PRIMARY KEY (colname {, colname..}) //几列联合为主键  \n|CHECK (search_condition) //元组多列值共同满足条件  \n//条件中只能使用同一元组的前值  \n|FOREIGN KEY (colname {, colname..})  \nREFERENCES tablename [(colname {, colname..})][DELETE CASCADE]"
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                211,
                126,
                1000,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "引用另一表tablename的若干列的值作为外键"
                    }
                ]
            },
            "bbox": [
                258,
                355,
                678,
                373
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": ">table_constr表约束：是应用在关系上，即对关系的多列或行约束，列约束是其特例"
                    }
                ]
            },
            "bbox": [
                258,
                376,
                1000,
                426
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "Create Table Student (S# char(8) not null unique, Sname char(10), Ssex char(2) constraint ctssex check (Ssex='男' or Ssex='女'), Sage integer check (Sage>1 and Sage<150), D# char(2) references Dept(D#) on delete cascade, Sclass char(6), primary key(S#)); "
                    }
                ],
                "code_language": "sql"
            },
            "bbox": [
                166,
                500,
                633,
                581
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "Create Table Course ( C# char(3) , Cname char(12), Chours integer, Credit float(1) constraint ctcredit check (Credit >=0.0 and Credit<=5.0) , T# char(3) references Teacher(T#) on delete cascade, primary key(C#, constraint ctc check(Chours/Credit = 20)); "
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                196,
                586,
                636,
                668
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "//假定严格约束20学时一个学分"
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                255,
                670,
                410,
                681
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.1.4约米的修改 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                250,
                87,
                579,
                111
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "■先给约束命名，然后进行增加或者删除。"
                    }
                ]
            },
            "bbox": [
                163,
                131,
                868,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "★命名： Constraint<约束名><约束定义>Eg."
                    }
                ]
            },
            "bbox": [
                161,
                170,
                947,
                242
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": " eno char(2) constraint pk_emp, "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2.  sex char(2) constraint chk_sex check (sex IN "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "3. Constraint chk_namesex check( "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathrm { s e x } = \\mathrm { \\tilde { F } } \\mathrm { \\tilde { \\Omega } }"
                            },
                            {
                                "type": "text",
                                "content": "or na not like‘Ms.%) "
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                201,
                249,
                1000,
                419
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "★增加：alter table <table_name>"
                    }
                ]
            },
            "bbox": [
                220,
                428,
                759,
                458
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Add Constraint<约束名><约束定义>"
                    }
                ]
            },
            "bbox": [
                386,
                464,
                1000,
                495
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "★删除：alter table <table_name> "
                    }
                ]
            },
            "bbox": [
                221,
                504,
                759,
                536
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "drop Constraint <约束名>"
                    }
                ]
            },
            "bbox": [
                509,
                543,
                927,
                574
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "是拒绝、级联删除、置空"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                684,
                346,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1. 属性（列）级约束"
                    }
                ]
            },
            "bbox": [
                146,
                703,
                310,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "NOT NULL "
                    }
                ]
            },
            "bbox": [
                174,
                722,
                287,
                737
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "禁止该列出现 NULL 值（必须填写）。"
                    }
                ]
            },
            "bbox": [
                205,
                741,
                494,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": ". UNIQUE "
                    }
                ]
            },
            "bbox": [
                174,
                760,
                273,
                774
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "确保该列的值唯一（允许 NULL，但多个NULL可能被视为不同值，取决于数据库实现）。"
                    }
                ]
            },
            "bbox": [
                205,
                778,
                847,
                813
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CHECK "
                    }
                ]
            },
            "bbox": [
                176,
                816,
                260,
                829
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "定义列值的检查条件，如 CHECK (age "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\bf { \\sigma } > 1 8"
                    },
                    {
                        "type": "text",
                        "content": ")。"
                    }
                ]
            },
            "bbox": [
                205,
                834,
                549,
                850
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DEFAULT "
                    }
                ]
            },
            "bbox": [
                176,
                853,
                275,
                866
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设置默认值，如 DEFAULT 'unknown'。"
                    }
                ]
            },
            "bbox": [
                205,
                871,
                490,
                887
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2. 表（外键）级约束 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                93,
                310,
                109
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这些约束用于维护参照完整性（Referential Integrity），定义当父表（被引用表）的记录被更新或删除时，子表（引用表）如何处理相关记录："
                    }
                ]
            },
            "bbox": [
                144,
                111,
                848,
                146
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/2744a311ec2af69639b0916157b35c690cab9b256662f68668e640ab247e3059.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>约束操作</td><td>说明</td></tr><tr><td>RESTRICT (拒绝)</td><td>默认行为，阻止删除或修改父表记录（如果子表有引用）。</td></tr><tr><td>NO ACTION</td><td>类似于 RESTRICT，但某些数据库（如 PostgreSQL）会在事务结束时检查。</td></tr><tr><td>CASCADE (级联)</td><td>父表记录被删除或更新时，自动删除或更新子表对应的记录。</td></tr><tr><td>SET NULL (置空)</td><td>父表记录被删除或更新时，子表的外键列设为 NULL（要求外键列允许NULL）。</td></tr><tr><td>SET DEFAULT</td><td>父表记录被删除或更新时，子表的外键列设为默认值（需定义 DEFAULT T）。</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                144,
                156,
                860,
                461
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": " Check 约束："
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                482,
                258,
                497
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "约束条件可以是任何 Where 中出现的字句；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "故具有很强的表述能力；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\star"
                            },
                            {
                                "type": "text",
                                "content": "常用于数据的值域约束；"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                500,
                495,
                552
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "三、User Defined Integrity and Default、Check"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                557,
                494,
                571
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Eg. "
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                575,
                173,
                589
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1. sex char(2) check (sex IN (‘男’,‘女’)) default‘男 ’，"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2. age int check (age>=16 and age "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathtt { < } \\mathtt { = } 7 0"
                            },
                            {
                                "type": "text",
                                "content": ")， "
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                592,
                559,
                627
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Eg. "
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                631,
                173,
                644
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1. sex char(2) check (sex IN (‘男’,‘女’)) default‘男 ’，"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2. age int check (age>=16 and age "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathtt { < } \\mathtt { = } 7 0"
                            },
                            {
                                "type": "text",
                                "content": ")， "
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                648,
                559,
                683
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "触发器 Trigger"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                703,
                258,
                720
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "Create Table中的表约束和列约束基本上都是静态的约束，也基本上都是对单一列或单一元组的约束(尽管有参照完整性)，为实现动态约束以及多个元组之间的完整性约束，就需要触发器技术 Trigger"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "Trigger是一种过程完整性约束(相⽐之下，Create Table中定义的都是非过程性约束),是一段 SQL 程序，该程序在对表或视图执行 UPDATE、INSERT 或 DELETE 操作时自动触发执行。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                722,
                690,
                831
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "基本语法"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                834,
                236,
                848
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "CREATETRIGGER "
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                853,
                270,
                866
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "trigger_name "
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                871,
                250,
                885
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "BEFORE | AFTER "
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                890,
                270,
                903
            ]
        }
    ],
    [
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "{ INSERT | DELETE | UPDATE [OF colname {, colname...}] } ON tablename [REFERENCING corr_name_def {, corr_name_def...}] [FOR EACH ROW | FOR EACH STATEMENT] "
                    }
                ],
                "code_language": "sql"
            },
            "bbox": [
                144,
                93,
                647,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//对更新操作的每一条结果(前者:行级触发器)，或整个更新操作完成(后者：语句级触发器)"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                845,
                164
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "[WHEN (search_condition)] { statement "
                    }
                ],
                "code_language": "objectivec"
            },
            "bbox": [
                146,
                167,
                352,
                199
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//检查条件，如满足执行下述程序 "
                    }
                ]
            },
            "bbox": [
                144,
                204,
                413,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "//单行程序直接书写，多行程序要用下行方式"
                    }
                ]
            },
            "bbox": [
                144,
                223,
                500,
                237
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "BEGIN ATOMIC statement; {statement;...} END } "
                    }
                ],
                "code_language": "typescript"
            },
            "bbox": [
                147,
                241,
                515,
                256
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "> 触发器 Trigger 意义：当某一事件发生时(Before|After)，对该事件产生的结果(或是每一元组，或是整个操作的所有元组)，检查条件 search_condition，如果满足条件，则执行后面的程序段。条件或程序段中引用的变量可用 corr_name_def 来限定。"
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                144,
                260,
                620,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事件：BEFORE|AFTER{INSERT|DELETE| UPDATE..}"
                    }
                ]
            },
            "bbox": [
                169,
                351,
                813,
                370
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "□当一个事件(Insert,Delete,或Update)发生之前Before或发生之后After触发 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "□DELETE/INSERT/UPDATE操作发生，执行触发器操作需处理两组值：更新前的值和更新后的值，这两个值由corr_name_def的使用来区分"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "□对于UPDATE触发器，每当UPDATE语句修改由OF子句指定的列值时，激发触发器；如果忽略OF子句，每当UDPATE语句修改表的任何列值时，DBMS都将激发触发器。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                169,
                375,
                959,
                500
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "CREATE TRIGGER trigger_name BEFORE|AFTER  \n{INSERT|DELETE|UPDATE [OF colname{,colname...}]}  \nON tablename [REFERENCING corr_name_def{,corr_name_def...}]  \n[FOR EACH ROW|FOR EACH STATEMENT]  \n//对更新操作的每一条结果(前者)，或整个更新操作完成(后者)  \n[WHEN (search_condition)] //检查条件，如满足执行下述程序  \n{statement //单行程序直接书写，多行程序要用下行方式  \n|BEGIN ATOMIC statement; {statement,...} END} "
                    }
                ],
                "code_language": "sql"
            },
            "bbox": [
                157,
                512,
                640,
                631
            ]
        },
        {
            "type": "image",
            "content": {
                "image_source": {
                    "path": "images/97868f142be5baa0f0e5950e2a9471a66963130572466d4d12982117187ddefe.jpg"
                },
                "image_caption": [],
                "image_footnote": []
            },
            "bbox": [
                675,
                519,
                959,
                612
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "属性上的约束条件：NOT NULL"
                    }
                ]
            },
            "bbox": [
                144,
                667,
                384,
                682
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "UNIQUE "
                    }
                ]
            },
            "bbox": [
                146,
                686,
                211,
                700
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CHECK "
                    }
                ]
            },
            "bbox": [
                146,
                705,
                200,
                717
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "表上的约束条件 CASCADDE NO ACTION RESTRICT"
                    }
                ]
            },
            "bbox": [
                146,
                722,
                514,
                738
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.1 安全性"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                760,
                231,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                144,
                778,
                381,
                793
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：安全性定义"
                    }
                ]
            },
            "bbox": [
                146,
                797,
                310,
                812
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库的完整性是指尽可能避免对数据库的无意的滥用；"
                    }
                ]
            },
            "bbox": [
                144,
                834,
                581,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库的安全性是指尽可能避免对数据库的恶意的滥用。"
                    }
                ]
            },
            "bbox": [
                144,
                853,
                581,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库系统的安全措施是建立在计算机系统基础之上的，通常有五个方面。"
                    }
                ]
            },
            "bbox": [
                144,
                890,
                722,
                904
            ]
        }
    ],
    [
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1） 用户标识和鉴定"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2） 存取控制"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3） 定义视图"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4） 审计"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（5） 数据加密"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                157,
                93,
                322,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用户或应用程序使用数据库的方式称为权限。"
                    }
                ]
            },
            "bbox": [
                146,
                186,
                492,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "授权子系统可以保证用户只能进行其权限范围内的操作，并允许有特定权限的用户有选择地和动态地把这些权限授予其他用户。"
                    }
                ]
            },
            "bbox": [
                144,
                223,
                845,
                256
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）用户权限"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）授权语句"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                159,
                261,
                265,
                293
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "GRANT <权限表> ON <数据库对象> TO <用户名> [WITH GRANT OPTION]"
                    }
                ]
            },
            "bbox": [
                157,
                297,
                694,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（3）回收权限"
                    }
                ]
            },
            "bbox": [
                159,
                316,
                265,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "REVOKE <权限表> ON <数据库对象> FROM <用户名 "
                    },
                    {
                        "type": "equation_inline",
                        "content": ">"
                    },
                    {
                        "type": "text",
                        "content": "[CASCADE]"
                    }
                ]
            },
            "bbox": [
                144,
                334,
                625,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用户与角色：它们之间的关系、权限的继承性、角色授权的高效和便捷性"
                    }
                ]
            },
            "bbox": [
                144,
                351,
                715,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "会判断用户加入某个角色后的最终的权限是什么（自己被授予的权限加上继承了角色的权限，但要去掉被DENY掉的权限）（详见第四章安全性补充PPT）"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                845,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图是从一个或几个基本表导出的表，是虚表，视图定义后可以像基本表一样用于查询和删除， 但其更新操作(增、删、改)会受到限制。"
                    }
                ]
            },
            "bbox": [
                144,
                407,
                845,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图机制把用户可以使用的数据定义在视图中，这样用户就不能使用视图定义外的其他数据，从而保证了数据库的安全性。"
                    }
                ]
            },
            "bbox": [
                144,
                463,
                848,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图机制使系统具有三个优点：数据安全性、数据独立性和操作简便性。"
                    }
                ]
            },
            "bbox": [
                144,
                501,
                704,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事务是一个操作序列。 这些操作要么什么都做，要么都不做，是一个不可分割的工作单位"
                    }
                ]
            },
            "bbox": [
                144,
                538,
                845,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在应用程序 中 ，事务以 BEGIN TRANSACTION 语 句 开 始 ， 以 COMMIT(提交)语 句 或ROLLBACK(回退或撤消)语句结束。 一个程序的执行可通过若干事务的执行序列来完成。事务是不能嵌套的，可恢复的操作必须在一个事务的界限内才能执行."
                    }
                ]
            },
            "bbox": [
                144,
                575,
                848,
                627
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "例1："
                    }
                ],
                "level": 1
            },
            "bbox": [
                220,
                151,
                312,
                186
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " grant select on Student to public 例2： "
                    }
                ]
            },
            "bbox": [
                216,
                195,
                937,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " grant all on Student to u2 "
                    }
                ]
            },
            "bbox": [
                243,
                284,
                815,
                321
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "例3:"
                    }
                ],
                "level": 1
            },
            "bbox": [
                220,
                326,
                312,
                361
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "grant update(Sno),select on Student 例4: "
                    }
                ]
            },
            "bbox": [
                225,
                372,
                996,
                449
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " grant insert on SC to u5 "
                    }
                ]
            },
            "bbox": [
                228,
                460,
                734,
                499
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "with grant option "
                    }
                ]
            },
            "bbox": [
                295,
                505,
                648,
                542
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.2 事务的性质"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                556,
                268,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事务的ACID性质："
                    }
                ]
            },
            "bbox": [
                144,
                593,
                289,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "原子性(atomicity)、一致性(consistency)、隔离性(isolation)和持久性(durability)。"
                    }
                ]
            },
            "bbox": [
                144,
                612,
                742,
                629
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/5871e608b3293f44e6bc1fa38c3818b22bf0f44364ad5c0253c4efb95cd1c791.jpg"
                },
                "table_caption": [
                    {
                        "type": "text",
                        "content": "3.3 故障类型和恢复方法"
                    }
                ],
                "table_footnote": [],
                "html": "<table><tr><td>事务故障</td><td>非预期的事务故障，以由事务程序自动处理</td></tr><tr><td>系统故障</td><td>在硬件故障、软件错误的影响下，虽引起内存信息丢失，但未破坏外存中的数据。重新启动时,恢复子系统将所有非正常终止的事务回退,恢复到正确状态。</td></tr><tr><td>介质故障\n计算机病毒等</td><td>需要DBA的介入，\n通过DBMS把其他务份磁盘或第三级介质中的内容再复制回来</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                157,
                665,
                853,
                857
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.4 恢复的基本原则和实现方法"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                112,
                389,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "恢复的基本原则很简单，就是“冗余”，即数据的重复存储。"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                616,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "实现方法有："
                    }
                ]
            },
            "bbox": [
                146,
                168,
                245,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)定期对数据库进行复制或转储(dump)。"
                    }
                ]
            },
            "bbox": [
                146,
                186,
                458,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Notice:几个概念：静态转储、动态转储、海量转储和增量转储。"
                    }
                ]
            },
            "bbox": [
                144,
                205,
                631,
                219
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "静态存储是指转储期间不允许对数据库进行任何存取、修改活动；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "动态存储是指转储期间允许对数据库进行存取、修改；即转储和用户事务可以并发执行；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "海量存储是指每次转储全部数据库；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "增量存储则指每次只转储上次转储后更新过的数据。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                174,
                223,
                845,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)建立“日志”文件。"
                    }
                ]
            },
            "bbox": [
                146,
                316,
                319,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3)恢复。发生故障时有两种处理方法，如数据库已破坏， 则由 DBA装入最近备份的数据库然后利用\"日志文件\"执行REDO(重做)操作。如数据库未被损坏， 但某些数据不可靠，则系统会自动执行UNDO操作恢复数据。"
                    }
                ]
            },
            "bbox": [
                144,
                334,
                847,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意每种故障策略的不同恢复手段。"
                    }
                ]
            },
            "bbox": [
                146,
                390,
                421,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "并发控制带来的三类问题"
                    }
                ]
            },
            "bbox": [
                146,
                407,
                344,
                423
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)丢失更新 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)不可重复读 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)读“脏数据”(在数据库技术中，未提交的随后又被撤消的数据为“脏数据”。)以上三类问题要做到理解。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                154,
                426,
                789,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "解决并发控制带来的问题，通常要采用封锁(locking)技术，常用的封锁有：排它型封锁(X封锁)和共享型封锁(S封锁)两种。"
                    }
                ]
            },
            "bbox": [
                144,
                519,
                847,
                554
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.2 封锁 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                575,
                213,
                589
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“领会”层次"
                    }
                ]
            },
            "bbox": [
                146,
                593,
                381,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：排它锁（X LOCK），共享锁（S LOCK），并发事务的可串行化"
                    }
                ]
            },
            "bbox": [
                144,
                612,
                690,
                629
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "封锁就是事务T可以向系统发出请求，对某个数据对象（通常是记录）加锁。 于是事务 T对这个数据对象就有一定的控制，其他事务不能更新此数据直到 T释放(Unlock)它的锁为止。"
                    }
                ]
            },
            "bbox": [
                144,
                649,
                853,
                684
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "X封锁：如果事务T对数据R实现X封锁，那么其他的事务要等T解除X封锁以后，才能对这个数据进行封锁。 只有获准X封锁的事务，才能对被封锁的数据进行修改。"
                    }
                ]
            },
            "bbox": [
                144,
                722,
                847,
                758
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "S封锁--如果事务T对某数据R加上S封锁，那么其它事务对数据R的X封锁便不能成功，而对数据R的S封锁请求可以成功。 这就保证了其他事务可以读取 R但不能修改R，直到事务T释放S封锁。"
                    }
                ]
            },
            "bbox": [
                144,
                778,
                847,
                832
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事务的执行次序称为“调度”。如果多个事务依次执行，则称为事务的串行调度。 如果利用分时的方法，同时处理多个事务，则称为事务的并发调度。"
                    }
                ]
            },
            "bbox": [
                144,
                852,
                847,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可串行化调度：如果一个并发调度的结果与某一串行调度执行结果等价，那么这个并发调"
                    }
                ]
            },
            "bbox": [
                152,
                890,
                847,
                906
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "度称为是可串化的调度。"
                    }
                ]
            },
            "bbox": [
                146,
                93,
                334,
                109
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.3 活锁和死锁 "
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                130,
                268,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“领会”层次"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                381,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：活锁及其避免方法；死锁及消除方法"
                    }
                ]
            },
            "bbox": [
                144,
                167,
                505,
                184
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "活锁：是指某个事务永远处于等待状态，得不到执行的现象。"
                    }
                ]
            },
            "bbox": [
                144,
                204,
                616,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "避免活锁的方法是采用“先来先服务”策略。"
                    }
                ]
            },
            "bbox": [
                156,
                223,
                505,
                239
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "死锁：有两个或以上的事务处于等待状态，每个事务都在等待另一个事务解除封锁， 它才"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                845,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "能继续执行下去，结果任何一个事务都无法执行，这种现象就是死锁。"
                    }
                ]
            },
            "bbox": [
                144,
                260,
                687,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "解除死锁的方法是由DBMS中的“死锁测试程序”来检查，如发现死锁则牺牲一个事务，并做回退操作,解除它的所有封锁。"
                    }
                ]
            },
            "bbox": [
                144,
                278,
                836,
                313
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "4.4 两段封锁法"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                334,
                267,
                350
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“识记”层次"
                    }
                ]
            },
            "bbox": [
                144,
                351,
                381,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：两段封锁法"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                310,
                388
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "两段封锁协议规定所有事务都要遵守下列规则："
                    }
                ]
            },
            "bbox": [
                144,
                407,
                512,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)在对任何数据进行读写操作之前，事务首先要获得对该数据的封锁；"
                    }
                ]
            },
            "bbox": [
                152,
                426,
                697,
                443
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)在释放一个封锁之后，事务不再获得任何其他封锁。"
                    }
                ]
            },
            "bbox": [
                154,
                445,
                574,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "事务：扩展阶段——可以申请封锁，但是不能解除任何已取得的封锁收缩阶段——可以释放封锁，但不能申请新的封锁"
                    }
                ]
            },
            "bbox": [
                144,
                482,
                680,
                517
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "1.触发器"
                    }
                ],
                "level": 1
            },
            "bbox": [
                147,
                95,
                275,
                122
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1.1触发器的概念、作用、使用场景"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1.2创建触发器的语法："
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                147,
                128,
                431,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Create trigger触发器名 "
                    }
                ]
            },
            "bbox": [
                179,
                166,
                381,
                181
            ]
        },
        {
            "type": "code",
            "content": {
                "code_caption": [],
                "code_content": [
                    {
                        "type": "text",
                        "content": "On/After insert |update|Delete AS "
                    }
                ],
                "code_language": "txt"
            },
            "bbox": [
                179,
                185,
                455,
                217
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "需要触发完成的 SQL语句"
                    }
                ]
            },
            "bbox": [
                216,
                221,
                420,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1.3触发器中使用游标："
                    }
                ]
            },
            "bbox": [
                147,
                258,
                336,
                274
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "游标使用五部曲："
                    }
                ]
            },
            "bbox": [
                178,
                277,
                317,
                293
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）说明游标"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2）打开游标 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3）推进游标指针并取当前记录 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4）关闭游标"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5）释放游标占用的资源"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                188,
                294,
                438,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DECLARE @no char(7), @ name char(10), @age tinyint "
                    }
                ]
            },
            "bbox": [
                146,
                388,
                596,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DECLARE SX CURSORFOR SELECT Sno,Sname, Sage "
                    }
                ]
            },
            "bbox": [
                147,
                407,
                584,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM Student "
                    }
                ]
            },
            "bbox": [
                233,
                425,
                357,
                439
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "/*说明游标*/ "
                    }
                ]
            },
            "bbox": [
                500,
                425,
                623,
                441
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "OPEN SX ; "
                    }
                ]
            },
            "bbox": [
                147,
                444,
                233,
                458
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "/*打开游标*/ "
                    }
                ]
            },
            "bbox": [
                519,
                444,
                642,
                458
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FETCH SX INTO @no,@name,@ age ; "
                    }
                ]
            },
            "bbox": [
                147,
                463,
                455,
                478
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "游/*进游标指针推进一行，然后从结果集中取当前行，送相应主量"
                    }
                ]
            },
            "bbox": [
                245,
                480,
                761,
                495
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHILE @ @ fetch_status=0 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\prime ^ { \\star }"
                    },
                    {
                        "type": "text",
                        "content": "如果取到数据，用循环结构逐条处理结果集中的记录*/"
                    }
                ]
            },
            "bbox": [
                146,
                499,
                850,
                514
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "BEGIN "
                    }
                ]
            },
            "bbox": [
                147,
                518,
                201,
                532
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\prime ^ { \\star }"
                    },
                    {
                        "type": "text",
                        "content": "若出现 SQL语句错误，则退出循环*/"
                    }
                ]
            },
            "bbox": [
                499,
                518,
                821,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "/*可以根据三个变量的值做相应的处理*/"
                    }
                ]
            },
            "bbox": [
                450,
                536,
                768,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FETCH SX INTO @no,@ name,@ age ; "
                    }
                ]
            },
            "bbox": [
                181,
                556,
                492,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "/*游/*标指针向前推进一行，然后从结果集中取当前行，送相应主量"
                    }
                ]
            },
            "bbox": [
                245,
                573,
                774,
                589
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "*/ "
                    }
                ]
            },
            "bbox": [
                147,
                593,
                164,
                606
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "END "
                    }
                ]
            },
            "bbox": [
                147,
                612,
                186,
                624
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CLOSE SX; "
                    }
                ]
            },
            "bbox": [
                147,
                630,
                233,
                644
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "/*关闭游标*/ "
                    }
                ]
            },
            "bbox": [
                342,
                629,
                465,
                644
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DEALLOCATE SX; "
                    }
                ]
            },
            "bbox": [
                147,
                648,
                287,
                663
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\prime ^ { \\star }"
                    },
                    {
                        "type": "text",
                        "content": "释放游标所占用的系统资源*/"
                    }
                ]
            },
            "bbox": [
                336,
                648,
                589,
                663
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1.4触发器的调用 (触发器无需用户调用，是在对表进行数据增删改时自动触发的)"
                    }
                ]
            },
            "bbox": [
                147,
                684,
                806,
                701
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.存储过程"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                725,
                302,
                750
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2.1存储过程的概念、作用、使用场景"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2.2创建存储过程的语法："
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2.3 存储过程的调用"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                758,
                447,
                810
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "详见教材P1235.5存储过程"
                    }
                ]
            },
            "bbox": [
                147,
                814,
                369,
                829
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "2 关系代数运算"
                    }
                ]
            },
            "bbox": [
                149,
                834,
                275,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "2.1 关系代数的五个基本操作"
                    }
                ]
            },
            "bbox": [
                146,
                853,
                371,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到“简单应用”层次"
                    }
                ]
            },
            "bbox": [
                146,
                871,
                416,
                887
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：五个基本操作的含义和运算应用"
                    }
                ]
            },
            "bbox": [
                146,
                890,
                467,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1)并(∪)：两个关系需有相同的关系模式，并的对象是元组，由两个关系所有元组构成。RUS≡{t| t∈R ∨t∈S}"
                    }
                ]
            },
            "bbox": [
                144,
                111,
                821,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2) 差(-)：同样，两个关系有相同的模式，R和S的差是由属于R但不属于S的元组构成的集合。"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                847,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "R-S≡{t| t∈R ∧t 不属于 S} "
                    }
                ]
            },
            "bbox": [
                152,
                186,
                342,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(3)笛卡尔积（×）：对两个关系R和S进行操作，产生的关系中元组个数为两个关系中元组个数之积。"
                    }
                ]
            },
            "bbox": [
                144,
                204,
                847,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "R×S≡{t| t=< tr,ts>∧tr∈R∧ts ∈S} "
                    }
                ]
            },
            "bbox": [
                152,
                242,
                381,
                256
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4) 投影 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "( \\pmb { \\pi } )"
                            },
                            {
                                "type": "text",
                                "content": "：对关系进行垂直分割，消去某些列，并重新安排列的顺序。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5) 选择 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "( \\pmb { \\sigma } )"
                            },
                            {
                                "type": "text",
                                "content": "：根据某些条件关系作水平分割，即选择符合条件的元组。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1)交(∩)：R 和 S 的交是由既属于 R 又属于 S 的元组构成的集合。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)连接:包括 θ(算术比较符)连接和 F(公式)连接."
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                260,
                695,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "选择 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "{ \\sf R } { \\sf x } { \\sf S }"
                    },
                    {
                        "type": "text",
                        "content": "中满足 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { i } \\Theta ( \\mathsf { r } + \\mathsf { j } )"
                    },
                    {
                        "type": "text",
                        "content": "或 F 条件的元组构成的集合；"
                    }
                ]
            },
            "bbox": [
                147,
                334,
                541,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "概念上比较难理解，关键理解运算实例"
                    }
                ]
            },
            "bbox": [
                144,
                353,
                450,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "等值连接(θ 为等号“=”的连接)。"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                391,
                387
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)自然连接(R S)：在 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\sf R } { \\sf x } { \\sf S }"
                            },
                            {
                                "type": "text",
                                "content": "中，选择R和S公共属性值均相等的元组，并去掉 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\sf R } { \\sf x } { \\sf S }"
                            },
                            {
                                "type": "text",
                                "content": "中重复的公共属性列。 如果两个关系没有公共属性，则自然连接就转化为笛卡尔积。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4)除法 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "( \\div )"
                            },
                            {
                                "type": "text",
                                "content": "：首先除法的结果中元数为两个元数的差，"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                390,
                847,
                443
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { R } { \\div } \\mathsf { S }"
                    },
                    {
                        "type": "text",
                        "content": "的操作思路如下---把S看作一个块，如果R中相同属性集中的元组有相同的块， 且除去此块后留下的相应元组均相同，那么可以得到一条元组， 所有这些元组的集合就是除法的结果"
                    }
                ]
            },
            "bbox": [
                166,
                454,
                853,
                506
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对于上述的五个基本操作和四个组合操作，应当从实际运算方面进行理解和运用。"
                    }
                ]
            },
            "bbox": [
                144,
                518,
                774,
                535
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "应用举例："
                    }
                ]
            },
            "bbox": [
                144,
                555,
                228,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设有关系 R 和 S（如下：）"
                    }
                ]
            },
            "bbox": [
                144,
                574,
                347,
                590
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/26b1614b6fbb52ec6146c45daa8765f9757f74ab218f2051965fc69f688f2249.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>R</td><td>A</td><td>B</td><td>C</td></tr><tr><td></td><td>3</td><td>6</td><td>7</td></tr><tr><td></td><td>2</td><td>5</td><td>7</td></tr><tr><td></td><td>7</td><td>2</td><td>3</td></tr><tr><td></td><td>4</td><td>4</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                157,
                601,
                312,
                694
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/c1f2a8421f4e33b65536738618c420f7cea8e1858f3d3b426ea8f199c3818b5c.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>S:</td><td>A</td><td>B</td><td>C</td></tr><tr><td></td><td>3</td><td>4</td><td>5</td></tr><tr><td></td><td>7</td><td>2</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                337,
                602,
                509,
                659
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "计算："
                    }
                ]
            },
            "bbox": [
                146,
                722,
                194,
                738
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": []
            },
            "bbox": [
                157,
                96,
                719,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "RUS "
                    }
                ]
            },
            "bbox": [
                157,
                146,
                206,
                165
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/00455de20c2cf426148ddc49a70c009b187c99b18483cd9f83f0506c4b5854e3.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>3</td><td>6</td><td>7</td></tr><tr><td>2</td><td>5</td><td>7</td></tr><tr><td>7</td><td>2</td><td>3</td></tr><tr><td>4</td><td>4</td><td>3</td></tr><tr><td>3</td><td>4</td><td>5</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                226,
                143,
                364,
                254
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/d279de62defc274697015c4257a93a4329c3abdfde3c9ff6b0a60e3b6b408f83.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>R-S</td><td>A</td><td>B</td><td>C</td></tr><tr><td></td><td>3</td><td>6</td><td>7</td></tr><tr><td></td><td>2</td><td>5</td><td>7</td></tr><tr><td></td><td>4</td><td>4</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                416,
                141,
                591,
                225
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Rns "
                    }
                ]
            },
            "bbox": [
                630,
                155,
                675,
                174
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/93ed466fae3892b534eddcaca7e87f2cf55bb9e84dfa9486f0596726040b9020.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>7</td><td>2</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                684,
                148,
                820,
                211
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/f7a972290b997ac1e67f97dde32f8d7c5283063ac9bf65af4db97d53c8a781bd.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>R×S</td><td>R.A</td><td>R.B</td><td>R.C</td><td>S.A</td><td>S.B</td><td>S.C</td></tr><tr><td></td><td>3</td><td>6</td><td>7</td><td>3</td><td>4</td><td>5</td></tr><tr><td></td><td>3</td><td>6</td><td>7</td><td>7</td><td>2</td><td>3</td></tr><tr><td></td><td>2</td><td>5</td><td>7</td><td>3</td><td>4</td><td>5</td></tr><tr><td></td><td>2</td><td>5</td><td>7</td><td>7</td><td>2</td><td>3</td></tr><tr><td></td><td>7</td><td>2</td><td>3</td><td>3</td><td>4</td><td>5</td></tr><tr><td></td><td>7</td><td>2</td><td>3</td><td>7</td><td>2</td><td>3</td></tr><tr><td></td><td>4</td><td>4</td><td>3</td><td>3</td><td>4</td><td>5</td></tr><tr><td></td><td>4</td><td>4</td><td>3</td><td>7</td><td>2</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                156,
                282,
                473,
                441
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/d944f3935131dfe1b6413fdd7827d2be282a113442b18da57d00845a77f4242e.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td colspan=\"4\">π3,2(S)</td><td colspan=\"4\">σB&lt;&#x27;,5&#x27;(R)</td></tr><tr><td>C</td><td>B</td><td></td><td></td><td>A</td><td>B</td><td>C</td><td></td></tr><tr><td>5</td><td>4</td><td></td><td></td><td>7</td><td>2</td><td>3</td><td></td></tr><tr><td>3</td><td>2</td><td></td><td></td><td>4</td><td>4</td><td>3</td><td></td></tr><tr><td rowspan=\"2\">R×S2&lt;2</td><td>R.A</td><td>R.B</td><td>R.C</td><td>S.A</td><td>S.B</td><td>S.C</td><td></td></tr><tr><td>7</td><td>2</td><td>3</td><td>3</td><td>4</td><td>5</td><td></td></tr></table>",
                "table_type": "complex_table",
                "table_nest_level": 1
            },
            "bbox": [
                512,
                282,
                825,
                451
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "RXS. "
                    }
                ]
            },
            "bbox": [
                200,
                470,
                248,
                487
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/503e73dd9a26c985fd2541af47e6ef25ee480fb8c5483f8a0e76437ee8c45f0f.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>7</td><td>2</td><td>3</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                268,
                468,
                403,
                520
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "有关实际应用，应该多看例题，多做习题，必须达到以下要求： 能够根据给出的关系代数表达式计算关系值，也能够根据相应查询要求列出关系表达式。"
                    }
                ]
            },
            "bbox": [
                144,
                556,
                847,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（1）在列关系表达式时，通常有以下形式："
                    }
                ]
            },
            "bbox": [
                156,
                594,
                485,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\pi . . . ( \\sigma . . ( \\mathsf { R } { \\times } \\mathsf { S } ) )"
                    },
                    {
                        "type": "text",
                        "content": "或者 π...(σ...(R S))"
                    }
                ]
            },
            "bbox": [
                144,
                613,
                384,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "首先把查询涉及到的关系取来，执行笛卡尔积或自然连接操作得到一张大的表格，然后对大表格执行水平分割(选择)和垂直分割(投影)操作。"
                    }
                ]
            },
            "bbox": [
                144,
                630,
                847,
                664
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（2）当查询涉及到否定或全部的逻辑时，往往要用到差或除法操作。"
                    }
                ]
            },
            "bbox": [
                154,
                668,
                678,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学生关系 S(SNO,SNAME,AGE,SEX)"
                    }
                ]
            },
            "bbox": [
                146,
                686,
                396,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学习关系 SC(SNO,CNO,GRADE)"
                    }
                ]
            },
            "bbox": [
                184,
                705,
                415,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "课程关系 C(CNO,CNAME,TEACHER)"
                    }
                ]
            },
            "bbox": [
                186,
                722,
                445,
                739
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "下面用关系代数表达式表达每个查询语句。"
                    }
                ]
            },
            "bbox": [
                166,
                741,
                495,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(1) 检索学习课程号为 C2 的学生学号与成绩。"
                    }
                ]
            },
            "bbox": [
                146,
                760,
                489,
                776
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\mathrm {S N O}, \\text {G R A D E}} (\\sigma_ {\\mathrm {C N O} = ^ {\\prime} \\mathrm {C 2} ^ {\\prime}} (\\mathrm {S C}))",
                "math_type": "latex",
                "image_source": {
                    "path": "images/e618f04cf3f6c98899bb55797c516781aae58868acf9490aba3b926b72097504.jpg"
                }
            },
            "bbox": [
                161,
                780,
                327,
                795
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2) 检索学习课程号为C2的学生学号与姓名 "
                    }
                ]
            },
            "bbox": [
                146,
                797,
                480,
                813
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {S N O, S N A M E} \\left(\\sigma_ {C N O = ^ {\\prime} C 2 ^ {\\prime}} (S \\times S C)\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/2bcb83724afc6de0e7ba16f184b498c2f9fab9009a78ddce43f26008427f6e20.jpg"
                }
            },
            "bbox": [
                156,
                816,
                351,
                832
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "由于这个查询涉及到两个关系S和SC，因此先对这两个关系进行自然连接，同一位学生的有关的信息，然后再执行选择投影操作。"
                    }
                ]
            },
            "bbox": [
                144,
                834,
                847,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "此查询亦可等价地写成："
                    }
                ]
            },
            "bbox": [
                146,
                872,
                334,
                887
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\text {S N O}, \\text {S N A M E}} (\\mathbf {s}) \\bowtie (\\pi_ {\\text {S N O}} (\\sigma_ {\\text {C N O} = ^ {\\prime} C 2 ^ {\\prime}} (\\text {S C})))",
                "math_type": "latex",
                "image_source": {
                    "path": "images/a19c07c41b4261d18a9024df4fa26f330f01a40c4051e176fc76ec7900cfd6fd.jpg"
                }
            },
            "bbox": [
                161,
                890,
                443,
                906
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这个表达式中自然连接的右分量为\"学了C2课的学生学号的集合\"。这个表达式比前一个表达式优化，执行起来要省时间，省空间。"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                848,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（3）检索选修课程名为 MATHS 的学生学号与姓名。"
                    }
                ]
            },
            "bbox": [
                156,
                130,
                544,
                145
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {S N O, S A N M E} \\left(\\sigma_ {C N A M E = ^ {\\prime} M A T H S ^ {\\prime}} (S \\times S C \\times C)\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/70df10f1abb4a5ce03f24333a78fa5d20f48e0997ff40fa43e093bf3840a4a28.jpg"
                }
            },
            "bbox": [
                161,
                149,
                413,
                165
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（4）检索选修课程号为C2或C4的学生学号。"
                    }
                ]
            },
            "bbox": [
                157,
                167,
                500,
                181
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\mathrm {S N O}} \\left(\\sigma_ {\\mathrm {C N O} = ^ {\\prime} \\mathrm {C 2} ^ {\\prime} \\mathrm {V} ^ {\\prime} \\mathrm {C N O} = ^ {\\prime} \\mathrm {C 4} ^ {\\prime}} (\\mathrm {S C})\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/f1297846dd314999c9d93d19ce82777c5f6f16302e7b18bc2641079beb2a3968.jpg"
                }
            },
            "bbox": [
                161,
                186,
                334,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（5） 检索至少选修课程号为 C2 或 C4 的学生学号。"
                    }
                ]
            },
            "bbox": [
                157,
                204,
                539,
                219
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {1} \\left(\\sigma_ {1 = 4 \\wedge 2 = ^ {\\prime} C 2 ^ {\\prime} \\wedge 5 = ^ {\\prime} C 4 ^ {\\prime}} (\\mathrm {S C} \\times \\mathrm {S C})\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/d3f16428529e2d93346b06ad51a870d72df4e0a39d4deff2673b479a50264030.jpg"
                }
            },
            "bbox": [
                161,
                223,
                366,
                239
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这里（ "
                    },
                    {
                        "type": "equation_inline",
                        "content": "5 C { \\times } 5 C"
                    },
                    {
                        "type": "text",
                        "content": "）表示关系SC自身相乘的乘积操作，其中数字1，2，4，5都为它的结果关系中的属性序号。 这个大家理解即可，太绕了，可以用除法实现："
                    }
                ]
            },
            "bbox": [
                144,
                241,
                847,
                275
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\mathrm {S N O}, \\mathrm {c n o}} (\\mathrm {S C}) \\div \\pi \\mathrm {c} _ {\\mathrm {N O}} \\left(\\sigma_ {\\mathrm {C N O} = ^ {\\prime} \\mathrm {C 2} ^ {\\prime}} \\mathrm {v C N O} = ^ {\\prime} \\mathrm {C 4} ^ {\\prime} (\\mathrm {S C})\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/60606af738a48d58528af30f4f48351bbb7012f5a0ed1cf812cfe1dacc0163fd.jpg"
                }
            },
            "bbox": [
                144,
                279,
                408,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（6） 检索不学C2课的学生姓名与年龄。"
                    }
                ]
            },
            "bbox": [
                156,
                297,
                460,
                312
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\text {S N A M E}, \\text {A G E}} (\\mathbf {s}) - \\pi_ {\\text {S N A M E}, \\text {A G E}} \\left(\\sigma_ {\\text {C N O} = ^ {\\prime} \\mathrm {C 2}} (\\mathbf {s} \\times \\mathbf {s c})\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/4f9bb565c05889ea05ff6b5c705f8c0fa4322c18cc16d071ecc9f9e124ec53c1.jpg"
                }
            },
            "bbox": [
                161,
                316,
                509,
                332
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这个表达式用了差运算，差运算的左分量为\"全体学生的姓名和年龄\"，右分量为\"学了C2课的学生姓名与年龄\"。"
                    }
                ]
            },
            "bbox": [
                144,
                334,
                848,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（7）检索学习全部课程的学生姓名。"
                    }
                ]
            },
            "bbox": [
                156,
                370,
                431,
                387
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "编写这个查询语句的关系代数过程如下："
                    }
                ]
            },
            "bbox": [
                144,
                390,
                458,
                405
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(a) 学生选课情况可用 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\pi _ { \\mathsf { S N O , C N O } } ( \\mathsf { S C } )"
                            },
                            {
                                "type": "text",
                                "content": "表示；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(b) 全部课程可用 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\pi _ { \\mathsf { C N O } } ( \\mathsf { C } )"
                            },
                            {
                                "type": "text",
                                "content": "表示；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(c) 学了全部课程的学生学号可用除法操作表示。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                407,
                515,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "操作结果为学号SNO的集合，该集合中每个学生（对应SNO)与C中任一门课程号CNO配在一起都在πSCO，CNO（SC） 中出现（即SC中出现），所以结果中每个学生都学了全部的课程（这是\"除法\"操作的含义）："
                    }
                ]
            },
            "bbox": [
                144,
                464,
                848,
                516
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\mathrm {S N O}, \\mathrm {C N O}} (\\mathrm {S C}) \\div \\pi_ {\\mathrm {C N O}} (\\mathrm {C})",
                "math_type": "latex",
                "image_source": {
                    "path": "images/af972176132ec4d6dea1074ae82b78835071c293b7b352f55863126d49645f0f.jpg"
                }
            },
            "bbox": [
                161,
                520,
                304,
                535
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(d) 从 SNO 求学生姓名 SNAME，可以用自然连结和投影操作组合而成："
                    }
                ]
            },
            "bbox": [
                146,
                538,
                682,
                552
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {S N A M E} (S \\boxtimes (\\pi_ {S N O, C N O} (S C) \\div \\pi_ {C N O} (C)))",
                "math_type": "latex",
                "image_source": {
                    "path": "images/f4998326c9d5a4c13009794f1edc4c2a13ea0e596c263773ad05865312c75bfc.jpg"
                }
            },
            "bbox": [
                161,
                557,
                396,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这就是最后得到的关系代数表达式。"
                    }
                ]
            },
            "bbox": [
                144,
                574,
                423,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "（8） 检索所学课程包含S3所学课程的学生学号。"
                    }
                ]
            },
            "bbox": [
                156,
                594,
                529,
                608
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "注意：学生S3可能学多门课程，所以要用到除法操作来表达此查询语句。"
                    }
                ]
            },
            "bbox": [
                144,
                612,
                710,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学生选课情况可用操作 πSNO,CNO(SC)表示；"
                    }
                ]
            },
            "bbox": [
                168,
                630,
                478,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "所学课程包含学生S3所学课程的学生学号，可以用除法操作求得："
                    }
                ]
            },
            "bbox": [
                168,
                649,
                682,
                665
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\pi_ {\\mathrm {S N O}, \\mathrm {C N O}} (\\mathrm {S C}) \\div \\pi_ {\\mathrm {C N O}} \\left(\\sigma_ {\\mathrm {S N O} = ^ {\\prime} \\mathrm {S} ^ {\\prime}} (\\mathrm {S C})\\right)",
                "math_type": "latex",
                "image_source": {
                    "path": "images/4b3a5a8fd610eeaa8e87dd78816e8169811b78694acce0c2798ed129a4d70369.jpg"
                }
            },
            "bbox": [
                161,
                669,
                384,
                684
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "查询优化的目的就是为了系统在执行时既省时间又能提高效率。"
                    }
                ]
            },
            "bbox": [
                157,
                93,
                631,
                109
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在关系代数运算中，通常是先进行笛卡尔积或连接运算，再进行选择和投影。笛卡尔积或连接运算却往往花费教多的时间。"
                    }
                ]
            },
            "bbox": [
                157,
                112,
                836,
                146
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "因此，恰当地安排选择、投影和连接的顺序直接影响到整个操作所需要的时间和空间。如何安排若干关系的运算操作步骤，是查询优化所要考虑的问题。"
                    }
                ]
            },
            "bbox": [
                157,
                149,
                836,
                185
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.2关系代数表达式的等价变换规则"
                    }
                ],
                "level": 1
            },
            "bbox": [
                157,
                200,
                487,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到”识记”层次"
                    }
                ]
            },
            "bbox": [
                157,
                221,
                384,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：等价变换规则"
                    }
                ]
            },
            "bbox": [
                159,
                240,
                332,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "两个关系代数表达式等价是指用同样的关系实例代替两个表达式中相应关系时所得到的结果是完全一样的。"
                    }
                ]
            },
            "bbox": [
                157,
                278,
                828,
                313
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "等价变换规则有很多，不要死记，从语义上理解。"
                    }
                ]
            },
            "bbox": [
                184,
                316,
                554,
                332
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "其实，只要在前面的学习中已经掌握关系运算的真正含义，就可以判断两个关系代数表达式是否等价。"
                    }
                ]
            },
            "bbox": [
                157,
                335,
                836,
                370
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.3优化的策略"
                    }
                ],
                "level": 1
            },
            "bbox": [
                157,
                390,
                307,
                407
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到”领会”层次"
                    }
                ]
            },
            "bbox": [
                157,
                411,
                384,
                426
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：优化的策略及其简单应用"
                    }
                ]
            },
            "bbox": [
                159,
                430,
                416,
                445
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "优化的策略主要有以下几点："
                    }
                ]
            },
            "bbox": [
                157,
                468,
                376,
                483
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)在关系代数表达式中尽可能早地执行选择操作；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)把笛卡尔积和随后的选择操作合并成F连接运算；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)同时计算一连串的选择和投影操作；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（4)保留同一子表达式的结果；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(5)适当对关系文件进行预处理；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(6)计算表达式之前先估计一下怎么计算合算。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                157,
                487,
                552,
                596
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "以上优化策略要求会简单应用：先做选择，运用投影去除多余属性等等。"
                    }
                ]
            },
            "bbox": [
                157,
                619,
                697,
                634
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "3.4关系代数表达式的优化算法"
                    }
                ],
                "level": 1
            },
            "bbox": [
                157,
                656,
                447,
                673
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到”简单应用”层次"
                    }
                ]
            },
            "bbox": [
                157,
                676,
                416,
                692
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：语法树 "
                    }
                ]
            },
            "bbox": [
                159,
                696,
                282,
                711
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "学会画语法树，并掌握优化算法。"
                    }
                ]
            },
            "bbox": [
                157,
                733,
                410,
                749
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "举例"
                    }
                ],
                "level": 1
            },
            "bbox": [
                159,
                771,
                196,
                785
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在教学数据库S、SC`C中,用户有一查询语句：检索女同学选修课程的课程名和任课教师名。"
                    }
                ]
            },
            "bbox": [
                157,
                793,
                840,
                809
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1)试写出该查询的关系代数表达式；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)试写出查询优化的关系代数表达式；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(3)画出该查询初始的关系代数表达式的语法树；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(4)使用2.4.4节的优化算法，对语法树进行优化，并画出优化后的语法树。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                157,
                815,
                722,
                894
            ]
        }
    ],
    [
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)πCNAME,TEACHER(σSEX='女'(S SC C)) "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)优化为： "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\pi _ { \\mathtt { C N A M E } , \\mathtt { \\tau _ { F E A C H E R } } } ( \\mathtt { C l } \\Join _ { \\mathtt { C } _ { \\# } } ( \\pi _ { \\mathtt { S } _ { \\# } , \\mathtt { C } _ { \\# } } ( \\mathsf { S C } ) \\lvert \\Join"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                131,
                568,
                165
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(基本思路：尽量提前做选择操作；在每个操作后，应做个投影操作，去掉不用的属性值。"
                    }
                ]
            },
            "bbox": [
                146,
                167,
                833,
                183
            ]
        },
        {
            "type": "image",
            "content": {
                "image_source": {
                    "path": "images/c5cf98588f1c817af21465451f17d7e9f054f7bca7a17b1c8e3429dea7fae0c5.jpg"
                },
                "image_caption": [],
                "image_footnote": []
            },
            "bbox": [
                215,
                191,
                460,
                435
            ]
        },
        {
            "type": "image",
            "content": {
                "image_source": {
                    "path": "images/6131cc150d270daaf1dc47600b95b66abf7ade9afaefa725c74c406a4e9517c9.jpg"
                },
                "image_caption": [],
                "image_footnote": []
            },
            "bbox": [
                512,
                187,
                757,
                456
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系数据库是以关系模型为基础的数据库，它利用关系来描述现实世界。"
                    }
                ]
            },
            "bbox": [
                144,
                529,
                705,
                545
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "一个关系既可以用来描述一个实体及其属性，也可以用来描述实体间的联系。 关系实质上就是一张二维表，表的行称为元组，列称为属性。 关系是元组的集合，关系模式就是这个元组集合的描述。"
                    }
                ]
            },
            "bbox": [
                144,
                548,
                845,
                601
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系模式是用来定义关系的， 一个关系数据库包含一组关系，也就是包含一组二维表，这些二维表结构体的集合就构成数据库的模式(也可以理解为数据库的结构)。"
                    }
                ]
            },
            "bbox": [
                144,
                604,
                845,
                638
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系数据库设计理论包括三个方面内容：数据依赖、范式、模式设计（分解）方法。核心内容是数据依赖。"
                    }
                ]
            },
            "bbox": [
                144,
                640,
                793,
                675
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2函数依赖(FD"
                    }
                ],
                "level": 1
            },
            "bbox": [
                157,
                99,
                319,
                118
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "2.1 函数依赖的定义"
                    }
                ],
                "level": 1
            },
            "bbox": [
                169,
                145,
                356,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "考核要求：达到”领会”层次"
                    }
                ]
            },
            "bbox": [
                169,
                165,
                394,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "知识点：函数依赖的定义"
                    }
                ]
            },
            "bbox": [
                169,
                185,
                359,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设有关系模式R(A1,A2，...An)或简记为RUXY是U的子集，r是R的任一具体关系，如果对r的任意两个元组t1,t2,由t1[X]=t2[X导致t1[Y]=t2[Y],则称×函数决定Y,或Y函数依赖于×，记为X→Y。X→Y为模式R的一个函数依赖。"
                    }
                ]
            },
            "bbox": [
                168,
                222,
                850,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "该定义理解如下：有一张设计好的二维表，×，Y是表的某些列（可以是一列，也可以是多列)，若在表中的第t1行，和第t2行上的×值相等，那么必有t1行和t2行上的Y值也相等，这就是说Y函数依赖于X。"
                    }
                ]
            },
            "bbox": [
                168,
                298,
                847,
                351
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/6b67f4dc8d5af01b51a072f037f19df3f1b01c63795217e36a9bf97672f2e1bd.jpg"
                },
                "table_caption": [
                    {
                        "type": "text",
                        "content": "比如，有如下二维表"
                    }
                ],
                "table_footnote": [],
                "html": "<table><tr><td>学号</td><td>姓名</td><td>成绩</td><td>成绩等级</td></tr><tr><td>00001</td><td>李里</td><td>77</td><td>C</td></tr><tr><td>00002</td><td>丁力</td><td>91</td><td>A</td></tr><tr><td>00003</td><td>李小红</td><td>85</td><td>B</td></tr><tr><td>00004</td><td>马琳</td><td>85</td><td>B</td></tr><tr><td>00005</td><td>王佳怡</td><td>66</td><td>D</td></tr><tr><td>00006</td><td>胡林</td><td>70</td><td>C</td></tr><tr><td>...</td><td>......</td><td>......</td><td>......</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                149,
                391,
                563,
                663
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "在表中，凡成绩相同的，对应的“成绩等级\"也必是相同的，因此，“成绩等级\"函数依赖于\"成绩”。但是反过来则不成立。"
                    }
                ]
            },
            "bbox": [
                156,
                665,
                863,
                697
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [],
                "level": 1
            },
            "bbox": [
                157,
                703,
                213,
                715
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(1)在这张表中，任何一行的关系均应符合函数依赖的条件，如果有一行不符合函数依赖的条件，则函数依赖对于这个关系就不成立。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "(2)函数依赖是否成立是不可证明的，只能通过属性的含义来判断."
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                156,
                720,
                862,
                772
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "码是唯一标识实体的属性集。"
                    }
                ]
            },
            "bbox": [
                144,
                816,
                369,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "码和函数依赖的关系满足以下两个条件："
                    }
                ]
            },
            "bbox": [
                144,
                834,
                458,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设关系模式R(A1,A2...An)，F是R上的函数依赖集，X是R的一个子集，如果(1)X→A1A2...An∈F+"
                    }
                ]
            },
            "bbox": [
                144,
                852,
                751,
                885
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(X能够决定唯一的一个元组)"
                    }
                ]
            },
            "bbox": [
                154,
                890,
                376,
                906
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(2)不存在 X 的真子集 Y，使得 Y→A1A2...An 成立"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                515,
                109
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "(X 能满足（1）但又没有多余的属性集）"
                    }
                ]
            },
            "bbox": [
                152,
                112,
                458,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "则 X 就是 R 的一个候选码。"
                    }
                ]
            },
            "bbox": [
                144,
                130,
                349,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "包含在任何一个候选码中的属性称为主属性，不包含在任何码中的属性为非主属性(非码属性)， 注意主属性应当包含在候选码中（只需要出现在一个候选码中就是主属性）。"
                    }
                ]
            },
            "bbox": [
                144,
                148,
                847,
                183
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1NF：第一范式——即关系模式中的属性的值域中每一个值都是不可再分解的值。"
                    }
                ]
            },
            "bbox": [
                146,
                186,
                773,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如果某个数据库模式都是第一范式的，则称该数据库模式是属于第一范式的数据库模式。"
                    }
                ]
            },
            "bbox": [
                144,
                204,
                831,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如果关系模式R为第一范式，并且R中每一个非主属性完全函数依赖于R的某个候选码，则称为第二范式模式。"
                    }
                ]
            },
            "bbox": [
                144,
                223,
                838,
                258
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "首先温习、理解“非主属性”、“完全函数依赖”、“候选码”这三个名词的含义。"
                    }
                ]
            },
            "bbox": [
                144,
                278,
                793,
                294
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（1）候选码：可以唯一决定关系模式R中某元组值且不含有多余属性的属性集。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（2）非主属性：即非码属性，指关系模式 R 中不包含在任何建中的属性。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "（3）完全函数依赖：设有函数依赖 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\mathsf { W } } { \\to } \\mathsf { A }"
                            },
                            {
                                "type": "text",
                                "content": "，若存在 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathsf { x } \\mathsf { \\subseteq } _ { \\mathsf { W } }"
                            },
                            {
                                "type": "text",
                                "content": "，有 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathsf { X } { \\to } \\mathsf { A }"
                            },
                            {
                                "type": "text",
                                "content": "成立，那么称 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\mathsf { W } } { \\to } \\mathsf { A }"
                            },
                            {
                                "type": "text",
                                "content": "是局部依赖，否则就称 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\mathsf { W } } { \\to } \\mathsf { A }"
                            },
                            {
                                "type": "text",
                                "content": "是完全函数依赖。"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                297,
                847,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "如果关系模式R是第二范式，且每个非主属性都不传递依赖于R的候选码，则称R为第三范式模式。"
                    }
                ]
            },
            "bbox": [
                144,
                370,
                847,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "传递依赖的含义： 在关系模式中，如果 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { Y } { \\to } \\mathsf { X }"
                    },
                    {
                        "type": "text",
                        "content": "， "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { X } { \\to } \\mathsf { A }"
                    },
                    {
                        "type": "text",
                        "content": "，且 X Y(X 不决定 Y)和 A X(A 不属于X)，那么 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { Y } { \\to } \\mathsf { A }"
                    },
                    {
                        "type": "text",
                        "content": "是传递依赖。 Notice:要求非主属性都不传递依赖于候选码。"
                    }
                ]
            },
            "bbox": [
                144,
                407,
                847,
                443
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "上一小节例子中student（学号，姓名），study（学号，课程，成绩）都是3NF"
                    }
                ]
            },
            "bbox": [
                144,
                463,
                757,
                479
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "这个范式和第三范式有联系，它是 3NF 的改进形式。"
                    }
                ]
            },
            "bbox": [
                144,
                482,
                546,
                498
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "若关系模式 R是第一范式，且每个属性都不传递依赖于 R的候选码。这种关系模式就是BCNF 模式。"
                    }
                ]
            },
            "bbox": [
                144,
                501,
                847,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "四种范式，可以发现它们之间存在如下关系："
                    }
                ]
            },
            "bbox": [
                146,
                538,
                494,
                552
            ]
        },
        {
            "type": "equation_interline",
            "content": {
                "math_content": "\\mathrm {B C N F} \\subseteq 3 \\mathrm {N F} \\subseteq 2 \\mathrm {N F} \\subseteq 1 \\mathrm {N F}",
                "math_type": "latex",
                "image_source": {
                    "path": "images/1b5eeedcceed3050db4bd32f6b0b831cedb9cf97bd5498c5ab21fd677084b9cf.jpg"
                }
            },
            "bbox": [
                179,
                555,
                352,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1NF "
                    }
                ]
            },
            "bbox": [
                440,
                581,
                470,
                593
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "↓ 消去非主属性对码的部分函数依赖"
                    }
                ]
            },
            "bbox": [
                473,
                608,
                800,
                623
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "2NF "
                    }
                ]
            },
            "bbox": [
                438,
                636,
                470,
                648
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "↓ 消去非主属性对码的传递函数依赖"
                    }
                ]
            },
            "bbox": [
                473,
                663,
                800,
                678
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "3NF "
                    }
                ]
            },
            "bbox": [
                440,
                690,
                470,
                703
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "↓ 消去主属性对码的传递函数依赖"
                    }
                ]
            },
            "bbox": [
                473,
                718,
                781,
                733
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "BCNF "
                    }
                ]
            },
            "bbox": [
                438,
                747,
                480,
                758
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "SQL 语言"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                770,
                216,
                784
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据定义语言 DDL (Data Definition Language)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                788,
                489,
                804
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用于创建、更改或删除数据库对象，如包括定义 Database, Table, View,Index,完整性约束条件等，也包括定义对象(RowType行对象, Type列对象)"
                    }
                ]
            },
            "bbox": [
                147,
                807,
                687,
                859
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语句包括：CREATE（建立）、ALTER（修改）、DROP（撤销）"
                    }
                ]
            },
            "bbox": [
                149,
                862,
                620,
                878
            ]
        },
        {
            "type": "page_number",
            "content": {
                "page_number_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                883,
                159,
                892
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据操纵语言 DML (Data Manipulation Language)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                93,
                519,
                109
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用于操纵数据库对象（如表）。"
                    }
                ]
            },
            "bbox": [
                149,
                112,
                393,
                127
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "ü 各种方式的更新与检索操作，如直接输入记录，从其他 Table(由 SubQuery 建立)输入"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "ü 各种复杂条件的检索，如连接查找，模糊查找，分组查找，嵌套查找等"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "ü 各种聚集操作，求平均、求和、…等，分组聚集，分组过滤等"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                146,
                130,
                806,
                183
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语句包括：SELECT、INSERT、UPDATE、DELETE"
                    }
                ]
            },
            "bbox": [
                149,
                186,
                510,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                206,
                159,
                217
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "数据控制语言 DCL (Data Control Language)"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                223,
                468,
                239
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "用于定义控制访问对象（如表）。"
                    }
                ]
            },
            "bbox": [
                149,
                241,
                410,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v 安全性控制：授权和撤消授权"
                    }
                ]
            },
            "bbox": [
                146,
                260,
                393,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "语句包括：GRANT、REVOKE"
                    }
                ]
            },
            "bbox": [
                149,
                279,
                373,
                293
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQL的数据定义语句（DDL）包括以下语句："
                    }
                ]
            },
            "bbox": [
                146,
                297,
                482,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "创建 删除 修改"
                    }
                ]
            },
            "bbox": [
                147,
                316,
                265,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "表 CTEATE TABLE DROP TABLE ALTER TABLE"
                    }
                ]
            },
            "bbox": [
                146,
                335,
                458,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图 CTEATE VIEW DROP VIEW ALTER VIEW"
                    }
                ]
            },
            "bbox": [
                146,
                353,
                463,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "索引 CTEATE INDEX DROP INDEX "
                    }
                ]
            },
            "bbox": [
                146,
                372,
                386,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n 注意：索引无修改语句！"
                    }
                ]
            },
            "bbox": [
                146,
                390,
                349,
                405
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "创建 Database"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                426,
                260,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "数据库(Database)是若干具有相互关联关系的 Table/Relation 的集合"
                    }
                ]
            },
            "bbox": [
                146,
                445,
                677,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "数据库可以看作是一个集中存放若干 Table 的大型文件"
                    }
                ]
            },
            "bbox": [
                147,
                464,
                584,
                479
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Øcreate database 的简单语法形式："
                    }
                ]
            },
            "bbox": [
                146,
                483,
                413,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "create "
                    }
                ]
            },
            "bbox": [
                146,
                502,
                198,
                514
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "database "
                    }
                ]
            },
            "bbox": [
                146,
                520,
                220,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库名;"
                    }
                ]
            },
            "bbox": [
                146,
                538,
                226,
                552
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "⽰例：创建课程学习数据库 SCT"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                556,
                393,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "create "
                    }
                ]
            },
            "bbox": [
                147,
                576,
                196,
                588
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "database "
                    }
                ]
            },
            "bbox": [
                147,
                594,
                218,
                607
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SCT; "
                    }
                ]
            },
            "bbox": [
                147,
                612,
                183,
                626
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "嵌入式 sql"
                    }
                ],
                "level": 1
            },
            "bbox": [
                146,
                649,
                228,
                665
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                670,
                159,
                680
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQLCA： SQL Communication Area"
                    }
                ]
            },
            "bbox": [
                146,
                687,
                401,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n SQLCA是一个数据结构"
                    }
                ]
            },
            "bbox": [
                147,
                705,
                337,
                720
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                725,
                159,
                736
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SQLCA 的用途"
                    }
                ]
            },
            "bbox": [
                146,
                741,
                255,
                757
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n SQL语句执行后，RDBMS反馈给应用程序信息"
                    }
                ]
            },
            "bbox": [
                146,
                760,
                515,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "描述系统当前工作状态"
                    }
                ]
            },
            "bbox": [
                147,
                778,
                344,
                793
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "\\varnothing"
                    },
                    {
                        "type": "text",
                        "content": "描述运行环境"
                    }
                ]
            },
            "bbox": [
                147,
                797,
                273,
                812
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n 这些信息将送到 SQL 通信区 SQLCA 中"
                    }
                ]
            },
            "bbox": [
                146,
                816,
                447,
                831
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n 应用程序从 SQLCA 中取出这些状态信息，据此决定接下"
                    }
                ]
            },
            "bbox": [
                146,
                834,
                589,
                848
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "来执行的语句"
                    }
                ]
            },
            "bbox": [
                146,
                853,
                257,
                868
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储过程"
                    }
                ]
            },
            "bbox": [
                146,
                890,
                221,
                904
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储过程（Procedure）是一组为了完成"
                    }
                ]
            },
            "bbox": [
                144,
                93,
                458,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "特定功能的SQL语句集，经编译后存储在"
                    }
                ]
            },
            "bbox": [
                146,
                112,
                468,
                127
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库中，可供应用程序在需要时调用。"
                    }
                ]
            },
            "bbox": [
                147,
                130,
                458,
                145
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "允许模块化程序设计，含有控制语句"
                    }
                ]
            },
            "bbox": [
                147,
                148,
                433,
                164
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储过程能够实现较快的执行速度"
                    }
                ]
            },
            "bbox": [
                147,
                168,
                416,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储过程能够减少网络流量"
                    }
                ]
            },
            "bbox": [
                147,
                186,
                363,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "存储过程可被作为一种安全机制来充分利用"
                    }
                ]
            },
            "bbox": [
                147,
                205,
                485,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "带参数的存储过程举例"
                    }
                ]
            },
            "bbox": [
                147,
                223,
                327,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "CREATE PROCEDURE pro_student_sno "
                    }
                ]
            },
            "bbox": [
                147,
                242,
                423,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "@givensno char(7) "
                    }
                ]
            },
            "bbox": [
                147,
                261,
                285,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "AS "
                    }
                ]
            },
            "bbox": [
                147,
                280,
                169,
                291
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "SELECT sno,sname "
                    }
                ]
            },
            "bbox": [
                147,
                297,
                282,
                310
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM student "
                    }
                ]
            },
            "bbox": [
                147,
                316,
                255,
                329
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WHERE sno=@givensno;"
                    }
                ]
            },
            "bbox": [
                147,
                335,
                327,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "n 执行"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                200,
                367
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "EXEC pro_student_sno "
                    },
                    {
                        "type": "equation_inline",
                        "content": "@"
                    },
                    {
                        "type": "text",
                        "content": "givensno "
                    },
                    {
                        "type": "equation_inline",
                        "content": "= ^ { 1 }"
                    },
                    {
                        "type": "text",
                        "content": "2000101' "
                    }
                ]
            },
            "bbox": [
                147,
                372,
                478,
                386
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "EXEC pro_student_sno '2000101';、"
                    }
                ]
            },
            "bbox": [
                147,
                392,
                400,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可授权的数据对象：数据库、模式（全局模式、"
                    }
                ]
            },
            "bbox": [
                146,
                426,
                510,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "外模式），数据（表、属性）"
                    }
                ]
            },
            "bbox": [
                147,
                445,
                369,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可以授权的操作："
                    }
                ]
            },
            "bbox": [
                147,
                464,
                282,
                478
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库的建立、删除、连接"
                    }
                ]
            },
            "bbox": [
                147,
                482,
                363,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "模式的建立、修改、检索"
                    }
                ]
            },
            "bbox": [
                147,
                501,
                346,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据的建立、检索、修改"
                    }
                ]
            },
            "bbox": [
                147,
                520,
                346,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对应的 SQL 语句："
                    }
                ]
            },
            "bbox": [
                147,
                538,
                282,
                552
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "GRANT, REVOKE，数据库安全性控制是属于"
                    }
                ]
            },
            "bbox": [
                147,
                557,
                480,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DCL范畴。"
                    }
                ]
            },
            "bbox": [
                147,
                576,
                225,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "可以结合视图加强对数据库存取的控制GRANT命令：把权限授予某一用户，以允许该用户执行针"
                    }
                ]
            },
            "bbox": [
                146,
                593,
                847,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对该对象的操作或允许其运行某些语句。"
                    }
                ]
            },
            "bbox": [
                147,
                630,
                458,
                645
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "REVOKE命令：用来撤销用户对某一对象或语句的权限，使其不能执行操作，除非该用户是角色成员，且角色被授权。"
                    }
                ]
            },
            "bbox": [
                147,
                649,
                618,
                683
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "DENY 命令：用来禁止用户对某一对象或语句的权限，它不"
                    }
                ]
            },
            "bbox": [
                147,
                686,
                628,
                701
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "允许该用户执行针对数据库对象的某些操作或不允许其运行某些语句。对象"
                    }
                ]
            },
            "bbox": [
                147,
                705,
                628,
                738
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对象类"
                    }
                ]
            },
            "bbox": [
                147,
                741,
                203,
                756
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "型"
                    }
                ]
            },
            "bbox": [
                147,
                760,
                169,
                775
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "操作权限 "
                    }
                ]
            },
            "bbox": [
                147,
                778,
                221,
                793
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "属性列 Column Select,insert,update,delete,all "
                    }
                ]
            },
            "bbox": [
                147,
                797,
                487,
                813
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "视图"
                    }
                ]
            },
            "bbox": [
                147,
                816,
                186,
                829
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "view "
                    }
                ]
            },
            "bbox": [
                147,
                835,
                186,
                847
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select,insert,update,delete,all "
                    }
                ]
            },
            "bbox": [
                147,
                853,
                369,
                866
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "基本表"
                    }
                ]
            },
            "bbox": [
                147,
                872,
                203,
                885
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "table "
                    }
                ]
            },
            "bbox": [
                147,
                891,
                189,
                903
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Select,insert,update,delete,alter, "
                    }
                ]
            },
            "bbox": [
                144,
                93,
                389,
                108
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "index ,all "
                    }
                ]
            },
            "bbox": [
                146,
                112,
                216,
                126
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数据库 datebase createdbGRANT {all PRIVILEGES | privilege {,privilege…}} ON[TABLE] "
                    }
                ]
            },
            "bbox": [
                146,
                130,
                774,
                146
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "tablename | viewname "
                    }
                ]
            },
            "bbox": [
                147,
                149,
                322,
                162
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "TO {public | user-id {, user-id…}} [WITH GRANT OPTION]; "
                    }
                ]
            },
            "bbox": [
                147,
                167,
                564,
                181
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " user-id ，某一个用户账户，由 DBA 创建的合法账户"
                    }
                ]
            },
            "bbox": [
                147,
                186,
                564,
                200
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " public, "
                    }
                ]
            },
            "bbox": [
                147,
                204,
                220,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "允许所有有效用户使用授予的权利"
                    }
                ]
            },
            "bbox": [
                147,
                223,
                416,
                237
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "privilege 是下面的权利"
                    }
                ]
            },
            "bbox": [
                147,
                242,
                339,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": " SELECT | INSERT | UPDATE | DELETE | ALL PRIVILEDGES "
                    }
                ]
            },
            "bbox": [
                147,
                260,
                573,
                274
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "WITH GRANT OPTION 选项是允许被授权者传播这些权利取消权限 "
                    }
                ]
            },
            "bbox": [
                147,
                278,
                665,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "取消权限的SQL语句是："
                    }
                ]
            },
            "bbox": [
                147,
                297,
                334,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "REVOKE <权限列表>"
                    }
                ]
            },
            "bbox": [
                147,
                316,
                302,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "ON <表名或视图名>"
                    }
                ]
            },
            "bbox": [
                147,
                334,
                302,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "FROM <用户列表>"
                    }
                ]
            },
            "bbox": [
                147,
                353,
                289,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "[CASCADE|RESTRICT]；"
                    }
                ]
            },
            "bbox": [
                147,
                372,
                314,
                387
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "函数依赖"
                    }
                ]
            },
            "bbox": [
                147,
                390,
                221,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "定义 1"
                    }
                ]
            },
            "bbox": [
                147,
                409,
                200,
                423
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设 R(U)是属性集 U 上的关系模式，X，"
                    }
                ]
            },
            "bbox": [
                147,
                426,
                431,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Y是U的子集。若对于R(U)任意一个可能"
                    }
                ]
            },
            "bbox": [
                147,
                445,
                465,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "的关系 r，r 中不可能存在两个元组在 X 上"
                    }
                ]
            },
            "bbox": [
                147,
                464,
                468,
                479
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "的属性值相等，而在Y上的属性值不等，"
                    }
                ]
            },
            "bbox": [
                147,
                483,
                455,
                498
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "则称 X 函数确定 Y 或 Y 函数依赖于 X，记作"
                    }
                ]
            },
            "bbox": [
                147,
                501,
                475,
                516
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "X->Y "
                    }
                ]
            },
            "bbox": [
                147,
                520,
                183,
                532
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "：定义2"
                    }
                ],
                "level": 1
            },
            "bbox": [
                186,
                535,
                322,
                563
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设X->Y是一个函数依赖，若 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "Y \\subseteq X"
                    },
                    {
                        "type": "text",
                        "content": "则称X->Y是一个平凡函数依赖。"
                    }
                ]
            },
            "bbox": [
                206,
                573,
                833,
                640
            ]
        },
        {
            "type": "image",
            "content": {
                "image_source": {
                    "path": "images/3c679915dd35c3f814501d3d5761f6ddfddc9c5b119cf3632e7d9b2e60c6b666.jpg"
                },
                "image_caption": [],
                "image_footnote": []
            },
            "bbox": [
                221,
                659,
                445,
                769
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设X->Y是一个函数依赖，若 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "Y \\not \\subseteq X"
                    },
                    {
                        "type": "text",
                        "content": "则称X->Y是一个非平凡函数依赖。"
                    }
                ]
            },
            "bbox": [
                208,
                795,
                845,
                866
            ]
        }
    ],
    [
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "定义3"
                    }
                ]
            },
            "bbox": [
                186,
                89,
                272,
                104
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设X->Y是一个函数依赖，并且对于任何"
                    }
                ]
            },
            "bbox": [
                184,
                109,
                596,
                129
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "X ^ { ^ { \\prime } } \\subset X , X ^ { ^ { \\prime } }  Y"
                    },
                    {
                        "type": "text",
                        "content": "都不成立（记为 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathrm { X } { \\to } \\mathrm { Y }"
                    }
                ]
            },
            "bbox": [
                196,
                135,
                665,
                156
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "则称×→Y是一个完全函数依赖。即Y函数依赖"
                    }
                ]
            },
            "bbox": [
                184,
                164,
                662,
                184
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "equation_inline",
                        "content": "X { \\overset { f } { \\to } } Y"
                    }
                ]
            },
            "bbox": [
                186,
                197,
                421,
                219
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\mathsf { X } { \\mathsf { - } } { \\mathsf { > Y } }"
                    },
                    {
                        "type": "text",
                        "content": "是一个函数依赖,但不是完全函"
                    }
                ]
            },
            "bbox": [
                144,
                241,
                440,
                256
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "数依赖,则称 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\tt X - > \\tt Y"
                    },
                    {
                        "type": "text",
                        "content": "是一个部分函数依赖,或称"
                    }
                ]
            },
            "bbox": [
                144,
                260,
                480,
                275
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Y 函数依赖于 X 的某个真子集,记 X Y 闭包求解与码"
                    }
                ]
            },
            "bbox": [
                144,
                279,
                532,
                293
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关系R(U,F)中，其中某个给定属性集KiU，当且仅当K"
                    }
                ]
            },
            "bbox": [
                146,
                297,
                569,
                312
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "关于给定函数依赖集F的闭包 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\kappa +"
                    },
                    {
                        "type": "text",
                        "content": "是R的所有属性集合U时，"
                    }
                ]
            },
            "bbox": [
                144,
                316,
                606,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "K 即为关系 R 的超码。"
                    }
                ]
            },
            "bbox": [
                144,
                334,
                312,
                349
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "当且仅当属性集K中不存在任一真子集K'的闭包(K)+也"
                    }
                ]
            },
            "bbox": [
                146,
                353,
                579,
                368
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "是R的所有属性集合U时，即属性集K是最小属性集合构"
                    }
                ]
            },
            "bbox": [
                146,
                370,
                594,
                387
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "成的超码时，K就是该关系R(U,F)的候选码。候选码的求解理论和算法"
                    }
                ]
            },
            "bbox": [
                144,
                390,
                695,
                405
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                411,
                159,
                420
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "对于给定的关系R（A1A2...An）和函数依赖集F，可"
                    }
                ]
            },
            "bbox": [
                146,
                426,
                549,
                442
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "将其属性分为4类："
                    }
                ]
            },
            "bbox": [
                147,
                445,
                300,
                460
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "L 类： 仅出现在 F 函数依赖左部的属性"
                    }
                ]
            },
            "bbox": [
                146,
                464,
                443,
                478
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "R 类： 仅出现在 F 函数依赖右部的属性"
                    }
                ]
            },
            "bbox": [
                146,
                483,
                445,
                497
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "N类： 在F函数依赖的左右两部均未出现的属性"
                    }
                ]
            },
            "bbox": [
                146,
                501,
                519,
                514
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "LR类： 在F函数依赖的左右两部均出现的属性"
                    }
                ]
            },
            "bbox": [
                146,
                520,
                505,
                533
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                541,
                159,
                550
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "定理：对于给定的关系模式R及其函数依赖集F，若×"
                    }
                ]
            },
            "bbox": [
                146,
                556,
                564,
                571
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "是R的L类属性，则X必为R的任一侯选码的成员。"
                    }
                ]
            },
            "bbox": [
                147,
                575,
                541,
                590
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "v "
                    }
                ]
            },
            "bbox": [
                147,
                596,
                159,
                605
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "推论：对于给定的关系模式R及其函数依赖集F，若x"
                    }
                ]
            },
            "bbox": [
                146,
                612,
                564,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "是R的L类属性， "
                    },
                    {
                        "type": "equation_inline",
                        "content": "^ { \\mathbf { \\nabla } _ { E } \\times + }"
                    },
                    {
                        "type": "text",
                        "content": "包含了R的全部属性，则×必为R "
                    }
                ]
            },
            "bbox": [
                146,
                631,
                586,
                645
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "的唯一侯选码"
                    }
                ]
            },
            "bbox": [
                147,
                650,
                258,
                664
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Armstrong公理系统"
                    }
                ],
                "level": 1
            },
            "bbox": [
                327,
                111,
                754,
                149
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "Armstrong公理系统"
                    }
                ],
                "level": 1
            },
            "bbox": [
                194,
                162,
                458,
                184
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设有关系模式 R(U,F)，X、Y、Z、 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "{ \\boldsymbol { \\mathsf { W } } } \\subseteq { \\boldsymbol { \\mathsf { U } } }"
                    },
                    {
                        "type": "text",
                        "content": "，则对 R(U,F)有:"
                    }
                ]
            },
            "bbox": [
                220,
                185,
                890,
                206
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\hat { \\Pi } } ^ { \\mathbf { \\Pi } }"
                            },
                            {
                                "type": "text",
                                "content": "A1（自反律）：若YcX，则X "
                            },
                            {
                                "type": "equation_inline",
                                "content": " \\mathsf { Y }"
                            },
                            {
                                "type": "text",
                                "content": "；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\hat { \\Pi } } _ { \\infty }"
                            },
                            {
                                "type": "text",
                                "content": "A2（增广律）：若X "
                            },
                            {
                                "type": "equation_inline",
                                "content": " \\mathsf { Y }"
                            },
                            {
                                "type": "text",
                                "content": "，则XZ→YZ;"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\hat { \\Pi } } ^ { \\mathbf { \\Pi } } \\mathbf { \\hat { \\Pi } } ^ { \\mathbf { \\hat { \\Pi } } }"
                            },
                            {
                                "type": "text",
                                "content": "A3（传递律）：若X "
                            },
                            {
                                "type": "equation_inline",
                                "content": " \\mathsf { Y }"
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\Upsilon {  } Z"
                            },
                            {
                                "type": "text",
                                "content": "，则 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\pmb { \\mathrm { x } } {  } \\pmb { \\mathrm { z } }"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                228,
                209,
                650,
                263
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "定理Armstrong公理是正确的。即如果函数依赖F成立，则由F根据Armstrong公理所推导的函数依赖总是成立的。"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "由Armstrong公理系统，可以得到以下三个推论："
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                194,
                268,
                887,
                332
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\hat { \\Pi } } _ { \\infty }"
                            },
                            {
                                "type": "text",
                                "content": "合成规则：若X "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\displaystyle \\to \\mathsf { Y }"
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\tt X \\to \\tt Z"
                            },
                            {
                                "type": "text",
                                "content": "，则 "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\tt X \\to \\tt Y Z"
                            },
                            {
                                "type": "text",
                                "content": "；"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\sigma } \\infty"
                            },
                            {
                                "type": "text",
                                "content": "86 分解规则：若X "
                            },
                            {
                                "type": "equation_inline",
                                "content": " \\mathsf { Y }"
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\mathsf { Z } \\subseteq \\mathsf { Y }"
                            },
                            {
                                "type": "text",
                                "content": "，则X→Z; "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "equation_inline",
                                "content": "\\mathbf { \\Pi } _ { \\infty } ^ { \\infty }"
                            },
                            {
                                "type": "text",
                                "content": "伪传递规则：若X "
                            },
                            {
                                "type": "equation_inline",
                                "content": "\\to \\mathsf { Y }"
                            },
                            {
                                "type": "equation_inline",
                                "content": "{ \\pmb { \\mathsf { W } } } {  } { \\pmb { \\mathsf { Z } } }"
                            },
                            {
                                "type": "text",
                                "content": "，则XW "
                            },
                            {
                                "type": "equation_inline",
                                "content": " z"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                228,
                332,
                662,
                388
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "引理 "
                    },
                    {
                        "type": "equation_inline",
                        "content": "\\pmb { \\mathrm { x } } "
                    },
                    {
                        "type": "text",
                        "content": "A1A2...Ak成立的充分必要条件是X Ai成立2024/6=1,2,..,.k）"
                    }
                ]
            },
            "bbox": [
                194,
                392,
                811,
                436
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "59 "
                    }
                ]
            },
            "bbox": [
                867,
                425,
                885,
                435
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "最小依赖集"
                    }
                ],
                "level": 1
            },
            "bbox": [
                144,
                463,
                240,
                479
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "1、 右部最小化"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "2、 除本闭包（如果推出了本身，就不需要这个以来条件）"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "3、左部最小化"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                144,
                482,
                594,
                535
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "关系代数与SQL的转化"
                    }
                ],
                "level": 1
            },
            "bbox": [
                216,
                577,
                431,
                595
            ]
        },
        {
            "type": "table",
            "content": {
                "image_source": {
                    "path": "images/711fd6f4f42d83f8d410066e049c659b9bb33c6c25a762d3aaabc88a7a554ceb.jpg"
                },
                "table_caption": [],
                "table_footnote": [],
                "html": "<table><tr><td>名称</td><td>英文</td><td>符号</td><td>说明</td></tr><tr><td>选择</td><td>select</td><td>σ</td><td>类似于 SQL 中的 where</td></tr><tr><td>投影</td><td>project</td><td>Π</td><td>类似于 SQL 中的 select</td></tr><tr><td>并</td><td>union</td><td>U</td><td>类似于 SQL 中的 union</td></tr><tr><td>集合差</td><td>set-difference</td><td>-</td><td>类似于 SQL 中的 Except/Minus</td></tr><tr><td>笛卡儿积</td><td>Cartesian-product</td><td>×</td><td>类似于 SQL 中不带 on 条件的 inner join</td></tr><tr><td>重命名</td><td>rewrite</td><td>ρ</td><td>类似于 SQL 中的 as</td></tr><tr><td>集合交</td><td>intersection</td><td>∩</td><td>类似于 SQL 中的 intersect</td></tr><tr><td>自然连接</td><td>natural join</td><td>⊗</td><td>类似于 SQL 中的 inner join</td></tr></table>",
                "table_type": "simple_table",
                "table_nest_level": 1
            },
            "bbox": [
                178,
                599,
                475,
                732
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "语法分析"
                    }
                ],
                "level": 1
            },
            "bbox": [
                400,
                101,
                554,
                131
            ]
        },
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "“多种等价的关系代数表达式："
                    }
                ],
                "level": 1
            },
            "bbox": [
                186,
                140,
                563,
                165
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "Q1:((te)) "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "Q2: 7 nde=?( student grade)) "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "Q3: Tsname (StudentOgrac-(grade)) "
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                188,
                170,
                781,
                254
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "假设有 1000 块 grade 元组，1000 块 student 元组"
                    }
                ]
            },
            "bbox": [
                146,
                315,
                519,
                331
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "设内存有6块，每个块可装10个Student元组或100个Grade元组。每秒读写20块。假设5块装Student元组，1块装Grade元组。"
                    }
                ]
            },
            "bbox": [
                149,
                332,
                715,
                400
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "Q1: "
                    }
                ]
            },
            "bbox": [
                156,
                406,
                206,
                426
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "2 ( student X grade) sname "
                    }
                ]
            },
            "bbox": [
                210,
                432,
                712,
                461
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1.×: "
                    }
                ]
            },
            "bbox": [
                157,
                462,
                235,
                481
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "读 1000/10+ (1000/50)*(10000/100)=2100块 [105秒] "
                    }
                ]
            },
            "bbox": [
                179,
                488,
                675,
                532
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "写 1000*10000/10 =100000块[50000秒] "
                    }
                ]
            },
            "bbox": [
                176,
                533,
                620,
                555
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "2．选择：读50000秒"
                    }
                ]
            },
            "bbox": [
                154,
                558,
                376,
                577
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "73．投影：忽略"
                    }
                ]
            },
            "bbox": [
                149,
                583,
                310,
                602
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "1、一共装了 50 个 student 元组、100 个 grade 元组"
                    }
                ]
            },
            "bbox": [
                146,
                612,
                537,
                627
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "首先从内存中读取数据。"
                    }
                ]
            },
            "bbox": [
                147,
                630,
                334,
                646
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "读取 student 表的所有块"
                    }
                ]
            },
            "bbox": [
                147,
                649,
                336,
                664
            ]
        }
    ],
    [
        {
            "type": "title",
            "content": {
                "title_content": [
                    {
                        "type": "text",
                        "content": "查询优化的一般策略"
                    }
                ],
                "level": 1
            },
            "bbox": [
                300,
                143,
                707,
                177
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "选择尽可能先做"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "连接前预处理"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                166,
                205,
                428,
                265
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "6建索引 "
                    }
                ]
            },
            "bbox": [
                201,
                272,
                312,
                294
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "排序 "
                    }
                ]
            },
            "bbox": [
                201,
                300,
                287,
                323
            ]
        },
        {
            "type": "list",
            "content": {
                "list_type": "text_list",
                "list_items": [
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "选择与投影合并 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "投影与其他双目运算合并"
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "选择与笛卡儿积合并成连接 "
                            }
                        ]
                    },
                    {
                        "item_type": "text",
                        "item_content": [
                            {
                                "type": "text",
                                "content": "公共子表达式只计算一次"
                            }
                        ]
                    }
                ]
            },
            "bbox": [
                166,
                331,
                591,
                456
            ]
        },
        {
            "type": "paragraph",
            "content": {
                "paragraph_content": [
                    {
                        "type": "text",
                        "content": "从下往上写"
                    }
                ]
            },
            "bbox": [
                147,
                482,
                238,
                498
            ]
        }
    ]
]