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:-
- Convert each relation (data structure) derived in the data model into a table
- Choose appropriate/meaningful names for tables and attributes
- Choose appropriate data types/sizes to represent domains
- Split attributes where necessary e.g. name, address etc.
- Consider the use of null values
- Ensure consistency throughout the mapping - primary/foreign keys
- Choose appropriate table structures - primary keys
- Choose appropriate secondary indexes - foreign keys, functional
requirements
- Consider entity & referential integrity
Data types, storage structures supported and other aspects of databases
and dbase tables:
Further Reading:
- "Ingres Thru Forms & Menus" Part 1, chapter 2 p2.18; chapter 5
pp5.18 - 5.29;
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:
- "SQL Reference Manual", OR
- for selected, abbreviated details of syntax
see this.
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.