Hello,
Je suis nouveau sur le forum.
Je fais un exo d'sql et j'aimerais savoir si je vais dans le droit chemin.
Voici la BDD (désolé c'est flou)
Question 1 : Write SQL to show details of manager who manages more than 3 employees
ma réponse :
Question 2 : Write SQL to show country name, city and number of departments where department has more than 5 employees
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 select * from employees em, job_history jh, departments dep where jh.employees_ID=em.employees_ID and jh.end_data is null and dep.manager_ID=em.manager_ID having (em.employees_ID)>3;
ma réponse :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 select co.country_name, lo.city, lo.postal_code from countries co, locations lo, employees em, departments dep where co.countries_ID=lo.countries_ID and lo.location_ID=dep.location_ID and dep.manager_ID=em.manager_ID having (em.employees_ID)>5;
Question 3 : Write SQL to show the details of employees drawing the highest salary in the department
ma réponse :
Question 4 : Write SQL to show employee name, job title, start date and end date of past jobs of all employees with commission percentage null
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 select em.*, jo.jobs_titles from employees em, jobs jo where em.job_ID=k=jo.em.job_ID and max(max_salary);
ma réponse :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 select em.first_name,em.last_name, jo.jobs_titles, jh.start_date, jh.end_date from employees em, jobs jo, job_history jh where em.commission_pct is null;
Merci pour votre aide
Partager