Sql_ Data Manipulation Language Select

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.