Posts
Showing posts from April, 2022
Aggregate Functions in MySQL
- Get link
- X
- Other Apps
SUM, COUNT, MIN, MAX, AVG AND STRING FUNCTIONS - UCASE, FORMAT CONCAT,CHAR_LENGTH and LEFT FUNCTIONS SELECT count(*) from employee; -- Here we use COUNT how many employee If we need count of Manager SELECT count(*) Manager FROM employee WHERE job_Desc ="Manager"; -- Average function SELECT avg (salary) FROM employee WHERE Job_Desc ="manager"; -- SUM function select sum(salary) from employee where Job_Desc="Analyst"; -- MAX and MIN function select MAX(SALARY) from employee; select MIN(SALARY) from employee; -- STRING -- UCASE function for UPPER CASE select ucase(ename) Name,salary --- Here we used Alias name from employee; -- We can count the character in Name column for that Char_Length function select ename,char_length(ename) No_Character from employee; -- Here we use CONCAT function ,CONCAT mean join /* Here before the salary i wan