Click here to Skip to main content
16,014,591 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i have this database in oracle:

ELEVES(NUM_ELEVE, NOM, PRENOM, DATE_NAISSANCE, POIDS, ANNEE)
COURS(NUM_COURS, NOM, NBHEURES, ANNEE)
PROFESSEURS(NUM_PROF, NOM, SPECIALITE, DATE_ENTREE, DER_PROM, SALAIRE_BASE, SALAIRE_ACTUEL)
ACTIVITES (NIVEAU,NOM , EQUIPE)

RESULTATS(NUM_ELEVE, NUM_COURS, NOTE )
CHARGE(NUM_PROF, NUM_COURS)
ACTIVITES_PRATIQUEES(NUM_ELEVE, NIVEAU, NOM)

I need to select name of 'professeurs' who 'charge' all 'cours' of 'annee' 2

What I have tried:

i don't have a solution.
Posted
Updated 5-Dec-16 15:53pm
v2
Comments
CHill60 5-Dec-16 19:49pm    
And what have you tried so far?
Mohammed-cd7 5-Dec-16 20:25pm    
i select name of 'professeurs' who 'charge' 'cours' of annee 2, but i need only name of professeurs who 'charge' all 'cours' of annee 2

1 solution

Since you can select names of professors who teach course of year 2, I assume you already know how to SQL JOIN.
If I understand you correctly, you want names of those professors who ONLY teach year 2, that is to exclude any one who teaches other years even if he also teaches year 2. The pseudo sql code is like this:
SELECT professor_name
FROM multiple table join
WHERE NOT EXISTS(
  SELECT professor_name FROM multiple table join
  WHERE year = 1 and year = 3...
) AND year = 2

You may use NOT IN. Google for some reference online.
 
Share this answer
 
v3
Comments
Mohammed-cd7 9-Dec-16 16:06pm    
I need name of 'professeurs' who 'charge' all the 'cours' of annee 2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900