Hi guys,
I'm learning basic SQL. I have a query I can't solve.
Need to create a query named Task1D to list the last name, first name, number of matches, total number of points, for players who have played more than 10 matches and scored more than 330. A portion of the expected output is shown below.
Task2D
Last Name First Name # Match Total Points/Match
SMITH CLARENCE 16 371 23
SHAFFER BILLY 16 352 22
SCOTT ENRIQUE 16 351 22
HENDERSON GREGORY 16 346 22
Player Stats table
[img]http://img210.imageshack.us/img210/3349/sql1.gif[/img]
Player info table
[img]http://img717.imageshack.us/img717/4418/sql2.gif[/img]
Now, I know I have to use aggregate functions and use COUNT for the rows of each player, then set a rule for > 10. Then SUM and multiply the points scored by 1pt,2pt,3pt... but I'm stuck, can't seem to write the proper statement.
Thanks in advance!!
SELECT PLAYER.PLAYER_LNAME, PLAYER.PLAYER_FNAME, COUNT(MATCH_ID) AS '# Match'
FROM PLAYER_STAT, PLAYER
....