The HOTELDB demo database represents an extremely basic hotel administration system with information on the hotel’s visitors, location, vacancies, room prices, and so on.
Two versions of the HOTELDB demo database are provided:
HOTELDB_SIMPLE
This option for building the HOTELDB demo database provides a database with a
very basic structure:
Explanation of the Tables in
HOTELDB_SIMPLE
You need this version of the HOTELDB to work through all the examples in the
SQL tutorial.
HOTELDB_COMPLETE
This option for building the HOTELDB demo database provides a database
structure that is slightly more complex:
Explanation of the Database Objects in
HOTELDB_COMPLETE
This version of the HOTELDB is used for the examples in the Loader
documentation and training courses, for example.
You can modify the demo database to suit your needs.
...
1.
Install the
database software and tools.
To do so, follow the procedure in the Database Software
Installation Guide.
2.
Create a database
instance with the name HOTELDB. You can use the Database Manager GUI or CLI to
do so.
Create the HOTELDB database instance with the Database Manager
GUI
Create the HOTELDB database instance with the Database Manager
CLI
You can use different tools to create database users (Loader, Database Manager, for example, Database Manager GUI or CLI, query tools, such as SQL Studio, SQLCLI). The following sections describe how to enter the SQL statements for creating the MONA database user with the SQL Studio and SQLCLI tools.
...
1.
Log onto SQL Studio
as the database system administrator for the HOTELDB database instance.
If the HOTELDB database was created with the default values, the database
system administrator has the following user data:
User name: DBA, password DBA.
2.
Create the database
user MONA with the following SQL statement.
CREATE USER mona PASSWORD red DBA NOT EXCLUSIVE
3. Log off from SQL Studio.
Enter the following command in the command line:
sqlcli -d hoteldb -u dba,dba create user mona password red dba not exclusive
You can use various tools to create objects in the HOTELDB database instance and populate them with data (Database Manager CLI, Loader, Query Tools, such as SQL Studio, SQLCLI). An easy way to create the database objects and their contents is to run the HOTELDB_SIMPLE and HOTELDB_COMPLETE scripts provided. The following sections explain how to execute the SQL statements for creating the database objects and their contents with the SQL Studio and SQLCLI tools.
4. Log onto SQL Studio as the user MONA with password RED for the HOTELDB database instance.
5.
Create the required
tables and fill these with values.
To do so, use the relevant SQL statements as specified in HOTELDB_SIMPLE and
HOTELDB_COMPLETE.
Enter the following command in the command line:
sqlcli -d hoteldb -u mona,red -i HOTELDB_SIMPLE.txt
and
sqlcli -d hoteldb -u mona,red -i HOTELDB_COMPLETE.txt
Database user MONA has been created in the HOTELDB database instance as a database administrator (DBA) with the password RED. The database administrator MONA can open several database sessions at once (NOT EXCLUSIVE).
The HOTEL schema has been created. A series of database objects is now assigned to the HOTEL schema. The tables are filled with data.