[Introduction to It learning]sql and examples

Source: Internet
Author: User

SQL is a database query language that allows you to query data quickly. In fact, in general, you can also use Excel to query database data.

But people usually think that SQL is more flexible and convenient.

Getting Started with SQL Learning Web site:

Http://www.w3schools.com/SQl/sql_orderby.asp

Https://en.wikipedia.org/wiki/SQL

SQL Learning Notes:

1, if you have a concept of a structured database, then it is easy to understand. If you have no concept of structured database, please Baidu structured database, the database structure, tables, fields, queries (filtering), additions and deletions, sorting data table and other operations have a basic understanding.

2. From the Customers table, query the record of the country field that begins with U.

SELECT * from Customers
WHERE country like "u%";

3. Query the Country field from the Customers table for the USA, and the city fields are Seattle or records that begin with P.

SELECT * from Customers
Where country = "USA" and (city = "Seattle" or city like "p%");

4, from the Customers table to query the City field content of the record content is not repeated, just return to the City field. (Distinct command to return the unique distinct value of a field)

SELECT DISTINCT city from Customers;

5, like statements, s%,%s,%sand%, respectively, the beginning of S, S end, including Sand

SELECT * from Customers
WHERE country like '%land% ';

[Introduction to It learning]sql and examples

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.