FOOTBALL-PLAYER(CodFP, Name,Surname, Address, CityOfBirth) TEAM(CodT, Name, Category,ConstitutionDate) AWARD(CodA, CodFP, DeliveryDate, DeliveryPlace, Type) PLAYER-TEAM(CodFP, CodT, StartingDate,EndingDate, NumPlayedMatches, NumGoals) Find name, category and constitution date of the teams in which have played (in any time) the players who received, in their career as a whole, the highest number of awards of type “Best goalkeeper”. SELECT distinct T.Name, T.Category, T.CostituitionDate FROM TEAM T, PLAYER-TEAM PT WHERE T.CodFP= PT.CodFP and PT.CodFP IN (SELECT CodFP FROM AWARD D WHERE A.Type = ‘Best goalkeeper’ GROUP BY CodFP HAVING COUNT(*) = SELECT MAX(AwardTot) FROM (SELECT count(*)as AwardTot AWARD A WHERE A.Type = ‘Best goalkeeper’ GROUP BY CodFP) AS TOTAWARDFP i have this solution but im struggling a lot to be able to solve these type of questions im not understanding how to think about it and if i can somehow do something on a paper before starting to write the code or anything please if there are any resources for this type of questions online or book or anything or if you have any tips or tricks to be able to solve similar stuff like this please tell me as i have an exam soon and i have to be good at them asap. please solve this question using the tips and tricks when u state them AND if there are online resources just for relational tables such as this one i mean. thank you
FOOTBALL-PLAYER(CodFP, Name,Surname, Address, CityOfBirth)
TEAM(CodT, Name, Category,ConstitutionDate)
AWARD(CodA, CodFP, DeliveryDate, DeliveryPlace, Type)
PLAYER-TEAM(CodFP, CodT, StartingDate,EndingDate, NumPlayedMatches, NumGoals)
Find name, category and constitution date of the teams in which have played (in any time) the players who received, in their career as a whole, the highest number of awards of type “Best goalkeeper”.
SELECT distinct T.Name, T.Category, T.CostituitionDate
FROM TEAM T, PLAYER-TEAM PT
WHERE T.CodFP= PT.CodFP and PT.CodFP IN
(SELECT CodFP
FROM AWARD D
WHERE A.Type = ‘Best goalkeeper’
GROUP BY CodFP
HAVING COUNT(*) =
SELECT MAX(AwardTot)
FROM (SELECT count(*)as AwardTot
AWARD A
WHERE A.Type = ‘Best goalkeeper’
GROUP BY CodFP) AS TOTAWARDFP
i have this solution but im struggling a lot to be able to solve these type of questions im not understanding how to think about it and if i can somehow do something on a paper before starting to write the code or anything please if there are any resources for this type of questions online or book or anything or if you have any tips or tricks to be able to solve similar stuff like this please tell me as i have an exam soon and i have to be good at them asap. please solve this question using the tips and tricks when u state them AND if there are online resources just for relational tables such as this one i mean. thank you
Step by step
Solved in 5 steps with 1 images