Advertisements
Advertisements
प्रश्न
Excellent Consultancy Pvt.Ltd. maintains two tables for all its employees.
Table : Employee
| Employee_id | First_name | Last_name | Salary | Joining_date | Department |
| E101 | Monika | Das | 100000 | 2019-01-20 | Finance |
| E102 | Mehek | Verma | 600000 | 2019-01-15 | IT |
| E103 | Manan | Pant | 890000 | 2019-02-05 | Banking |
| E104 | Shivam | Agarwal | 200000 | 2019-02-25 | Insurance |
| E105 | Alisha | Singh | 220000 | 2019-02-28 | Finance |
| E106 | Poonam | Sharma | 400000 | 2019-05-10 | IT |
| E107 | Anshuman | Mishra | 123000 | 2019-06-20 | Banking |
Table: Reward
| Employee_id | Date_reward | Amount |
| E101 | 2019-05-11 | 1000 |
| E102 | 2019-02-15 | 5000 |
| E103 | 2019-04-22 | 2000 |
| E106 | 2019-06-20 | 8000 |
Write suitable SQL queries to perform the following task:
- Display the year of joining of all the employees from the table
Employee. - Display each department name and its corresponding average salary.
- Display the first name and date of reward of those employees who joined on Monday from the tables
EmployeeandReward. - Display sum of salary of those employees whose reward amount is greater than 3000 from the tables
EmployeeandReward. - Remove the table
Reward.
थोडक्यात उत्तर
Advertisements
उत्तर
- SELECT YEAR(Joining_date) FROM Employee;
- SELECT Department, AVG(Salary) FROM Employee GROUP BY Department;
- SELECT First name, Date_reward FROM Employee E, Reward R WHERE E.Employee_id=R. Employee_id AND DAYNAME(Joining_date) = 'MONDAY';
- SELECT SUM(Salary) FROM Employee E, Reward R WHERE E.Employee_id=R.Employee_id AND Amount>3000;
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
