Chapter 4
Chapter 4
INTRODUCTION TO DATABASE
Manual file system: traditionally composed of a collection of file folders, each properly
tagged and kept in a filing cabinet.
As long as data collection was small, the manual system served its role as a data
repository.
However, as organizations grew, keeping track of data in a manual file system became
more difficult.
Finding data - time consuming
Report generation – slow
Key Terminologies
• Data - raw facts (Ex. Letter A, number 5, or some symbol)
• Field - characteristic of entity; column
• Record - set of logically related fields; row
• File - set of logically related records; table
• Database - set of logically related files
As the number of files in the system expands, system administration becomes more
difficult. Each file must have its own file management system, composed of programs
that allow the user to:
● Create the file structure
Modifications are likely to produce errors (bugs), and additional time can be spent
finding the errors in a debugging process.
Field Definition
Data structures are meant to last much longer than application code. Anyone that has
worked on a long running system can attest to that.
Well defined data structures and table layouts will outlive any application code.
It's not uncommon to see an application completely rewritten without any changes done
to its database schema.
Example:
Student Name: Last Name, First Name, Middle Name
Student Address: Street, Municipality, Province
By simply looking at the field names, we are able to determine to which files the fields
belong to and what information the fields contain
Example:
Stud_Lastname than Lastname
Length of the field name – short but specific
Add a field for primary key (unique key that holds a certain record)
Naming Convention
Database models require that objects be named. While several facets of naming an
object deserve consideration, in this article we’ll focus on the most important one:
defining a convention and sticking to it.
● Views
● Columns
● Keys – including the primary key, alternate keys, and foreign keys
● Schemas
● Constraints
● References
● Indexes
● Stored procedures
● Triggers
● Sequences
● Variables
4. Prefix names make sense when you include them as an indication of the object
type involved.
If you have multiple modules that all have similar tables that must be organized, then
allowing for a table prefix to distinguish between the different subjects will help
everything make a lot more sense. It’s important, however, to make sure that if you use
abbreviations for these different modules that the abbreviations make sense. If you’re
abbreviating a security module, using “ITY” might make sense to you since its the last
three letters of the word, but the average person is going to look at that like you’re
writing in a foreign language.