Where is my Code First database?

Please help in Oracle database!?

  • I have no clue where to begin with these questions and they need to be completed in Oracle, someone please give me guidance >< like, tips on what I should use please? My uni teacher is so useless, they didnt explain to use what should be used. It based on a database containing sport leagues etc. just assume table names (vi) qry6.sql List the player number and name for those players who currently do not have any game time recorded. The report should be in player name order. (vii) qry7.sql List the names of all cities and the number of teams which they are home to. The columns should be labelled "City Name" and "Team Count", the output should be in order of the number of teams with the city supporting the least number of teams first. Where several cities support the same number of teams the output should be in city name order. (viii) qry8.sql List the team names and the total number of players from the team who played less than 20 minutes on the ground in the last two seasons (the current year and last year). The season attribute in the database is VARCHAR(5) to allow for sports which run multiple seasons within a calendar year, such seasons are coded as, for example: 2001S, 2001W (note that the first four characters are always the year). Name the columns as 'TEAM NAME' and 'LESS THAN 20 COUNT'. Sort the output according to the 'LESS THAN 20 COUNT' column, teams with have the same count should be ordered by team name. (ix) qry9.sql For a user selected league and season, display the season/round details, the full game date and time, the teams who played, the game outcome (as either Cancel, Draw, Forfeit or Win) and the winning team name (if there was no winner your report must display 'No Winner'). (x) qry10.sql List the player's name, team's name and player's year of birth of the oldest player in each team. Sort the output on team name within league code. If a team has two players of the same year of birth they should be displayed in name order. thanks!

  • Answer:

    It'd be difficult to make a very meaningful reply without some indication of your database schema (tables, columns and relationships). However, an educated guess: vi) SELECT playerid, name FROM players WHERE playerid NOT IN (SELECT DISTINCT playerid FROM gamestats) vii) SELECT city AS "City Name", COUNT(*) AS "Team Count" FROM teams GROUP BY city ORDER BY 1, 2 viii) SELECT name AS "Team Name", COUNT(*) AS "Less than 20 Count" FROM team t JOIN (SELECT teamid, playerid, SUM(playtime) FROM gamestats WHERE SUBSTR(season, 1, 4) IN (2012", "2011") GROUP BY teamid, playerid HAVING SUM(playtime) < 20) s ON t.teamid = s.teamid ORDER BY 2, 1 ix) Not enough info to make a guess x) SELECT p.name AS Player, t.name AS Team, league, YEAR(dob) AS "Year born" FROM player p, team t, roster r, (SELECT teamid, MAX(YEAR(dob)) AS maxyear FROM roster r JOIN player p ON r.playerid = p.playerid GROUP BY teamid) m WHERE p.playerid = r.playerid AND r.teamid = t.teamid AND r.teamid = m.teamid AND YEAR(dob) = maxyear ORDER BY 3, 2, 1

2greenia at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

you must have oracle in your computer, you must have database which store league data in tables. then you can start arrange SQL query to answer the questions. good luck

nicefx

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.