0% found this document useful (0 votes)
41 views

Introduction To Databases

This document provides an introduction to databases, including: 1) An overview of what databases are, who uses them, examples of database types, and database management systems. 2) Exercises walking through importing data from an Excel file into an Access database table, creating an index on a field, handling duplicate records, and adding a primary key. 3) Key concepts covered include tables, records, fields, indexes, unique identifiers, and primary keys.

Uploaded by

Ammie Bioanal
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Introduction To Databases

This document provides an introduction to databases, including: 1) An overview of what databases are, who uses them, examples of database types, and database management systems. 2) Exercises walking through importing data from an Excel file into an Access database table, creating an index on a field, handling duplicate records, and adding a primary key. 3) Key concepts covered include tables, records, fields, indexes, unique identifiers, and primary keys.

Uploaded by

Ammie Bioanal
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 29

Week 1

Session 1B

Introduction to Databases

ISCG 5423
Introduction to Databases
Why learn about Databases?

 What is a Database?
 Who uses Databases and why?
 Do you use a Database?
 Who designs/develops Databases?
- What skills are required?
Relationship between data items
turns data into information
Database
 What is a database?

 Examples:


Database application
 What is a database application?
Evolution of Databases

1960 1980 2000

Manual filing systems


Computerised Flat files
Hierarchical
Network
Relational
Object Oriented
Object Relational
Others
Database Management System
 A database management system (DBMS) is a set of
software programs that controls the organization,
storage and retrieval of data in a database. It also
controls the security and integrity of the database.
 Examples:
 Oracle

 Microsoft SQL server

 DB2

 MySQL

 Used by database developers and database


administrators to create and maintain database
applications
RDBMS
 A relational DBMS is a database management
system that manages data as a collection of
tables in which all data relationships are
represented by common values in related tables.
ODBMS
When you integrate database capabilities with
object programming language capabilities, the
result is an object-oriented database management
system. An ODBMS makes database objects
appear as programming language objects in one or
more existing programming languages. Object
database management systems extend the object
programming language with transparently persistent
data, concurrency control, data recovery,
associative queries, and other database
capabilities.
Glossary

 Data
 Information
 Database
 Database Application
 Database Management System (DBMS)
Exercise 1 – The data source
1. From Moodle download file Person.xls and
store it in your own area.
2. Open this file in MS Excel
 Questions:
• What is stored?
• Notice Rows and Columns
 What is in each?

3. Close the file and Excel.


Good Database Design (1)

• The User-Interface is designed in such a way


that it prevents the input of invalid data
• The access to data is controlled via security
mechanisms
Good Database Design (2)

 The name of a database application should be


meaningful
 Eg Video Rental, Student Enrolment
 The name of the data items (column names)
should be meaningful and as specific as
possible
 Eg Customer Name, Home Contact Num,
Work Contact Num
Exercise 2 – Import the data into a DB

1. Open MS Access
2. Create a new blank database
3. Call the database ‘ClientContact’
4. Select External Data, MS Excel
5. Select ‘Person.xls’
6. Click ‘First row contains column headings’
Exercise 2 – Import cont’d
8. Click NEXT
9. Select ‘In a new table’ and click NEXT
10. Change fieldnames to something more useful
11. Leave ‘indexed’ on NO, click NEXT
12. Select ‘No Primary Key’ and click NEXT
13. Change table name from ‘Sheet1’ to ‘CLIENT1’
and click FINISH
Questions
 What is the equivalent of an Excel worksheet
called in Access?

 In Access what are Rows and Columns called?


Row =
Column =

 What do you notice about the data in the table?


Exercise 3 – Create an indexed field
Repeat the exercise, with the following change:

1. On ‘NAME’ field set Index to YES


(duplicates OK)
2. Save the table as CLIENT2

Question: what effect has the INDEX?


Index
 A feature that speeds up searching and sorting
in a table based on key values.
 Is a VIEW of the data
 Some fields can't be indexed because of their
data type.
 The Primary Key of a table is automatically
indexed. (more on PK later)
Duplicate Records
 Duplicate Records are a problem.
 Why?
What to do with Duplicate records
 First make sure the two records are duplicates,
i.e. the data belongs to the same ‘thing’
 If there are differences between the records in
some of the data items, establish which is the
most up-to-date
 Delete the older record
Consider…
 Not all records that appear (at first glance)
the same, are duplicate records

 In Auckland phone book, how many:

• Last name ‘Smith’ ?


• ‘Smith’ and initial ‘A’
• ‘Smith’ and first name ‘Andrew’
Consider …

At Unitec, how many students:

• Last name ‘Smith’


• ‘Smith’ and initial ‘A’
• ‘Smith’ and first name ‘Andrew’
• ‘Smith’ and ‘Andrew James’
Problem

How do we distinguish one record from another -


ie one client from another when some of the
data is the same? E.g. two clients have the
same first and last name?
Unique Identifier
 Is one of the fields
 Every record must have one
 It uniquely identifies each record
 Called a Primary Key (PK) in Relational
Database
 Sometimes one of the existing fields can be
used as PK
 Sometimes several fields together can be
used as PK
 Often we make up a new field to be the PK
Exercise 4 – Create a Primary Key
Repeat the exercise, with the following change:

1. Let Access add a Primary Key


2. Save the table as CLIENT3

Question:
 How has the table changed?
 Have duplicate records been removed?
Duplicate Records - again
 Using a PK does not remove duplicate records
 Business processes need to be set up to avoid
the creation of duplicate records
 Databases need to be checked and ‘cleansed’ to
removed duplicate data.
Good Database Design (3)

• The database is designed in such a way that


there is minimal duplicate data
Glossary
 Table
 Record
 Field
 Index
 Unique Identifier
 Primary Key
Home Work
Visit the following websites
 http://www.microsoft.com/office/access
Read the overview
 http://www.microsoft.com/sql/prodinfo/overview/what-is-
sql-server.mspx

Read ‘what is SQL Server 2005’


 http://www.oracle.com/index.html
Read about one of the application products
 http://dir.yahoo.com/computers_and_internet/software/
databases

Browse the list of Database sites

You might also like