Swamped with your writing assignments? Take the weight off your shoulder!
Submit your assignment instructions
Create a database with three tables: temperature, station, country; keep them as separate tables in the database. Make sure to close the database connection after you are finished constructing it.
(it says that the table already exists and do not how to fixed it)
Write a Python function called query_climate_database() which accepts four arguments:
country, a string giving the name of a country (e.g. ‘South Korea’) for which data should be returned.
year_begin and year_end, two integers giving the earliest and latest years for which should be returned.
month, an integer giving the month of the year for which should be returned.
The return value of query_climate_database() is a Pandas dataframe of temperature readings for the specified country, in the specified date range, in the specified month of the year. This dataframe should have columns for:
The station name.
The latitude of the station.
The longitude of the station.
The name of the country in which the station is located.
The year in which the reading was taken.
The month in which the reading was taken.
The average temperature at the specified station during the specified year and month.