Overview
This section provides a brief introduction to T-SQL basic Data Manipulation Language (DML), which mainly includes
SELECT
INSERT
UPDATE
DELETE
SELECT statement
The subject is MS SQL Server, and the verb select is the predicate part of the entire statement, used to tell SQL Server what to do, select to read the data from the database, remember to read only, and the selected content is determined by the expression/list following the Select
The FROM child statement is used to specify the source of the data to be read, usually the name of a table or several tables. Take a look at the following example:
SELECT Name from Production.Product;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/57/99/wKioL1SgEtKzrZdsAAHY32KtpWY217.jpg "title=" 1.PNG " alt= "Wkiol1sgetkzrzdsaahy32ktpwy217.jpg"/>
This statement reads the Name column data from the Production.Product table of the AdventureWorks2012 database, the Name column represents the column for the select request output, and we can also request additional columns, even with "*" for all columns, for example:
SELECT * from Production.Product;
About case of statement
Why are SQL statements all capitalized? Is that a mandatory rule? The answer is that SQL is not mandatory in uppercase, you can write select as a SELECT, the reason is used to all uppercase is to ensure the readability of the program
, many SQL Encoders use a contract capitalization for all commands and keywords, while table names, column names, and very large amounts are typically mixed in case.
WHERE clause
The WHERE clause is used to restrict the condition of the output data
Use such as
SELECT * from Production.Product;
This article is from the "RIP the railing" blog, please be sure to keep this source http://blgpl.blog.51cto.com/1815557/1597027
Sql_ Data Manipulation Language Select