55
Files and Databases How Do You Organize Information? Chapter 8

Files and Databases How Do You Organize Information? Chapter 8

  • View
    222

  • Download
    1

Embed Size (px)

Citation preview

Files and Databases

How Do You Organize Information?

Chapter 8

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -2

Objectives

1 Understand the difference between data and information when working with databases.

2. Describe the basic concepts of database structures and organization and identify the various types of database models..

3. Define the basic characteristics of a relational database.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -3

Objectives cont.

4. Identify and use the many features of a database management system (DBMS).

5. Describe how databases are used in business and e-commerce.

6. Effectively manage files on your own computer.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -4

A:// Managing Information

• Data– Distinct items– Don't have much meaning to you in a given

context

• Information– Organized data– Meaning is clear and useful to you in a given

context

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -5

Database Structures & Organization

• Database– Stores data– Organizes data

• Data files– Files that contain organized data destined

for use in a database– Files use specific structures

A database is like an electronic ___ ____!

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -6

Structures & Organization

• Data structures organize data in a uniform manner

• Databases can be automatically reorganized to produce requested information

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -7

Organization

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -8

Structures

• Field – smallest piece of meaningful information

• Field names – describes what's in a field

• Property – type of data in a field

• Record – a complete data entry

• Entity – distinct item in a database

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -9

Data Structure

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -10

Making the GradeSection A: //

1. To store and organize data you use a __________.

2. A __________ is the smallest piece of meaningful data.

3. The type of data in a field is its ________.

4. To organize data in a meaningful manner you use __________.

5. A distinct item in a database is an _______.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -11

B:// Databases

• Hierarchical

• Network

• Relational

• Object-oriented

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -12

Hierarchical Databases

• Uses an inverted directory tree structure• Organizes data under different directories• Parent directories are the main directories

- similar to a folder– Children subdirectories can have only one

parent– Records belonging to a directory are children

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -13

Network Databases

• Similar to hierarchical databases– Uses a tree structure

• Children can have more than one parent

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -14

Object-Oriented Databases

• Becoming popular

• Uses objects to represent entities rather than fields in a table– Object is one item that contains distinct

information– Each object has its own properties or

attributes

• Similar objects belong to the same class

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -15

Object-Oriented Database

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -16

Relational Databases

• Most popular– Microsoft Access– Oracle– Sybase– DB2– FileMaker

• Stores data in tables that have rows & columns

• Tables are organized collection of records

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -17

Customers in a Relational Database

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -18

Relationships

CAROWNER HAS HAS

This entity relationship represents the statement "each owner has a car."

Relationships are association between database entities

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -19

Working with a Relational Database

• Relational database relies on associations or relationships between tables

• Three types of relationships One-to-one One-to-many Many-to-many

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -20

Relationships

CAR OWNER

OWNER

DEPT

CAR CAR

One-to-One One-to-Many Many-to-Many

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -21

Organizing & Structuring DataRelational Database

• Primary key– Field that is specific to only one record in a

table

• Compound primary key– Occurs when two or more fields identify a

distinct record

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -22

Making the GradeSection B: //

1. A ____________ uses a tree structure similar to the hierarchical database.

2. ___________ store data in tables that have rows and columns and are the most used databases.

3. To link tables you must establish a ____ between them.

4. A field specific to each record in a table is called the __________.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -23

C:// Database Management

• Database management system (DBMS)– Application software– Allows you to arrange, modify, and extract

data from a database

• DBMS work on everything from PDAs to large mainframes

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -24

DBMS Features

• Storage• Retrieval• Organization• Distribution

• Assimilation• Integrity • Security• Queries

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -25

Queries

• Asks questions of a database

• Query language uses English statements to extract data

• SQL (Structured Query Language) is the default for most databases– SELECT Name, Address, Phone FROM

"cars.dat" WHERE Purchased <=1995

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -26

DBMSes Based on the Relational Model

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -27

I•BuyWhere Can I Buy Data Online?

• May need large amounts of data– May take a long time to find– Not readily available with Internet searches

• Data Brokers– Companies that search many databases– Use specialized software to meet requests

quickly– Generate reports and CD-ROMs

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -28

Database Management Applications

• Querying – asking questions Query-by-example (QBE) – allows you to

graphically represent what data you want to see

• Reports – displaying data

• Forms – makes it easier to add or delete data

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -29

Access Query-By-Example

Fields Tables Visible Fields in Query

Relationship – Tables & Primary Keys

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -30

Reports

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -31

Forms

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -32

I•Series InsightsEthics, Security & Privacy

• Databases – Store, modify, and access data– Can make a business more efficient

• Databases and privacy– Up to you to protect your personal data– You disclose information each time fill out

forms, surveys, etc.– Learn about your privacy rights

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -33

Making the GradeSection C: //

1. A __________ is application software that allows you to arrange, modify, and extract data to create information.

2. A __________ defines the basic organization of a database.

3. Database ___________ can be printed or made into Web pages.

4. Restricting database access for reading and updating data files is a part of ___________.

5. You use a specialized language called a ________ for extracting data from a database.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -34

D:// Databases In Electronic Commerce

• Business– Client/server network– DBAs (Database administrators)

• Web-enabled databases for the Internet

• Web search engines

• Web catalogs

• Web personalization

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -35

Web-Enabled Database

Web browser informs that XML has been

successful.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -36

Web Search Engine

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -37

Web Catalogs

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -38

Web Personalization

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -39

Making the Grade Section D:\\

1. __________ design, implement, and maintain database solutions to business challenges.

2. __________ databases access, modify, and present their information through a Web browser.

3. __________ is a software program that works between the database and the Web browser.

4. __________ uses database information to make your visit to a Web site unique.

5. ___________ tailors service and product offers to your buying habits.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -40

E:// Files

• Batch File• Binary File• Command File• Data File• Directory File

• Document File• Executable File• Image File• Object File• Spreadsheet File• Text File

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -41

File Management

• Need to access or open a file before you use it– Click on icon– Use an application

• Computer needs to know file location

• File management system controls how the computer organizes and keeps track of files

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -42

File Management SystemWindows Explorer

• Windows Explorer is a built-in file management system– Comes with Microsoft

Windows– Can see where files are

located on your computer– Can find out the type,

size, and date of each file– Can back-up files

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -43

File Management

• File allocation table (FAT)– File that stores information about the

physical location of every file on the hard drive

– Track used areas so files aren't overwritten

• Fragmentation– Reduces your hard disk's efficiency– Defragmentation programs reallocate file

space

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -44

File Compression

• File Compression shrinks a file

• Decompression returns it to its original size

• Compression software – files are sometimes called "zipped"

• Disk compression– Shrinks files on a hard disk– Creates an area for them– Automatically decompresses upon opening file

McGraw-Hill/Irwin Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

X - 45

Winzip Compression Utility

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -46

Making the GradeSection E:\\

1. A __________ coordinates how the computer organizes and keeps track of files.

2. ____________ slows as your hard disk fragments.

3. The __________ stores information about the physical location of every file on the computer’s hard disk.

4. As your computer moves and rewrites files your hard disk __________.

5. In order to use a compressed file, you need to __________ it back to its original size.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -47

F:// "Key" Key Terms

• access speed (p. 8.23)

• compressed file (p. 8.23)

• data (p. 8.2)• data file (p. 8.3) • database (p. 8.3)

• database administrator (DBA) (p. 8.17)

• defragmentation program (p. 8.23)

• field (p. 8.3)• field name (p. 8.3)• file management

system (p. 8.22)

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -48

Key Terms cont.

• hierarchical database (p. 8.5)

• information (p. 8.3)• middleware (p. 8.18)• network database

(p. 8.5)• object-oriented

database (p. 8.6)

• primary key (p. 8.8)• relational database

(p. 8.6)• table (p. 8.6)• unzipping (p. 8.24)

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -49

Frequently Asked Questions

• What is the difference between data and information?

• I thought Excel was a database program. What can Microsoft Access do for me?

• I am not quite sure why a primary key is used in a relational table. Please explain.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -50

FAQs cont.

• What is the role of a database administrator?

• What kind of software is middleware and how is it used?

• Help! There are so many file types. How can I tell which is which?

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -51

FAQs cont.

• I want to send a file as an e-mail attachment but the file is too big. What can I do?

• When would I use a disk compression utility?

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -52

Hands On ProjectsE-Commerce

• A personal portal integrates all of your information in one place. Design a portal for your school. What would you include for the school? What personalization would you offer for the students?

• Maybe your school already has a portal. If so, what changes would you make?

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -53

Hands On ProjectsOn the Web

• Suppose you decide to become a data broker:– Who would be your clients?– What type of data would be included in your

searches?– How will you conduct searches? What other

databases would you use?– What will you charge for your work? For

maintenance?

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -54

Hands On ProjectsEthics, Security & Privacy

• Many grocery stores now have cards that are used when purchases are made. – What information do you think is being

collected?– How is this information being used? – What do you feel about your personal

spending habits being monitored? – Should you be allowed to refuse a card and

still get store discounts.

McGraw-Hill/Irwin

Copyright 2002 by the McGraw-Hill Companies, Inc. All rights reserved.

8 -55

Hands On ProjectsGroup Activities

• Microsoft Access comes with some “ready made” databases. All you have to do is enter the data. Review the database templates in Access and decide which ones are useful to you. Select one and create it. Enter in some data and see how your database works. Try using the menu options and print a few reports.