<commit_before># Lista alla matcher en spelare har spelat.
SELECT p.name, c1.name, c2.name, g.daTEOFGAME, t.name, ts.seasonname   FROM PLAYER p INNER JOIN PLAYER_GAME gp ON gp.player_ID = p.id INNER JOIN game g ON g.id=gp.game_id INNER JOIN CLUB c1 ON c1.id=g.hometeam_id INNER JOIN CLUB c2 ON c2.id=g.awayteam_id INNER JOIN TOURNAMENT_SEASON ts ON ts.id=g.tournamentseason_id INNER JOIN tournament t ON t.id = ts.tournament_id WHERE p.name='<NAME>'

# Lista alla spelare, med antal matcher i fallande ordning
SELECT p.name, COUNT(gp.id) as aaa FROM player p INNER JOIN player_game gp ON gp.player_id=p.id GROUP BY p.name ORDER BY aaa DESC

# Lista alla spelare, med antal gjorda m�l i fallande ordning
SELECT p.name, COUNT(ge.id) as goals FROM player p INNER JOIN game_event ge ON ge.player_id=p.id WHERE ge.EVENTTYPE ='GOAL' GROUP BY p.name ORDER BY goals DESC

# Flest matcher i Champions League (eller annan turnering)
SELECT p.name, COUNT(ts.id) as games FROM PLAYER p INNER JOIN PLAYER_GAME pg ON pg.player_ID = p.id INNER JOIN game g ON g.id=pg.game_id INNER JOIN TOURNAMENT_SEASON ts ON ts.id=g.tournamentseason_id INNER JOIN TOURNAMENT t ON t.id=ts.tournament_id WHERE t.name='CHAMPIONS LEAGUE' GROUP BY p.name ORDER BY games DESC

# Antal matcher per position för en viss spelare (Erlingmark)
select p.name, pos.name, count(pos.id) as gcount from player p 
inner join player_game pg ON pg.player_id=p.id 
inner join formation_position fp ON pg.formationposition_id=fp.id  
inner join position pos ON pos.id=fp.position_id
where p.name='<NAME>' 
GROUP BY p.name, pos.name

# Antal matcher på en viss position
select p.name, pos.name, count(pos.id) as gcount from player p 
inner join player_game pg ON pg.player_id=p.id 
inner join formation_position fp ON pg.formationposition_id=fp.id  
inner join position pos ON pos.id=fp.position_id
WHERE pos.name = 'Innermitt'
GROUP BY p.name, pos.name
ORDER BY gcount DESC<commit_msg>Added queries.sql new version<commit_after># Lista alla matcher en spelare har spelat.
SELECT p.name, c1.name, c2.name, g.daTEOFGAME, t.name, ts.seasonname   FROM PLAYER p INNER JOIN PLAYER_GAME gp ON gp.player_ID = p.id INNER JOIN game g ON g.id=gp.game_id INNER JOIN CLUB c1 ON c1.id=g.hometeam_id INNER JOIN CLUB c2 ON c2.id=g.awayteam_id INNER JOIN TOURNAMENT_SEASON ts ON ts.id=g.tournamentseason_id INNER JOIN tournament t ON t.id = ts.tournament_id WHERE p.name='<NAME>'

# Lista alla spelare, med antal matcher i fallande ordning
SELECT p.name, COUNT(gp.id) as aaa FROM player p INNER JOIN player_game gp ON gp.player_id=p.id GROUP BY p.name ORDER BY aaa DESC

# Lista alla spelare, med antal gjorda m�l i fallande ordning
SELECT p.name, COUNT(ge.id) as goals FROM player p INNER JOIN game_event ge ON ge.player_id=p.id WHERE ge.EVENTTYPE ='GOAL' GROUP BY p.name ORDER BY goals DESC

# Flest matcher i Champions League (eller annan turnering)
SELECT p.name, COUNT(ts.id) as games FROM PLAYER p INNER JOIN PLAYER_GAME pg ON pg.player_ID = p.id INNER JOIN game g ON g.id=pg.game_id INNER JOIN TOURNAMENT_SEASON ts ON ts.id=g.tournamentseason_id INNER JOIN TOURNAMENT t ON t.id=ts.tournament_id WHERE t.name='CHAMPIONS LEAGUE' GROUP BY p.name ORDER BY games DESC

# Antal matcher per position för en viss spelare (Erlingmark)
select p.name, pos.name, count(pos.id) as gcount from player p 
inner join player_game pg ON pg.player_id=p.id 
inner join formation_position fp ON pg.formationposition_id=fp.id  
inner join position pos ON pos.id=fp.position_id
where p.name='<NAME>' 
GROUP BY p.name, pos.name

# Antal matcher på en viss position
select p.name, pos.name, count(pos.id) as gcount from player p 
inner join player_game pg ON pg.player_id=p.id 
inner join formation_position fp ON pg.formationposition_id=fp.id  
inner join position pos ON pos.id=fp.position_id
WHERE pos.name = 'Innermitt'
GROUP BY p.name, pos.name
ORDER BY gcount DESC

# Lista alla unika spelare som en viss spelare spelat med, hur många gånger, samt första och sista matchdatum
SELECT distinct(p1.name) as name, COUNT(pg1.game_id) as cnt, MIN(g1.dateOfGame) as firstGame, MAX(g1.dateOfGame) as lastGame 
FROM PLAYER_GAME pg1 
INNER JOIN PLAYER p1 ON p1.id=pg1.player_id 
INNER JOIN GAME g1 ON g1.id=pg1.game_id 
WHERE pg1.game_id IN 
	(SELECT pg.game_id FROM GAME g 
	INNER JOIN PLAYER_GAME pg ON pg.game_id=g.id 
	WHERE pg.playER_ID = 38452) 
GROUP BY name ORDER BY name DESC
{'fraction_non_alphanumeric': 0.07328174783796086, 'fraction_numerical': 0.0065999089667728725, 'mean_word_length': 4.480049875311721, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1950419', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1599, 'n_words': 590}