CREATING TABLES

Once a database design has been completed, it can be mapped to an Ingres schema prior to implementation. In order to convert the data model to a schema you should consider the following points:-

  1. Convert each relation (data structure) derived in the data model into a table
  2. Choose appropriate/meaningful names for tables and attributes
  3. Choose appropriate data types/sizes to represent domains
  4. Split attributes where necessary e.g. name, address etc.
  5. Consider the use of null values
  6. Ensure consistency throughout the mapping - primary/foreign keys
  7. Choose appropriate table structures - primary keys
  8. Choose appropriate secondary indexes - foreign keys, functional requirements
  9. Consider entity & referential integrity

Data types, storage structures supported and other aspects of databases and dbase tables:

Further Reading:

Ingres Data Definition Language

You now need to create the tables for the Library database.

In order to prevent inappropriate choices being made, keep in mind the points outlined above when mapping this data model to your Ingres schema. Judicious selection at this stage will produce a sound foundation on which to build your applications. (NOTE: you are advised never to use c or vchar datatypes- they are 'leftover' from Ingres version 5), use varchar instead.

For all SQL commands needed in this section see texts:

Exercise 2 - Do this now.

Exercise 3 - Do this now.


This WWW material is copyright De Montfort University and may only be reproduced or used if this copyright notice is included.
This page is maintained by John Skelton. Comments or suggestions for improving this material can be emailed to jas@dmu.ac.uk) and will be gratefully received.