Group Function in MySql
//////////////FUNCTIONS///////////////
Group Function(Aggregate Function)
Group Function(Aggregate Function)
->select MIN(marks) 'MINIMUM MARKS' from student_05;
->select AVG(marks) 'AVERAGE MARKS' from student_05;
->select COUNT(roll_no) "NUMBER OF STUDENT" from student_05;
->select COUNT(roll_no) "NUMBER OF ROWS" from student_05;
->select SUM(marks) 'SUM OF MARKS' from student_05;
->select ABS(-15) 'ABSOLUTE VALUE OF -15' from DUAL;
->select POWER(2,3) 'RAISED' from DUAL;
->select ROUND(15.24532343,3) 'ROUND VALUE' from DUAL;
->select SQRT(36) 'SQUARE ROOT' from DUAL;
->select LOWER('SHARJEEL BILALI') 'LOWER CASE' from DUAL;
->select INITCAP('SHARJEEL BILALI') 'TITLE CASE' from DUAL;
->select UPPER('shaghil bilali') 'UPPER CASE' from DUAL;
->select SUBSTR('SHARJEEL',2,3) 'SUBSTRING' from DUAL;
->select LENGTH('SHARJEEL BILALI') 'LENGTH IS' from DUAL;
->select LTRIM('SHARJEEL','A') 'LEFT TRIM' from DUAL;
->select RTRIM('SHARJEEL','A') 'RIGHT TRIM' from DUAL;
->select LPAD('SHARJEEL',5,'x') 'LEFT PADDING' from DUAL;
->select RPAD('SHARJEEL',5,'x') 'RIGHT PADDING' from DUAL;
->select RPAD(student_name,5,'x') 'RIGHT PADDING' from student_05 where roll_no='0123';
->select AVG(marks) 'AVERAGE MARKS' from student_05;
->select COUNT(roll_no) "NUMBER OF STUDENT" from student_05;
->select COUNT(roll_no) "NUMBER OF ROWS" from student_05;
->select SUM(marks) 'SUM OF MARKS' from student_05;
->select ABS(-15) 'ABSOLUTE VALUE OF -15' from DUAL;
->select POWER(2,3) 'RAISED' from DUAL;
->select ROUND(15.24532343,3) 'ROUND VALUE' from DUAL;
->select SQRT(36) 'SQUARE ROOT' from DUAL;
->select LOWER('SHARJEEL BILALI') 'LOWER CASE' from DUAL;
->select INITCAP('SHARJEEL BILALI') 'TITLE CASE' from DUAL;
->select UPPER('shaghil bilali') 'UPPER CASE' from DUAL;
->select SUBSTR('SHARJEEL',2,3) 'SUBSTRING' from DUAL;
->select LENGTH('SHARJEEL BILALI') 'LENGTH IS' from DUAL;
->select LTRIM('SHARJEEL','A') 'LEFT TRIM' from DUAL;
->select RTRIM('SHARJEEL','A') 'RIGHT TRIM' from DUAL;
->select LPAD('SHARJEEL',5,'x') 'LEFT PADDING' from DUAL;
->select RPAD('SHARJEEL',5,'x') 'RIGHT PADDING' from DUAL;
->select RPAD(student_name,5,'x') 'RIGHT PADDING' from student_05 where roll_no='0123';
Comments
Post a Comment