Menu

[solved] – Question 83362

Write the queries that will do the following:

1. Select the top 10 countries with the most number of ip blocks allocated to it and the number of address blocks in it. Order if from greatest to least.

2. Select the top 10 cities with the most number of ip blocks in the united states and the number of address blocks in it. Order it from greatest to least.

3. Select the cities in the united states that have between 4,000 – 5,000 ip address blocks ordered from least to greatest.

4. Select the average number of ip blocks that would be found in a city for each state. Order it by state from least to greatest or A-Z.

The relational tables are below:

Countries
id(pk)
name
code

CityByCountry
city(pk)
country(fk pointing to id in countries table)
name
state

ip4
ip
country(fk pointing to id in countries table)
city(fk pointing to city in CityByCountry table)

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *