---restore content starts---
The query has several different job names:
Select distinct name from A;
GROUP BY:
There are now two table product and sales, the fields are as follows:
Tables:product
Field: ID (Product ID), name (product name)
Tables:sales
Fields: ID (Sales ID), PRODUCT_ID (Product ID), date (date), amount (sales quantity)
1, modify product D's product name is E
Update product set name=e where Name=d;
2, insert product name "Product E" product data;
Insert into table (product) field (products e);
3, delete the product name is "Product e" data;
Delete from product where Name = Product E;
4, for the period from 2014-1-1 to 2014-1-3, the number of daily sales of more than 110 products;
Select name from Product A, sales B where a.date > 2014.1.1 and < 2014.1.3 B.amount >110;
5. Search for the product name with the most sales volume;
Select Name from product A,sales b where amount=max (amount);
6, query the sum of each classification: query the total sales of each product;
Select sum (amount) from Product A, Sales b group by b.proudct_id;
7, query the total sales of more than 300 of the products;
Select ID Name from product a right join sales B where have sum (amount) >300;
---------------------------------------------------------
1, inquire how many products;
Select distinct Name from product;
2, the number of statistical products;
Select COUNT (distinct name) from product;
Common OptionsPersonal Classification
| < Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_0 ">linux |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_1 ">LR |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" editor_edit_apoptions_advancedpanel1_cklcategories_2 ">sql |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_3 ">UFT/QTP |
Computer knowledge |
|
Publish Options
---restore content ends---
The query has several different job names:
Select distinct name from A;
GROUP BY:
There are now two table product and sales, the fields are as follows:
Tables:product
Field: ID (Product ID), name (product name)
Tables:sales
Fields: ID (Sales ID), PRODUCT_ID (Product ID), date (date), amount (sales quantity)
1, modify product D's product name is E
Update product set name=e where Name=d;
2, insert product name "Product E" product data;
Insert into table (product) field (products e);
3, delete the product name is "Product e" data;
Delete from product where Name = Product E;
4, for the period from 2014-1-1 to 2014-1-3, the number of daily sales of more than 110 products;
Select name from Product A, sales B where a.date > 2014.1.1 and < 2014.1.3 B.amount >110;
5. Search for the product name with the most sales volume;
Select Name from product A,sales b where amount=max (amount);
6, query the sum of each classification: query the total sales of each product;
Select sum (amount) from Product A, Sales b group by b.proudct_id;
7, query the total sales of more than 300 of the products;
Select ID Name from product a right join sales B where have sum (amount) >300;
---------------------------------------------------------
1, inquire how many products;
Select distinct Name from product;
2, the number of statistical products;
Select COUNT (distinct name) from product;
Common OptionsPersonal Classification
| < Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_0 ">linux |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_1 ">LR |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" editor_edit_apoptions_advancedpanel1_cklcategories_2 ">sql |
< Label style= "margin:0px 0px 2px 2px; Background:inherit; "for=" Editor_edit_apoptions_advancedpanel1_cklcategories_3 ">UFT/QTP |
Computer knowledge |
|
Publish Options
SQL Basic Statement