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