Ramakrishnan & Gehrke Sailors script for Oracle database

The chapter 5 of the  book “Database Management Systems” (Ramakrishnan, Raghu & Johannes Gehrke.) introduces the Sailors data model, a set of three tables named Sailors, Boats and Reserves

In this article, the SQL script that implements the creation of these relational structures is developed and adapted  for Oracle Database. This script is based on the script worked by Hjalmtyr Hafsteinsson for PostgreSQL database.

The script does the following tasks

Cleans Sailors Schema and tablespaces of previous script executions

Creates Sailors_data and Sailors_index  tablespaces

Creates Sailors Schema

Grants roles and privileges to Sailors user

Connects to Sailors user

Creates tables, constraints,  in the Sailors Schema

Populates tables

Adds new columns  and new constraints (that are not part of the original data model)

Creates B-tree indexes for columns that are used in WHERE clause

The figure below shows the Sailors data model. It was developed using Oracle SQL Data Modeler

Sailors Model
Sailors Model

Finally, in the following link, you can see the Sailors SQL Script

SailorsSchemaOracle3