Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Answere of Question 5
- SELECT Country, TeamCaptain, TeamCoach
- FROM `team`
- WHERE Country LIKE '%l%' AND MatchWon > 50
- -- Answere of Question 6
- UPDATE matchinfo
- SET Score = '67'
- WHERE MatchID = 2008
- -- Answere of Question 7
- SELECT * FROM `team`
- WHERE MatchWon BETWEEN 30 AND 150 OR MatchLost BETWEEN 96 AND 37
- --Answere to Question 8
- DELETE FROM team
- WHERE TeamId = 1007
- --Answere of Question 9
- ALTER TABLE matchinfo
- ADD FOREIGN KEY (TeamId) REFERENCES team(TeamId);
- --ANswere to Question 10
- SELECT team.Country, matchinfo.Score
- FROM team
- RIGHT JOIN matchinfo
- ON team.TeamId = matchinfo.TeamId
- WHERE (select matchinfo.MatchID, sum(matchinfo.Score)
- group by MatchID) > 100
- --Answere to QUestion 11
- select team.Country, count(matchinfo.TeamId) as Count
- from team
- left outer join matchinfo on team.TeamId = matchinfo.TeamId
- group by team.TeamId
- SELECT DISTINCT team.Country, team.MatchWon, team.MatchLost, team.TeamCaptain, team.TeamCoach
- FROM team
- RIGHT JOIN matchinfo
- ON team.TeamId = matchinfo.TeamId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement