Upload
mnodalo
View
1.213
Download
3
Embed Size (px)
Citation preview
Database Concepts
Created by M Nodalo, Port Moresby International School for Year 11 Information Technology (T) - ACT/BSSS, revised 2010
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)
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.
Stages of Processing Data
Input processing Output
data information• Calculating
• Sorting
• Classifying
• Analysing
• Summarising
• reporting
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
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)
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
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)
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
Planning a DatabaseDefine the purpose of the databaseDetermine the type of output reportsList all the data items (determines the fields)
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
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
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
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
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
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
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
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
Field Name Data type Field size/length
Description
Sample database: Student file
Features of Computerised DatabasesCreate fieldsAdd and alter recordsSearch for specific recordsSort recordsPrint reports
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
What is MS Access?An example of a DBMS which was
developed by Microsoft Corporation.
Database Terms in AccessFields (columns)
Records (rows)
table – refers to a file in Access
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
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
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
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, =, >, <, <>, >=, <=)
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
Relational Database
Relational database links some tables with certain data common with other tables.
Sources• Chapter 7 – Database Applications & Privacy
Implications, Tomorrow’s Technology and You (8th ed) by G. Beekman & M. Quinn