SQL statemetn for some query!!?

Broker
(agentID, agentName, photoNumber, faxNumber)
New member (username, brand, email, streetnumber, city, country, joiningDate, agentID)
Nonmember (participantId, brand, email, streetno, city, registrationDate)
Video (filmID, title, releaseDate, internet site, duration, synopsis, entryDate, award)
NominateFilm(username, filmId, datas)
MemberAward(username, filmID, function, award)
NominateMember(participantId, filmID, username, category, dates)
VoteMmeber(usernameVoter, usernameNomin, filmID, category, rank, dates)
VoteFilm(username, filmID, list, dates)

you’ll find the kitchen table about any film critics award….

many of the first attribute is FK.
how could i get these kinds of by sql questions:

display anybody, who has become nominated essentially the most in 2011
display that detail on the member who’s won essentially the most awards
display that detail on the agent whose member features never claimed any award

thx thx

Whenever a query is not immediately totally obvious, just bust it along.Won’t do all several, but I’ll step everyone thru how to build the final one to aid you to see doing this.

1) Who have won awards (eliminating duplicates)
PICK OUT DISTINCT username FROM MemberAward

2) Who have NOT gained awards
PICK OUT username COMING FROM Member WHEREVER username NOT IN
(SELECT DISTINCTIVE username COMING FROM MemberAward)

3) Indications of details belonging to the agents whose members have never won
PICK OUT FROM Agent a
JOIN Representative m On the.agentID = m.agentID
WHERE username NOT REALLY IN
(SELECT DISTINCTIVE username COMING FROM MemberAward).

Leave a Reply