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