【文件属性】:
文件名称:基本SELECT语句-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2021-04-25 19:38:05
SQL 基础
基本SELECT语句
*
SELECT {*, column [alias],...}
FROM table;
SELECT 关键字标明取哪些列的数据.
FROM 关键字标明从哪些表中取数据.
重要特征:表达式以分号结尾.
*
Select与from出现的最多,是计算机进行数据检索操作的比不和少的成分。必须同时在一起才能访问数据库。
表明命令行SQL查询程序已经完成。
DISTINCT剔除重复数据。ALL
Basic SELECT Statement
In its simplest form, a SELECT statement must include the following:
A SELECT clause, which specifies the columns to be displayed
A FROM clause, which specifies the table containing the columns listed in the SELECT clause
In the syntax:
SELECT is a list of one or more columns.
DISTINCT suppresses duplicates.
* selects all columns.
column selects the named column.
alias gives selected columns different headings.
FROM table specifies the table containing the columns.
Note: Throughout this course, the words keyword, clause, and statement are used.
A keyword refers to an individual SQL element.
For example, SELECT and FROM are keywords.
A clause is a part of a SQL statement.
For example, SELECT empno, ename, ... is a clause.
A statement is a combination of two or more clauses.
For example, SELECT * FROM emp is a SQL statement.