You are on page 1of 64

Chapter 11

Databases

Computer Concepts 2014

1 Chapter Contents 1 Section A: File and Database Concepts


Section B: Data Management Tools Section C: Database Design Section D: SQL Section E: Database Security

Chapter 11: Databases

1 1 Database Basics

Section A: File and Database Concepts

Database Models

Chapter 11: Databases

1 Database Basics 1 A database is a collection of


information

Typically stored as computer files

T e tas!s associated "it creating# maintaining# and accessing t e information in databases are referred to as data management# file management# or database management
Chapter 11: Databases 4

1 Database Basics 1 Databases can be used in a $ariety of "ays


Collect and store data %pdate data &rgani'e and output data Distribute data Find data Analy'e data

Chapter 11: Databases

1 Database Basics 1 Data mining refers to t e process of analy'ing


e(isting database information to disco$er pre$iously un!no"n and potentially useful information# including relations ips and patterns

Data "are ouse )redicti$e analytics

Chapter 11: Databases

1 Database Basics 1 &LA) *online analytical processing+ allo"s decision


ma!ers to ,uic!ly get ans"ers to comple( ,ueries

E(ecuti$e das board soft"are Big data

Chapter 11: Databases

1 Database Models 1 An unstructured file as a uni,ue structure and


contains different !inds of data A structured file uses a uniform format to store data T e underlying structure of a database is referred to as a database model

Chapter 11: Databases

1 Database Models 1 T e simplest model for storing data is a flat file t

at consists of a single# t"o-dimensional table of data elements

Chapter 11: Databases

1 Database Models 1 A field contains t e smallest unit of meaningful


information Eac field as a uni,ue field name .ariable-lengt field $s/ fi(ed-lengt field

Chapter 11: Databases

10

1 Database Models 1 A record is a collection of data fields


T e template for a record is referred to as a record type A record t at contains data is referred to as a record occurrence

Chapter 11: Databases

11

1 Database Models 1 A relations ip is an association bet"een data t


stored in different record types

at is

Cardinality

&ne-to-many relations ip Many-to-many relations ip &ne-to-one relations ip

Chapter 11: Databases

12

1 Database Models 1 Cardinality refers to t e


number of associations t at can e(ist bet"een t"o record types T e relations ip bet"een record types can be depicted grap ically "it an entity-relations ip diagram

Chapter 11: Databases

13

1 Database Models 1 A ierarc ical database allo"s one-to-one and oneto-many relations ips# lin!ed in a ierarc ical structure

Chapter 11: Databases

14

1 Database Models 1 A net"or! database uses a mes

-li!e structure to offer t e additional capacity to define many-to-many relations ips

Chapter 11: Databases

15

1 Database Models 1 A relational database stores data in a collection of


related tables

Chapter 11: Databases

16

1 Database Models 1 A dimensional database organi'es relations


o$er t ree or more dimensions

ips

Chapter 11: Databases

17

1 Database Models 1 An ob0ect database stores data as ob0ects# "


can be grouped into classes and defined by attributes and met ods

ic

Chapter 11: Databases

18

1 Database Models 1 T e term ob0ect-relational database is


used to describe a $ariety of tec nologies t at combine ob0ectoriented and relational concepts

Chapter 11: Databases

19

Section B: Data 1 Management Tools 1

Data Management Soft"are Database Management Systems Databases and t e 1eb 2ML

Chapter 11: Databases

20

1 Data Management So t!are 1

Chapter 11: Databases

21

1 Data Management So t!are 1

Chapter 11: Databases

22

1 Data Management So t!are 1 3t is possible to enter data as ASC33 te(t file


Custom data management soft"are Data dependence $s/ data independence

Chapter 11: Databases

23

Database Management 1 S"stems 1


Soft"are designed to manage data stored in a database


2ML DBMS &&DBMS 4DBMS

Chapter 11: Databases

24

Database Management 1 S"stems 1

Chapter 11: Databases

25

Database Management 1 S"stems 1

Database client soft"are allo"s any remote computer or net"or! "or!station to access data in a database

Chapter 11: Databases

26

Database Management 1 S"stems 1

Multiple users can interact "it t e same database

Chapter 11: Databases

27

1 Databases and the #eb 1 T e 1eb allo"s access to many databases


Static 1eb publis ing Dynamic 1eb publis ing Ser$er-side program

Chapter 11: Databases

28

1 Databases and the #eb 1

Chapter 11: Databases

29

1 Databases and the #eb 1

Chapter 11: Databases

30

1 Databases and the #eb 1 5TML forms can collect


data# as "ell as specifications for a ,uery

Chapter 11: Databases

31

1 Databases and the #eb 1 T e process of sending data to a database re,uires


se$eral data andoffs

Ser$er-side script

Chapter 11: Databases

32

1 $M% 1 Mar!up language t

at allo"s field tags# data# and tables to be incorporated into a 1eb document

Chapter 11: Databases

33

1 $M% 1 Language used to specify a standard structure of


fields and records Data in an 2ML document is searc able 2ML is portable# but not optimi'ed for many common database operations

Consider storing data in a relational database# managing it "it 4DBMS soft"are# and generating 2ML documents for e(c anging data o$er t e 1eb

Chapter 11: Databases

34

1 Section C: Database Design 1 Defining Fields


6ormali'ation &rgani'ing 4ecords Designing t e 3nterface Designing 4eport Templates Loading Data

Chapter 11: Databases

35

1 De ining Fields 1 T e term database structure refers to t

e arrangement of fields# tables# and relations ips in a database Brea! data into fields 0ust by using common sense and considering o" people mig t "ant to access t e data %se a primary !ey field to ma!e eac record uni,ue %se appropriate data types for eac field

Chapter 11: Databases

36

1 De ining Fields 1

Chapter 11: Databases

37

1 De ining Fields 1 A computed field is a calculation t

at a DBMS performs during processing and temporarily stores in a memory location %ppercase and lo"ercase are not al"ays treated t e same

Case sensiti$e database

%se field formats to s o" " at t e data is supposed to loo! li!e " en it7s entered %se field $alidation rules to filter data
Chapter 11: Databases 38

1 &ormali'ation 1 )rocess t at elps sa$e storage space and


increase processing efficiency

Minimi'es data redundancy

Chapter 11: Databases

39

1 (rgani'ing )ecords 1 4ecords can be organi'ed in different "ays#


depending on use Sorting

A table7s sort order refers to t e order in " ic records are stored on dis! Sort !ey Similar to t e inde( in a boo!

Database inde(

Chapter 11: Databases

40

1 (rgani'ing )ecords 1

Chapter 11: Databases

41

1 Designing the *nter ace 1 Arrange fields in a logical order


)ro$ide $isual clues to t e entry areas Entry areas s ould appear in a consistent position relati$e to t eir labels )ro$ide a ,uic! "ay to mo$e t roug t e fields in order

Chapter 11: Databases

42

1 Designing the *nter ace 1 %se scrolling or create multiple screens# if


necessary )ro$ide buttons or ot er easy-to-use controls for mo$ing from one record to anot er Supply on-screen instructions

Chapter 11: Databases

43

1 Designing the *nter ace 1

Chapter 11: Databases

44

1 Designing )eport Templates 1 4eport generators are


used to specify t e content and format for a database report A report template contains t e outline or general specifications for a report

Chapter 11: Databases

45

1 Designing )eport Templates 1 Supply only t e information re,uired


)resent information in a usable format 3nformation s ould be timely 3nformation s ould be presented in a clear# unambiguous format )resent information in t e most appropriate format for t e audience

Chapter 11: Databases

46

1 %oading Data 1 Data can be loaded into a database by:


%sing generic data entry tools %sing a customi'ed data entry module

A con$ersion routine con$erts t e data from its current format into a format t at can be automatically incorporated into t e ne" database

Chapter 11: Databases

47

1 Section D: S+% 1 SQL Basics


Adding 4ecords Searc ing for 3nformation %pdating Fields 8oining Tables

Chapter 11: Databases

48

1 S+% Basics 1 3ntermediary bet"een


t e database client soft"are and t e database itself

Chapter 11: Databases

49

1 S+% Basics 1

Chapter 11: Databases

50

1 Adding )ecords 1

Chapter 11: Databases

51

1 Searching or *n ormation 1SELECT Album# AlbumCo$er F4&M Albums


15E4E Artist 9 :8efferson Airplane7 T e A6D# &4# and 6&T Boolean operators are used to perform comple( ,ueries T e use of parent eses indicates t e part of t e ,uery to perform first

Chapter 11: Databases

52

1 ,pdating Fields 1%)DATE Albums


SET 3nStoc! 9 3nStoc! ; < 15E4E Album 9 :=/3/ Blues7 =lobal updates c ange t e data in more t an one record at a time

1or!s only for records "it similar c aracteristics

Chapter 11: Databases

53

1 -oining Tables 1 8oining tables in SQL allo"s you to create


relations ips bet"een tables

Chapter 11: Databases

54

1 -oining Tables 1

Chapter 11: Databases

55

1 Section .: Database Securit" 1 Database .ulnerabilities


Database Security Measures Database Security 4egulations 1 at 3ndi$iduals Can Do

Chapter 11: Databases

56

1 Database /ulnerabilities 1 Databases are $ulnerable to p ysical t eft#


and unaut ori'ed access

ac!ing#

Databases can be stolen "it out going missing

T ere is ardly a person in America " o is not in at least one computer database

)ri$acy is $ie"ed as an in erent rig t 3mportance of data accuracy Data s ould be !ept secure

Chapter 11: Databases

57

1 Database Securit" Measures 1 Today7s computers are under assault from ac!ers
and natural disasters Security measures include encryption# access controls# data security policies# and intrusion monitoring Encryption can ma!e data in a database unintelligible to a ac!er T e process of decrypting database information in response to a ,uery typically increases t e amount of time necessary to process eac ,uery
Chapter 11: Databases 58

1 Database Securit" Measures 1 An access control limits access to systems# suc as


computer databases

Control " o accesses t e database Control o" users interact "it t e database

%ser pri$ileges Data $ie"

Chapter 11: Databases

59

1 Database Securit" Measures 1 To minimi'e $ulnerabilities


caused by employee inattention# organi'ations can formulate database use policies A database audit is a procedure t at monitors and records user acti$ity "it in a database

Chapter 11: Databases

60

1 Database Securit" )egulations 1 3nternational e-commerce ma!es database security


a global concern> many countries a$e enacted la"s to protect personal data stored on databases

European %nion7s )ri$acy Directi$e Canada7s )ersonal 3nformation )rotection and Electronics Document Act %/S/ )ri$acy Act of <?@A %SA )AT43&T Act .ideo )ri$acy )rotection Act 5ealt 3nsurance )ortability and Accountability Act <??B =ramm-Leac -Bliley Act <???
61

Chapter 11: Databases

1 #hat *ndi0iduals Can Do 1 T e !ey to minimi'ing your ris! is to be $igilant about t e


information you di$ulge

Cno" " en data is being collected Find out o" data is being used Find out " at data is retained Supply only t e data t at is re,uired &pt-out " en possible )rotect your pass"ords Don7t trade your pri$acy %se anti$irus soft"are Do not reply to spam Before registering# c ec! t e site7s pri$acy policy
62

Chapter 11: Databases

1 #hat *ndi0iduals Can Do 1

Chapter 11: Databases

63

Chapter 11 Complete Computer Concepts 2014