SQL Queries

Flamefever · June 11, 2021 · SQL
SELECT PA.PID, PA.pname, MAX(PL.score), AVG(PL.score)
FROM participant PA, played PL
WHERE PL.pid = PA.pid
    AND (SELECT *
        FROM played pl2
        WHERE count(pl2.pid) > 1)
        
SELECT pl.PID,  
FROM played pl 
WHERE pl.pid = pl2.pid and (SELECT pl2.PID, count(pl2.GID)
        FROM played pl2)
        
        
SELECT pl.PID 
FROM played pl 
WHERE pl.pid = pl2.pid and (SELECT pl2.PID, MAX(count(pl2.GID))
        FROM played pl2)

Comments

Please sign up or log in to contribute to the discussion.