Population

Loading the package

<< DatabaseAccess`

Listing all available databases

DataSources[] // TableForm

Opening the population database

dbselect  =  OpenDataSource["population"]

Listing all tables in the population database

DataSourceTables[dbselect]  // TableForm

Checking available datatypes

DataSourceDataTypes[dbselect]

Printing the table into memory

data = 
      DataSourceEvaluate[dbselect,  SQLSelect[SQLTable["population"]]] // 
        TableForm

Displaying the column headings

DataSourceEvaluate[dbselect,  
        SQLSelect[SQLTable["population"]],  
        ShowColumnHeadings  ->  True][[1, All]]

Plotting a dataset

ListPlot[
      DataSourceEvaluate[dbselect, 
        SQLSelect[
          SQLTable["population"], {SQLColumn["Year"],  
            SQLColumn["Japan"]}]], PlotJoined -> True, 
      Axes -> False,  Frame -> True, 
      PlotLabel -> "Projected Population of Japan"]

ListPlot[
      DataSourceEvaluate[dbselect, 
        SQLSelect[
          SQLTable["population"], {SQLColumn["Year"],  
            SQLColumn["Germany"]}]], PlotJoined -> True, 
      Axes -> False,  Frame -> True, 
      PlotLabel -> "Projected Population of Germany"]

Simple operations on datasets

ListPlot[
      DataSourceEvaluate[dbselect, 
        SQLSelect[
          SQLTable["population"], {SQLColumn["Year"],  
            SQLColumn["Germany"]/SQLColumn["Japan"]*100}]], 
      PlotJoined -> True, Axes -> False,  Frame -> True, 
      PlotLabel -> "Population of Germany as Percentage of Population \
of Japan"]