#!/bin/bash

psql <<_EOT
SELECT version();
CREATE DATABASE sakura;
\c sakura
CREATE TABLE tbl (a INT, b INT);
INSERT INTO tbl SELECT generate_series(1,100), generate_series(101,200);
 SELECT COUNT(*) FROM tbl;
SELECT AVG(a), AVG(b) FROM tbl;
DROP TABLE tbl;
_EOT
