- Mastering PostgreSQL 9.6
- Hans Jurgen Schonig
- 163字
- 2021-07-09 19:57:24
Loading some sample data
To make this chapter a pleasant experience for you, I have compiled some sample data, which has been taken from the BP energy report: http://www.bp.com/en/global/corporate/energy-economics/statistical-review-of-world-energy.html.
Here is the data structure that will be used:
test=# CREATE TABLE t_oil (
region text,
country text,
year int,
production int,
consumption int
);
CREATE TABLE
The test data can be downloaded from our website using curl directly:
test=# COPY t_oil FROM PROGRAM ' curl www.cybertec.at/secret/oil_ext.txt ';
COPY 644
As in the previous chapter, you can download the file before importing it. On some operating systems, curl is not there by default or has not been installed, so downloading the file before might be an easier option for many people.
There is data for 14 nations between 1965 and 2010, which are in two regions of the world:
test=# SELECT region, avg(production) FROM t_oil GROUP BY region;
region | avg
---------------+-----------------------
Middle East | 1992.6036866359447005
North America | 4541.3623188405797101
(2 rows)
推薦閱讀
- Ansible Configuration Management
- 課課通計(jì)算機(jī)原理
- Circos Data Visualization How-to
- Deep Learning Quick Reference
- 傳感器技術(shù)實(shí)驗(yàn)教程
- 來吧!帶你玩轉(zhuǎn)Excel VBA
- Windows 7寶典
- 大數(shù)據(jù)技術(shù)與應(yīng)用
- SAP Business Intelligence Quick Start Guide
- 空間機(jī)械臂建模、規(guī)劃與控制
- PowerMill 2020五軸數(shù)控加工編程應(yīng)用實(shí)例
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- 人工智能:智能人機(jī)交互
- 電腦故障排除與維護(hù)終極技巧金典
- MySQL Management and Administration with Navicat