Classical Scott database (EMP, DEPT, SALGRADE) for PostgreSQL
PLpgSQL
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
pg-scott-nd.sql
pg-scott-show.sql
pg-scott.sql

README.md

pg-scott

This is the classical Scott database (EMP, DEPT, BONUS, SALGRADE) for use in PostgreSQL.

See docker-pg-scott and docker-pg-scott-nd for Docker images that include a PostgreSQL server with data from pg-scott.sql and pg-scott-nd.sql respectively, that automatically start the psql shell to play with the data interactively. (Not yet - Work in progress...)

Data

Three relations are available: emp, dept and salgrade.

The data is based on the data in The EMP and DEPT tables in Oracle by Nick Buytaert with some differences.

pg-scott.sql

pg-scott.sql (download)

Two dates were changed to be consistent with other sources, like Oracle Példatár by Kende Mária and Nagy István:

  1. Scott's hiredate changed to 1982-12-09
  2. Adams' hiredate changed to 1983-01-12

pg-scott-nd.sql

pg-scott-nd.sql (download)

In addition to changes in pg-scott.sql, there was one change:

  1. Smith's deptno changed from 20 to NULL

To play with examples where one employer has no department.

Conversion

Converted to the simplest PostgreSQL data types (integer, text and date).

Issues

For any bug reports or feature requests please post an issue on GitHub.

Author

Rafał Pocztarski - https://github.com/rsp

License

MIT License (Expat). See LICENSE.md for details.