Vous êtes sur la page 1sur 3

(http://www.studytonight.

com/)
WRITE
FORUS&
GETPAID!
(/collaborate)

ONLINECOURSES(http://studytonight.com/onlinecourses/)

DATABASEMANAGEMENTSYSTEM
LIBRARY(http://studytonight.com/library/)

STUDYROOM(http://studytonight.com/studyroom/)

"WithoutSQL,websiteswillneverhaveanywaytohandleDatabasesfordata."
FLASHCARDS(http://studytonight.com/flashcards/)

PLSQL

OracleSQLTool

SQLDatabase

ManageSQLServer

TESTS NEW(http://studytonight.com/tests/)
Like

Like

9.9k

24

GroupByClause
GroupbyclauseisusedtogrouptheresultsofaSELECTquerybasedononeormorecolumns.Itisalso

Search

DatabaseConcept

LogIn(http://www.studytonight.com/login)
usedwithSQLfunctionstogrouptheresultfromoneormoretables.

OverviewofDBMS

SyntaxforusingGroupbyinastatement.
SignUp(http://www.studytonight.com/register)
(overviewofdbms)
Suggest(http://www.studytonight.com/suggest)
SELECTcolumn_name,function(column_name)
DatabaseArchitecture

(architectureofdatabase)
DatabaseModel(database
model)

FROMtable_name
WHEREcondition
GROUPBYcolumn_name

Codd'srule(coddrule)
RDBMSConcept(rdbms
concept)
Databasekey(database

ExampleofGroupbyinaStatement
ConsiderthefollowingEmptable.

key)
Normalization(database
normalization)
ERDiagrams(erdiagram)
Generalizationand
Specialization
(generalizationand
specialization)
SQLConcept
SQLIntroduction
(introductiontosql)

eid

name

age

salary

401

Anu

22

9000

402

Shane

29

8000

403

Rohan

34

6000

404

Scott

44

9000

405

Tiger

35

8000

Herewewanttofindnameandageofemployeesgroupedbytheirsalaries

DDLCommand
Createquery(createquery)
Alterquery(alterquery)
Truncate,Dropand
Renamequery(truncate
droprenamequery)
DMLCommand
AllDMLcommand(dml
command)
TCLCommand
AllTCLCommand(tcl
command)

SQLqueryfortheaboverequirementwillbe,
SELECTname,age
fromEmpgroupbysalary
Resultwillbe,
name

age

Rohan

34

shane

29

anu

22

DCLCommand
AllDCLCommand(dcl
command)
WHEREclause(where

ExampleofGroupbyinaStatementwithWHEREclause

clause)

ConsiderthefollowingEmptable

SELECTquery(select
query)
LIKEclause(likeclause)

eid

name

age

salary

401

Anu

22

9000

402

Shane

29

8000

403

Rohan

34

6000

404

Scott

44

9000

405

Tiger

35

8000

ORDERBYclause(orderby
clause)
GroupBYclause(groupby
clause)
Havingclause(having
clause)
DISTINCTkeyword(distinct
keyword)
AND&ORoperator(sql
andoroperator)
AdvanceSQL
SQLConstraints(sql
constraints)
SQLfunction(sqlfunction)
SQLJoin(joininginsql)
SQLAlias(sqlalias)
SQLSEToperation(set
operationinsql)
SQLSequences(sql

SQLquerywillbe,
selectname,salary
fromEmp
whereage>25
groupbysalary
Resultwillbe.
name

salary

Rohan

6000

Shane

8000

Scott

9000

sequences)
SQLViews(sqlviews)

YoumustrememberthatGroupByclausewillalwayscomeattheend,justliketheOrderbyclause.

TestYourself!
Ifyouhavestudiedallthelessons

Prev(orderbyclause.php)

Next(havingclause.php)

ofDBMS,thenevaluateyourselfby
takingthesetests.

DBMSTopicalTest(http://www.studytonight.com/dbms/tests/)

CheckOut: Library (http://www.studytonight.com/library) VideoCourses (http://www.studytonight.com/onlinecourses) Studyroom


(http://www.studytonight.com/studyroom) Flashcards (http://www.studytonight.com/flashcards)
Studytonight2014

HandcraftedwithLove

AboutUs(http://www.studytonight.com/about)Suggest(http://www.studytonight.com/suggest)Terms(http://www.studytonight.com/terms)ContactUs
(http://www.studytonight.com/contact)Collaborate(http://www.studytonight.com/collaborate/)Authors(http://www.studytonight.com/authors/)Blog
(http://studytonight.tumblr.com/)

Vous aimerez peut-être aussi