A concise tutorial of SQL statements for Linux---SELECT

Source: Internet
Author: User
Tags how to use sql

What does SQL do for you? One of the most frequently used methods is to select data from tables in the database.

From this answer, we can immediately see two keyword: Select from a table in the (from) database. (a table is a structure within a database that is designed to store data.)

In this section of table handling , we'll mention how to use SQL to set tables. We can see the most important SQL architecture here:

Select "Field name" from "Table name";

Let's use the following example to see how it's actually used.

If we have the following form:

store_information Form

Store_name Sales Txn_date
Los Angeles 1500 05-jan-1999
San Diego 250 07-jan-1999
Los Angeles 300 08-jan-1999
Boston 700 08-jan-1999

To select all the store names (Store_name). We will enter:

SELECT store_name from Store_information;

Results:

Store_name
Los Angeles
San Diego
Los Angeles
Boston

We can read several fields at a time, and we can select the data from several tables at the same time.



Now let's look at the results of the tests under Linux:

Create a VPOETDB Database first:




Create a store_information table in the VPOETDB library:



Insert a record of the response in the table:



SELECT statement:




Reprint please specify: Xiao Liu

A concise tutorial of SQL statements for Linux---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.