Introduction To Database Programming: What Is A Database?
Introduction To Database Programming: What Is A Database?
Programming 2
Introduction to Database Programming
What is a Database?
As you begin to build dynamic applications, it becomes obvious that you need to store data and
allow users to access it through your application.
Common examples of business databases include a customer list, mailing list, product information,
or reservation system.
Definitions of a ‘database’
● ‘A structured collection of data items stored, controlled, and accessed through a computer based
on predefined relationships between predefined types of data items related to a specific business,
situation, or problem’ (Alter, 2002)
● ‘A computer structure that houses a collection of related data (raw facts) and metadata. The
metadata consist of data about data, that is, the data characteristics and relationships’ (Rob &
Coronel, 2002)
● ‘An organized collection of facts and information’ (Stair & Reynolds, 2008)
Types of databases
There are two main types of databases:
• Flat-file
• Relational
Flat-file database
A flat file is a simple database where there is no relationship between tables within the database.
An Excel spreadsheet is an example of a flat file database.
Relational Database:
A relational database is the most popular database used for complex record storage. A relational
database contains relations between the tables within the database.
Multiple user databases allow more than one person to use the database at one time. An Oracle
database and a SQLServer database are examples of a multiple user database.
Cert IV Multimedia/Websites
Programming 2
Introduction to Database Programming
There are many types of RDBMS including: Oracle, Sybase, Microsoft SQL Server, Ingres, DB2,,
MySQL and Microsoft access.
This semester, we will be using Microsoft Access which is falls into the desktop category of
database engines and works best for individuals and small workgroups.
In contrast, Microsoft SQL Server is a server-based, enterprise-level database and can have
thousands of concurrent connections. We use SQL Server at Diploma level.
Tables
A database organizes data in tables. A table is a collection of data about a specific topic. Separate
tables are used for each topic.
For instance, the table below stores data about Doctors. As you can imagine, a pharmaceutical
representative would find this data very useful when setting up appointments. The alternative
would be to consult another type of database – the phone book.
Date/Time Date or time values for the years 100 through 9999 such as a
birthday.
Lookup Wizard Creates a field which allows you to select a value from another
table or from a list of values displayed in a list box or a combo
box.
Cert IV Multimedia/Websites
Programming 2
Introduction to Database Programming
Primary Keys
Each table must have a field that uniquely identifies each record. This field is the Primary Key of
the table.
For instance, a database belonging to a financial institution may contain millions of records about
thousands of customers. Among those customers there may be several with the name John Brown.
You couldn’t rely on the database to find the record for the particular John Brown you are trying to
work with, it might end up updating or deleting the wrong record. We can avoid these kind or
problems by using a system that uniquely identifies each row in the table.
Each table you create should include an ID field. This column is then chosen to uniquely identify
each record and is called the Primary Key.