Group by Flashcards
single row function
when we give 4 i/p we get 4 o/p (allow dupliactes)
Group BY
when we give 4 i/p we get 1 o/p ( don’t allow dupliactes). used to group the identical data together.
types of group by function
max , min , avg , count & sum
max in group by function
this will give 1 max value present in column
MAX example
select max (column) from table name
MIN in group by function
this will give 1 min value present in column
MIN example
select min (column) from table name
avg in group by function
this will give 1 average value present in column. We get decimal also.
How can we remove the decimal part from the average
round(avg(column))
avg eg
select round(avg(column)) from table_name
Count in group by function
count the number of records in the column. (Column (*))
will count group by function have null
yes
count (*)
where * return all column if no confition is specified over there.
sum in group by function
this will sum all the column values.
what us agregate column
if some action is performed on the column then we call it as agregated column