SQL statements for beginners

Source: Internet
Author: User

Recall the SQL statements that I encountered yesterday, and briefly talk about common SQL statements ~

</PRE> <p> insert </P> <p> </P> <PRE name = "code" class = "SQL"> insert into table name [(field name 1, field name 2 ,... Field name n)] values ('value 1', 'value 2 ',..., 'Value n ');

Delete

Delete from table name [Where condition] [order by field] [limit row number}
 

Select

Select [All | distinct] {* | table. * | [Table.] field1 [as alias1] [, [Table.] field2 [as alias2] [,…]} From table name [where clause] [group by...] [having...] [order by...] [limit count];

Select a specific field:
Retrieve all table data
<pre name="code" class="sql">SELECT username,password FROM user;
 
SELECT * FROM table; 
Use where for conditional search: Between and perform range comparison query in for range comparison query // In () like fuzzy query order by sort query results limit number of results rows use statistical function 
Select function name (column name 1 or *),... function name (column name N) from table name; # Use The statistical function count () to record the total number of rows




SQL statements for beginners

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.