SQL practice

Rather than typing your queries in at the prompt, you can also run scripts which will allow you to execute those commands from files.

In order to allow you to get better practice, we've created scripts that you can run to add in a bunch of tables and data into your database. Warning: these scripts will delete any tables that you have that are named student, faculty, class, emp, works, dept, flights, aircraft, certified, employees, suppliers, parts, catalog, sailors, reserves, boats, movie, starsin and, moviestar. If you do not have such tables, it will complain that such tables don't exist, but it'll work just fine

To use, do the following:

  1. Start up sqlplus:
    sqlplus <userid>@ug
    (More information can be found here)
  2. save all.sql in some directory. Use all_MySQL.sql if you are using MySQL.
  3. Start up sqlplus in the same directory that you put all.sql in.
  4. in sqlplus, type
    start all.sql