Answers






Answers

11.1

SELECT   TOWN
FROM     PLAYERS
GROUP BY TOWN
HAVING   COUNT(*) > 4

11.2

SELECT   PLAYERNO
FROM     PENALTIES
GROUP BY PLAYERNO
HAVING   SUM(AMOUNT) > 150

11.3

SELECT   NAME, INITIALS, COUNT(*)
FROM     PLAYERS INNER JOIN PENALTIES
         ON PLAYERS.PLAYERNO = PENALTIES.PLAYERNO
GROUP BY PLAYERS.PLAYERNO, NAME, INITIALS
HAVING   COUNT(*) > 1

11.4

SELECT   TEAMNO, COUNT(*)
FROM     MATCHES
GROUP BY TEAMNO
HAVING   COUNT(*) >= ALL
        (SELECT   COUNT(*)
         FROM     MATCHES
         GROUP BY TEAMNO)

11.5

SELECT TEAMNO, DIVISION
FROM   TEAMS
WHERE  TEAMNO IN
      (SELECT   TEAMNO
       FROM     MATCHES
       GROUP BY TEAMNO
       HAVING   COUNT(DISTINCT PLAYERNO) > 4)

11.6

SELECT  NAME, INITIALS
FROM    PLAYERS
WHERE   PLAYERNO IN
       (SELECT   PLAYERNO
        FROM     PENALTIES
        WHERE    AMOUNT > 40
        GROUP BY PLAYERNO
        HAVING   COUNT(*) >= 2)

11.7

SELECT  NAME, INITIALS
FROM    PLAYERS
WHERE   PLAYERNO IN
       (SELECT   PLAYERNO
        FROM     PENALTIES
        GROUP BY PLAYERNO
        HAVING   SUM(AMOUNT) >= ALL
                (SELECT   SUM(AMOUNT)
                 FROM     PENALTIES
                 GROUP BY PLAYERNO))

11.8

SELECT   PLAYERNO
FROM     PENALTIES
WHERE    PLAYERNO <> 104
GROUP BY PLAYERNO
HAVING   SUM(AMOUNT)  =
        (SELECT   SUM(AMOUNT) * 2
         FROM     PENALTIES
         WHERE    PLAYERNO = 104)

11.9

SELECT   PLAYERNO
FROM     PENALTIES
WHERE    PLAYERNO <> 6
GROUP BY PLAYERNO
HAVING   COUNT(*) =
        (SELECT   COUNT(*)
         FROM     PENALTIES
         WHERE    PLAYERNO = 6)



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows