Demonstration SQL

Various command files that are available with DB-Access.

The command files all have the extension .sql when displayed from the command line but are displayed without the extension on the SQL CHOOSE menu.

Keywords in these command files are shown in uppercase letters to make the SQL statements easier to read. Keywords in the actual command files are lowercase.
Important: Although the command files are listed alphabetically in this appendix, you cannot run the command files that create tables in that order without causing errors. The order in which the tables are created is important because of the referential constraints that link those tables.

When you select the Choose option on the SQL menu, the CHOOSE screen opens. The screen shows a list of the command files that you can access, similar to the display that the following figure shows. These files are included with the stores_demo database. Other .sql files are described later in this appendix.

Figure 1. Command files listed on the CHOOSE screen
CHOOSE >>   
Choose a command file with the Arrow Keys, or enter a name, then press Return.

----------------- stores_demo @dbserver1 -------------- Press CTRL-W for Help ------

alt_cat             c_state            d_trig             sel_ojoin1

c_calls             c_stock            d_view             sel_ojoin2

c_cat               c_stores_demo      del_stock          sel_ojoin3

c_custom            c_table            ins_table          sel_ojoin4

c_index             c_trig             opt_disk           sel_order

c_items             c_type             sel_agg            sel_sub

c_manuf             c_view1            sel_all            sel_union

c_orders            c_view2            sel_group          upd_table

c_proc              d_proc             sel_join
If you do not see the command files included with your demonstration database, check the following:
  • Did you copy the demonstration SQL command files to your current directory when you ran the demonstration database initialization script? If not, you can rerun the initialization script to copy them.
  • Did you start DB-Access from the directory in which you installed the demonstration SQL command files? If not, exit DB-Access, change to the appropriate directory, and start DB-Access again.

For instructions about running the initialization script, copying command files, and starting DB-Access, seedbaccess command: Start DB-Access.

Use these command files with DB-Access for practice with SQL and the demonstration database. You can rerun the demonstration database initialization script whenever you want to refresh the database tables and SQL files.

Copyright© 2018 HCL Technologies Limited