30
Database Concepts Created by M Nodalo, Port Moresby International School for Year 11 Information Technology (T) - ACT/BSSS, revised 2010

Database concepts presentation version 2010 revised

  • Upload
    mnodalo

  • View
    1.213

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Database concepts presentation version 2010 revised

Database Concepts

Created by M Nodalo, Port Moresby International School for Year 11 Information Technology (T) - ACT/BSSS, revised 2010

Page 2: Database concepts presentation version 2010 revised

ObjectiveSo that students will be able – to discuss the basic database concepts and terminologies

– data, information, field, record, key field, computed fields, field length, data types, etc.

To discuss the concept of relational database and flat-file database

To discuss the concept of SQL (structured query language)

Page 3: Database concepts presentation version 2010 revised

Data Vs. InformationData – raw fact or figures Example : Max Freeman 55,000 25

Information – data that have been processed to be meaningful to the user

Example: K55,000 x .25 = K13,750

Max Freeman is a salesman who earned K55,000 sales for this month and therefore, receives 25% commission which is K13,750.

Page 4: Database concepts presentation version 2010 revised

Stages of Processing Data

Input processing Output

data information• Calculating

• Sorting

• Classifying

• Analysing

• Summarising

• reporting

Page 5: Database concepts presentation version 2010 revised

What is a Database?An organised collection of data items that are related to

a particular topic, purpose or activityExamples: a telephone directory, an address book, student class

list

Page 6: Database concepts presentation version 2010 revised

Databases can be stored Manually (in a filing

cabinet with index cards, 3-ring binders, file folders)

Electronically using a computer system (with suitable database software)

Page 7: Database concepts presentation version 2010 revised

Manual databases - concernsData duplication – same data on each fileEffects of data duplication:

More space is taken up by the filesMore work is needed to retrieve the

information

Page 8: Database concepts presentation version 2010 revised

Advantages of Computerised Databases over Paper filesEasier to store large volume of informationEasier to retrieve information quickly /flexiblySpeed of information processingVersatility/flexibility in organising & reorganising

informationEasier to display, print & distribute information in a

variety of waysValidation checks may be made on the data (done

by a computer program)

Page 9: Database concepts presentation version 2010 revised

Disadvantages of Computerised database over paper files

Unable to access data when there’s a computer breakdown

Ease of copying computer files; passwords needed for extra protection

Extra cost & time to train people to use the database

Page 10: Database concepts presentation version 2010 revised

Planning a DatabaseDefine the purpose of the databaseDetermine the type of output reportsList all the data items (determines the fields)

Page 11: Database concepts presentation version 2010 revised

Database StructureTable – a collection of related recordsRecord – a collection of data about a person or thing

made up of one or more fieldsField – a single piece of data or information common

to all records

file

recordName: Venus Jackson

Age: 27

Home Address: Gere-gere Ave., Boroko, NCD

Gender: Female

Job Position: Accounts Clerk

Pay Rate/FN: 750.00

Years in Service: 5

fields

Employee file

Page 12: Database concepts presentation version 2010 revised

Example of a DatabaseTelephone Directory

Telephone Directory

Name Address Phone NumberAldo,Mark East Boroko 323-2932Amani,James Hohola 325-9022Artona,Kathy Port Moresby 323-4325

records

File/table name

Field data

Field name

Page 13: Database concepts presentation version 2010 revised

Two parts of a field:1. Field name – words that represent each field data

or information, e.g.name, address, phone number, etc.

2. Field data – the actual data or information item stored in a field,

e.g. Mary Jones, Boroko, 325-3423

Page 14: Database concepts presentation version 2010 revised

Designing a RecordField namesType of data (text, numeric, date, boolean,

image)Field length or size – the total number of

characters allowed for a particular fieldField description

Page 15: Database concepts presentation version 2010 revised

Field length/sizeShould be designed to cope with the largest

entry possible without reserving unnecessary disk space

Too long field sizes – - will take up more space on the storage media (floppy/hard disk/CDs/flash drives)

- takes longer to process

Page 16: Database concepts presentation version 2010 revised

Types of DataNumeric – contains only numbersCharacter text – numbers, letters &

other symbols can be enteredDate – date is entered as 01/09/04Logical (Boolean) – allows Y/N (yes/no)

or T/F (true/false)Image/Picture

Page 17: Database concepts presentation version 2010 revised

Key FieldA field that may be used to search a fileIt makes a record unique from other records

in the filee.g. student ID number, Book ID number,

employee ID, customer code

Page 18: Database concepts presentation version 2010 revised

Computed fieldContain formulas similar to spreadsheet

formulaThey display values calculated from values in

other numeric fieldsExample: Net Pay may contain formula which

calculates an employee’s net pay using Gross Pay and Tax fields

Page 19: Database concepts presentation version 2010 revised

Field Name Data type Field size/length

Description

Sample database: Student file

Page 20: Database concepts presentation version 2010 revised

Features of Computerised DatabasesCreate fieldsAdd and alter recordsSearch for specific recordsSort recordsPrint reports

Page 21: Database concepts presentation version 2010 revised

What is DBMS?DBMS – Database Management SystemA computer program that allows you to set up a

database on computer. build a database add new data, delete or edit existing data search and extract specific data based on certain criteria

(query) change/alter the structure of the data file sort and reorganise data display data on screen / print reports security of allowing certain people to access files

Page 22: Database concepts presentation version 2010 revised

What is MS Access?An example of a DBMS which was

developed by Microsoft Corporation.

Page 23: Database concepts presentation version 2010 revised

Database Terms in AccessFields (columns)

Records (rows)

table – refers to a file in Access

Page 24: Database concepts presentation version 2010 revised

Database Queries Issues the incompatibility of database languages created difficulty for people using different

applications to access the same database

E.F. Codd (IBM) – proposed the standardized structured English Query Language or what evolved as the SQL

Page 25: Database concepts presentation version 2010 revised

Structured Query Language (SQL)Not a database management systemNot a full-featured programming language like Java or

C+.It is a sublanguage tailored for the database

environmentSQL statements – embedded inside computer programs

such as COBOL, C or other programming languagesSQL statements – understood by MS Acccess, MS SQL

Server, DB2, Oracle, Sybase & other database programs

Page 26: Database concepts presentation version 2010 revised

Structured Query Language (SQL)Combines database concepts of

Tables/filesRecords (rows)Fields (columns) Mathematical concept of set

See example on pages 234-235 (Chapter 7 Database Applications and Privacy Implications, Tomorrow’s Technology and You) – 7.1 The Language of Database Queries

Page 27: Database concepts presentation version 2010 revised

Structured Query Language (SQL)Basic SQL statements – filters the records of a

database to be able to extract only those records that meet specific criteria

SQL statement format:SELECT (specify fields to extract)

FROM (specify source – file name)

WHERE (specify criteria or condition using appropriate comparison operators such as AND, OR, NOT, =, >, <, <>, >=, <=)

Page 28: Database concepts presentation version 2010 revised

Types of Databases• Flat file database – uses only one file at a

timeExample: MS Excel – spreadsheet list

• Relational database – consists of several files in which data can be accessed simultaneouslyExample: MS Access

Page 29: Database concepts presentation version 2010 revised

Relational Database

Relational database links some tables with certain data common with other tables.

Page 30: Database concepts presentation version 2010 revised

Sources• Chapter 7 – Database Applications & Privacy

Implications, Tomorrow’s Technology and You (8th ed) by G. Beekman & M. Quinn