SQL for Beginner

Source: Internet
Author: User
Tags scalar

Http://www.codeceo.com/article/15-basic-sql-for-beginner.html creating tables and inserting data into the Create Table,insert into ... values () Simple select queries Select totals with scalar count, AVG, Max, Min, sumucase, LCase, substring, Len, round
SELECT * from itemmasters--aggregate--COUNT ()-Returns the total no of records from table, AVG () ret Urns the Average value from Colum,max () Returns MAX value from Column--, MIN () Returns min Value from column,sum ()  s Um of total from Columnselect Count (*)  totalrows,avg (price) Avgprice,max (price) maxprice,min (price) minprice,sum ( Price) Pricetotal from itemmasters --scalar --UCASE (), Convert to  upper case  ,lcase ()- > Convert to Lower case,--SUBSTRING ()->display selected char from column->substring (Columnname,startindex,len Thofchartodisplay)--, LEN () lenth of column date,--ROUND ()  -> which would ROUND the Valueselect  upper ( Item_name) Uppers,lower (item_name) lowers,substring (item_name,2,3) Midvalue,len (item_name) Lenths  , SUBSTRING (Item_name,2,len (item_name)) midvaluewithlenfunction,    round (price,0) as RoundedFROM Itemmasters
Date function Other Select function top, order BY, DISTINCT, where clause where in, where between, Group by clause having subquery where connection query Joininner Join,left Outer join,right Outer Join and full Outer joinunion merge query Common table expressions (with) View pivot row-to-column stored procedure function functions

SQL for Beginner

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.