Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

by Miss Ilham

Database

Data Manipulation

What is Database?

Structure

  • organised collection of related data.
  • software which stores and retrieves data in a structured way
  • includes the data that is stored and the links between the data items.

Intro

Examples of Database

  • Yellow Pages
  • Phone book in mobile phone
  • Microsoft Access
  • MySQL

What kind of information could we store in a database?

  • Patient information in a hospital
  • Car registration numbers and owners
  • Names and phone numbers of friends
  • Student information in a school
  • Criminal Records

Structure

All databases store data using a system of:

  • Field
  • Record
  • File

Field

  • single item of data, eg. name/ date of birth
  • Each field has a field name that is used to identify it
  • Each field contains one type of data, eg. Text/ number

Record

  • collection of fields
  • eg. all the information about one person or one item
  • These may contain different data types.

File

  • organised collection of record
  • where all the records are organised so that they can be stored together
  • can have one or more tables within it.

Although all databases have these three elements in common, there are two types:

  • flat-file databases
  • relational databases

Types

Flat-File

Flat-file databases

  • stores its data in one table
  • organised by rows and columns
  • Each column in the table contains a field (with field name)
  • each cell in that column has the same, predefined data type

Relational

Relational databases

  • stores data in more than one linked table (in a file)
  • designed so that the same data is not stored many times
  • tables within a relational database are linked with relationships

Key Field

  • Each table within a relational database will have a key field
  • The relationships linking the tables use these key fields.
  • There are two types of key field:
  • Primary
  • Foreign

Primary Key Field

  • Most tables will have a primary key
  • holds unique data (no two of the same data)
  • used to identify that record
  • Examples:
  • Student ID
  • IC number
  • Passport number

Foreign Key Field

  • Some tables will have one or more foreign key fields
  • A foreign key field in one data table stores values from a primary key field in another table

VS

From Flat File to Relational

Example:

the names of each student taught by each teacher using a flat-file database

From Flat File to Relational

  • Now split into two tables
  • one for the teachers and one for the students
  • link them together
  • it can be stored and retrieved more efficiently

From Flat File to Relational

  • Example:

Teachers table

From Flat File to Relational

  • Example:

Students' table

From Flat File to Relational

  • These two tables are linked with a ‘one-to-many’ relationship
  • because one teacher’s record is linked to many students’ records
  • The primary key fields are the Student_ID and Teacher_ID.
  • The foreign key fields are English, Maths and Science

Advantages of using relational databases

  • storage space is saved by not storing data more than once
  • each change to an item of data or to a record has to be made only once
  • easier for users to produce reports

Advantages of using flat-file databases

  • Although people often think that it is quicker to search using relational rather than flat-file databases, it is not always the case.

Data types and sub-types

Data

Types

  • When you create a new database you will set a data type for each field
  • Data type tells Database how to store and manipulate the data for each field

Alphanumeric

Alphanumeric

  • store alpha characters (text)
  • and numeric data (numbers) that will not be used for calculations
  • Other names:
  • Text, short text, long text
  • String
  • Varchar

Alphanumeric examples:

  • Sophia
  • Alex324
  • 173@Tyler
  • Michelle Lee
  • Hi, have a great day!
  • 0171234567 (phone numbers and IC numbers are usually stored as alphanumeric because we do not use them for calculation)

Numeric

  • used to store numeric values that may be used for calculations
  • Other name:
  • Number

Integer

Integer

  • stores whole numbers
  • Other names:
  • short integer
  • long integer (wise to use a long integer field if
  • it is going to contain three or more digits)
  • fixed
  • Eg. : 230, -450

Decimal

Decimal

  • allow a large number of decimal places
  • Other names:
  • Double
  • Float

Currency

Currency

  • allow currency formatting to be added to the display
  • 2 decimal places
  • includes currency symbols and regional symbols
  • the database does not store these symbols as this would use up valuable storage space
  • eg.: $42.00

Date

and

Time

Date & Time

  • which stores a date and/or time as a number
  • different date formatting display:
  • General Date (eg: 06/30/2018 10:10:42 AM)
  • Long Date (eg: Monday, August 27, 2018)
  • Medium Date (eg: 27/Aug/18, 27-Aug-18)
  • Short Date (eg: 8/27/2018, 8-27-2018)
  • Long Time (eg: 10:10:42 AM)
  • Medium Time (eg: 10:10 AM)
  • Short Time (eg: 10:10)

Boolean

Boolean

  • or logical
  • stores data as 0/ -1
  • but can display it as:
  • Yes/ No
  • True/ False
  • 0/ -1

Data Capture

Intro

Data Capture

  • Before setting up a database, the record structure must be decided to make best use of the memory and backing store, and to make searching and report creation easier.

  • For example, a car showroom wants to record details of the cars it sells. Before setting up the database, the following questions need to be answered:
  • What information is needed?
  • What validation could there be?

Data Capture

  • With these questions answered, informed decisions can be made about the record structure. This is how it might begin:

Best practice when designing a Database

  • Ask the correct questions
  • Choose correct field type
  • Field name must be concise and precise about the data it contains
  • Avoid space in field name
  • Choose a correct primary key

Data Capture Methods

Methods

  • Data capture method used as a fact finding technique to gather data. There are four common method used:
  • Observation
  • Questionnaire
  • Interview
  • Looking at existing paperwork

Observation

Observation

  • Involve watching personnel doing their job to find out exactly how it works
  • Advantage - obtain reliable data
  • Disadvantages - make people uncomfortable

Questionnaire

Questionnaire

  • Involve distributing form to respondent to fill in the details
  • Advantage - quick and reach a lot of people in short time
  • Disadvantage - number of returned questionnaire is low

Interview

Interview

  • Involve one-to-one question and answer session between analyst and respondent.
  • Advantage - can clarify respondent’s answer
  • Disadvantage - time-consuming

Paperwork

Looking at Existing Paperwork

  • Allow analyst to see exactly how data are kept manually.
  • Advantage - can see exactly what data and how to design the database later
  • Disadvantage - time-consuming

Forms

Data Capture Form

  • Before setting up a database the data must be collected. This can be done using a data capture form.

Data Capture Form

  • Data capture forms often use boxes or a set amount of spaces and occasionally provide examples too.

  • This is to make sure each field is completed correctly.

How to create data capture form?

  • In Microsoft Access, data capture form or data entry form can be created using Form Wizard

What is Wizard?

  • Also called as setup assistant

  • is a user interface type that presents a user with a sequence of dialog boxes that lead the user through a series of well-defined steps.

  • Tasks that are complex, infrequently performed, or unfamiliar may be easier to perform using a wizard.

Example of wizard in Access

Key-features of Well Designed Form

  • simple, with clear questions, using closed questions where possible
  • has similar fields grouped together
  • with white space between each data entry box
  • has a title
  • there are instructions on filling in the form
  • field has appropriate space for the data that will be added
  • Radio buttons (or drop-down menus) are used where possible
  • there are navigation buttons
  • key fields can be highlighted to show that this data must be completed before the record can be saved

Perform Search

Manipulate

  • Using QUERY
  • In Microsoft Access, query is created using QUERY WIZARD

Mathematical

Criteria

Logical

Criteria

Like

Criteria

Other

Criteria

PROGRAMS

Present

PROGRAM 1

PROGRAM 1

Program location

KEY RESULTS

PROGRAM 2

PROGRAM 2

KEY RESULTS

PROGRAM 3

PROGRAM 3

KEY RESULTS

Learn more about creating dynamic, engaging presentations with Prezi