文档详情

轻轻松松学习SQL 常规数据查询(Easy to learn SQL routine data query).doc

发布:2017-07-21约字共16页下载文档
文本预览下载声明
轻轻松松学习SQL 常规数据查询(Easy to learn SQL routine data query) Easy to learn SQL routine data query [basic structure of query] In the database, data query is a Select statement to complete, can Select statement in the database according to the needs of users and provide qualification to retrieve data, and return the query results in the form of table. The syntax of the Select clause is as follows: Select [Distinct | Unique] (*, columnname [As alias],...) The From tablename [the Where condition] [Group by group_by_list] [Having search_conditions] [Order by columnname [Asc | Desc]] Parameter description: Distinct | Unique: can delete the duplicate list in the query structure. From tablename: this parameter is the name of the field to be queried, the [As alias] clause is the alias for the query field, and * represents the query for all fields. [Where condition] : this clause is a combination of one or more filter conditions that will allow the record to be retrieved only by the record of the condition. [Group by group_by_list] : the Group by clause will split the result set into groups based on the fields provided by the parameter group_by_list. [Having search_conditions] : the Having clause is an additional filter applied to the result set. [Order by columnname [Asc | Desc]] : Order by clause is used to define the sequence of records in the result set. Given the structure of the Select statement above, you know that the Select statement contains a number of clauses. When executing a Select statement, the DBMS (database management system) will perform the following steps: (1) execute the From clause and create a worksheet based on the table in the From clause. If the table in the From clause exceeds 2 tables, the DBMS will cross-connect the tables. (2) if there is a Where statement after the Select statement, the DBMS will apply the query conditions listed in the Where to the worksheet that is generated From the From clause. The DBMS holds the record that satisfies the conditi
显示全部
相似文档