1 / 9

第 14 讲 使用 SQL 语句进行 数据定义及数据操纵

第 14 讲 使用 SQL 语句进行 数据定义及数据操纵. 第三节 数据定义. 11.3.1 表结构定义. 在 Visual FoxPro 系统中创建表的方式很多,可以使用菜单方式,也可以使用 Create 命令,而最简捷的方式当属 SQL 语句。 Create Table < 表名 > ( [ < 字段名 1> ] 类型 ( 长度 ) [ , [ < 字段名 2> ] 类型 ( 长度 )…… ] ) . 11.3.2 表结构修改.

barney
Download Presentation

第 14 讲 使用 SQL 语句进行 数据定义及数据操纵

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第14讲使用SQL语句进行 数据定义及数据操纵

  2. 第三节 数据定义

  3. 11.3.1 表结构定义 在Visual FoxPro 系统中创建表的方式很多,可以使用菜单方式,也可以使用Create命令,而最简捷的方式当属SQL语句。 Create Table <表名> ([<字段名1>] 类型(长度) [, [<字段名2>] 类型(长度)……]) 

  4. 11.3.2 表结构修改 在Visual FoxPro 系统中,创建完成的表一旦不能满足应用系统的需求,可以使用菜单方式、Modify Structure命令和SQL语句进行字段属性的修改。 Alter Table <表名> Alter <字段名1> 类型(长度) [Alter <字段名2> 类型(长度) ……]  Alter Table <表名> Drop <字段名1> [Drop <字段名2>……]  Alter Table <表名> Add <字段名1> 类型(长度) [Add <字段名2> 类型(长度) ……]

  5. 第四节 数据操纵

  6. 11.4.1 插入数据 给表添加记录是常用的表操作,SQL语句中的插入记录语句是在表的尾部添加一个新记录。 Insert Into <表名> (<字段名1> [, <字段名2>……]) Values (<表达式1> [, <表达式2>……])

  7. 11.4.2 更新数据 更新表中的数据同样是常用的表操作的一个经常性任务,SQL语句中的更新记录语句是对所有记录,或所有满足条件的记录进行更新操作的语句。 Update <表名> Set <字段名1> =<表达式1> [, <字段名2> =<表达式2>……] [Where <条件表达式>]

  8. 11.4.3 删除数据 SQL语句的删除记录语句是对表中所有记录,或满足条件的所有记录进行逻辑删除操作。  Delete From <表名> [Where <条件表达式>] 

  9. 作业:11.1,11.2

More Related