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.
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
Player info table
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 ....