consider the above database and execute the following queries
1. display the count of employees department wise.
2. display the name of the employee of who is 'manager' of "Account department".
3. display the name of department whose location is "pune" and "Mr. Advait" is working on it.
4. display the names of employees whose salary is greater than 50000 and department is "Quality".
5. Update date of joining of employee to '15/06/2019' whose department is 'computer science' and name is "Mr.roy' .
Answers
Explanation:
5. Update date of joining of employee to '15/06/2019' whose department is 'computer science' and name is "Mr.roy' .
The database schema is:
emp(eno ,ename ,designation ,salary, Date_Of_Joining)
dept(dno,dname ,loc)
The queries go as:
1. Displaying the count of employees department wise
SELECT COUNT(emp.eno), dname FROM emp,dept
WHERE emp.eno = dept.eno
GROUP BY dname;
2. Displaying the name of the employee who is ‘manager’ of “Account department”.
SELECT ename FROM emp, dept
WHERE emp.eno = dept.eno
AND designation='manager' AND dname='Account';
3. Displaying the name of the department whose location is “pune” and “Mr. Advait” is working in it.
SELECT dname FROM emp, dept
WHERE emp.eno = dept.eno
AND loc='pune' AND ename='Mr. Advait';
4. Displaying the names of employees whose salary is greater than 50000 and department is “Quality”.
SELECT ename FROM emp, dept
WHERE emp.eno = dept.eno
AND salary>50000 AND dname='Quality';
5. Updating date of joining of employee to ‘15/06/2019’ whose department is ‘computer science’ and name is “Mr. Roy’.
UPDATE emp SET date_of_joining = '15/06/2019'
WHERE ename = 'Mr.Roy'
AND dno IN (
SELECT dno FROM dept
WHERE dname = 'computer science'
);
Learn more:
1. What are the maximum and the minimum number of rows returned by the R1 right outer join R2?
brainly.in/question/21195376
2. Noisy values are the values that are valid for the dataset but are incorrectly recorded. Is it?
brainly.in/question/6658996