Appendix C. Sample Databases

  • SQL Scripts to Create Sample Database

  • MS SQL Server

  • MySQL

  • Oracle 7/8

The following SQL scripts create the sample database tables for the examples in Chapter 9 and 10. Scripts are given for Microsoft's SQL Server (Listing C.2), Oracle 7 and 8 (Listing C.1), and MySQL server (Listing C.2). With minor edits, these scripts can be modified to be used with any SQL database.

Example C.1. Oracle.sql

 DROP TABLE system_users CASCADE CONSTRAINTS / CREATE TABLE system_users (system_id VARCHAR2(6) NOT NULL, first_name VARCHAR2(30), last_name VARCHAR2(30), title VARCHAR2(30), phone VARCHAR2(10), building VARCHAR2(3), state_init VARCHAR2(2), entry_date DATE, CONSTRAINT PKsystem_users PRIMARY KEY (system_id)) / DROP TABLE state CASCADE ...

Get Core JSP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.