+ All Categories
Home > Documents > Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22...

Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22...

Date post: 26-Mar-2015
Category:
Upload: anthony-mcgregor
View: 216 times
Download: 1 times
Share this document with a friend
Popular Tags:
46
Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University [email protected]
Transcript
Page 1: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

Introduction to Database

Development (1)IS 240 – Database Management

Lecture #3 – 2004-01-22Prof. M. E. Kabay, PhD, CISSP

Norwich University

[email protected]

Page 2: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

2 Copyright © 2004 M. E. Kabay. All rights reserved.

Topics: Kroenke Chapter 2

DatabaseDBMSCreating a DBApplication ComponentsDB DevelopmentHomework

Page 3: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

3 Copyright © 2004 M. E. Kabay. All rights reserved.

Database: Types of Data

User Data: information we care aboutMetadata: information about the data Indexes: information for fast access to dataApplication Metadata: information for

showing and using data

Page 4: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

4 Copyright © 2004 M. E. Kabay. All rights reserved.

Types: User Data

Your student information: Student_name Student_ID Student_home_address Student_residence_address Student_residence_address_term Student_grad_year Student_major Student_major_year Course_number Course_term Course_title Course_instructor Course_credits Course_grade . . . .

Page 5: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

5 Copyright © 2004 M. E. Kabay. All rights reserved.

Types: User Data

How to group data effectively to represent course information?

1. One big record: Student_id, student_home_address, student_major, course_term, . . . .

2. A record for student-specific info +a record for residence info + a record for course-specific info +linkages (relationships)

Student_name, Student_ID, Student_home_address. . . .

Student_ID, Student_residence_address, Student_residence_address_term

Student_ID, Course_number, Course_term, Course_grade. . . .

Course_number, Course_term, Course_title, Course_instructor, Course_credits

. . . . .

Page 6: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

6 Copyright © 2004 M. E. Kabay. All rights reserved.

User Data

Examples from instructor’s own simple databasesTODO – keeps track of things to doIYIR – keeps abstracts of security events

Page 7: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

7 Copyright © 2004 M. E. Kabay. All rights reserved.

(User data: TODO)

Page 8: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

8 Copyright © 2004 M. E. Kabay. All rights reserved.

(User data: IYIR)

Page 9: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

9 Copyright © 2004 M. E. Kabay. All rights reserved.

User Data Relationships

First impressions of data requirements are usually too simple for realistic applications

Think about what can change – may need to create records to keep track of history; e.g., ____?

Think about relationships among data Relationships among data may be

1:1 (one-to-one); e.g., _____?1:n (one-to-many) ; e.g., _____?n:n (many-to-many) ; e.g., _____?

Bad designs lead to duplication, trouble in updatesNormalization (to be studied later) provides

systematic method for sorting out data into records with minimal trouble

Page 10: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

10 Copyright © 2004 M. E. Kabay. All rights reserved.

Types

MetadataInformation about the data and their

relationshipsApplication Metadata

Forms, reportsVaries among products

Page 11: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

11 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: TODO)

Page 12: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

12 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: TODO)

Page 13: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

13 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: IYIR)

Page 14: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

14 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: IYIR)

Page 15: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

15 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: IYIR)

Page 16: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

16 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: IYIR)

Page 17: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

17 Copyright © 2004 M. E. Kabay. All rights reserved.

(Metadata: IYIR)

Page 18: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

18 Copyright © 2004 M. E. Kabay. All rights reserved.

(Forms)

Page 19: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

19 Copyright © 2004 M. E. Kabay. All rights reserved.

(Forms)

Page 20: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

20 Copyright © 2004 M. E. Kabay. All rights reserved.

(Forms)

Page 21: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

21 Copyright © 2004 M. E. Kabay. All rights reserved.

(Reports)

Page 22: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

22 Copyright © 2004 M. E. Kabay. All rights reserved.

(Reports)

Page 23: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

23 Copyright © 2004 M. E. Kabay. All rights reserved.

(Reports)

Page 24: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

24 Copyright © 2004 M. E. Kabay. All rights reserved.

Types: Indexes

Large databases can contain millions of records

Without index, need to search all recordsCan take seconds, minutes or hoursAll depends on speed of I/O:

Page 25: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

25 Copyright © 2004 M. E. Kabay. All rights reserved.

DBMS

Design ToolsRun-TimeDBMS Engine

Page 26: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

26 Copyright © 2004 M. E. Kabay. All rights reserved.

DBMS: Design Tools

Page 27: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

27 Copyright © 2004 M. E. Kabay. All rights reserved.

DBMS: Run-Time

Infrastructure that “runs” the databaseHandles designer/user requests for

database changes, data input/outputHandles all the details of opening,

accessing, modifying informationReads structure metadata to interpret

linkagesReads form metadata to represent

information readablyProduces and prints reports automatically

Page 28: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

28 Copyright © 2004 M. E. Kabay. All rights reserved.

DBMS: DBMS Engine

Turns instructions from DBMS run-time components into instructions to operating systemTranslates dataset names into file namesHandles file I/OHandles transactionsManages locking of resources

Communicates with other OS subsystemsInput devices – keyboards, mouseDisplay units – screensSpooler – sends print output to printer

Page 29: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

29 Copyright © 2004 M. E. Kabay. All rights reserved.

Creating a DB

SchemaTablesRelationships

Page 30: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

30 Copyright © 2004 M. E. Kabay. All rights reserved.

Creating a DB: Schema

Define all aspects of the needed dataSpecify names of

Fields (columns)Records (table rows)

Decide on domains for every fieldPhysical format (length, types)Allowable valuesEmpty(null) allowed?Unique?

Define relations (links) among tables

Page 31: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

31 Copyright © 2004 M. E. Kabay. All rights reserved.

Creating a DB: Tables

Turn specifications into real tablesDBMS automatically handles details

Page 32: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

32 Copyright © 2004 M. E. Kabay. All rights reserved.

Creating a DB: Relationships

Specify how to link tablesRequires common fieldsSpecify type of relationship

1:11:nm:n

Page 33: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

33 Copyright © 2004 M. E. Kabay. All rights reserved.

Application Components

Will study details laterFormsQueriesReportsMenusPrograms

Page 34: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

34 Copyright © 2004 M. E. Kabay. All rights reserved.

Forms

Show data in different ways for different functionsLookupData entryData management (modification)

Many different forms can exist in a single DBCan define fields that have different

characteristicsRead-onlySpecific input-values only

Generate specific error messages or confirmations

Page 35: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

35 Copyright © 2004 M. E. Kabay. All rights reserved.

QueriesAsk questions about data

Planned – stored queriesAd hoc – defined on the spot

Various methodsSQL – Structured Query Language

Sometimes pronounced “sequel”Often pronounced “S – Q – L”

Visual methods – drag and dropQuery-by-example (QBE) – specify

requirements, then store queryQuery-by-form – designer supplies form,

user inputs specific data

Page 36: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

36 Copyright © 2004 M. E. Kabay. All rights reserved.

Reports

Formatted output for printersTypical banded structure

Report headerPage headerDetailPage footerReport footer

Many different report structures can be named and stored for a single DB

Page 37: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

37 Copyright © 2004 M. E. Kabay. All rights reserved.

Menus

Windows / Mac visual interface has made drop-down menus familiar

Can create application-specific menusProvide shortcut-keys if desiredMenus can change from stage to stage of

user’s progress through application program

Page 38: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

38 Copyright © 2004 M. E. Kabay. All rights reserved.

Programs

DBMS usually include facilities for special controls (programs)Can define actions for anything that can be

specified in syntax of programming language for DBMS

Often highly portable across platforms as long as same DBMS used

Can also write standalone programs that access database files in various languagesNeed application program interface (API)May not be easily portable from platform to

platform

Page 39: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

39 Copyright © 2004 M. E. Kabay. All rights reserved.

DB Development

PrototypesTop-down design/developmentBottom-up design/developmentData modeling

Page 40: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

40 Copyright © 2004 M. E. Kabay. All rights reserved.

Development: Prototypes

SDLC (System Development Life Cycle)AnalysisSpecificationsDesignCodingTestingDocumentationImplementation

Sometimes takes too longCode is out of date by time it’s

implemented

Page 41: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

41 Copyright © 2004 M. E. Kabay. All rights reserved.

Development: Prototypes

Rapid Application Development (RAD)Joint Application Development (JAD)

Show user mockup of applicationHelps to improve communications among

users, analysts, programmers, trainersModern DBMS ideal for prototyping

Easy forms & reports for I/OCan include constraints easily and write

good error messages quicklyWrite one to throw away: learn from mistakes

Page 42: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

42 Copyright © 2004 M. E. Kabay. All rights reserved.

Development: Top-down Design/Development

Thorough analysis of requirementsPlan carefully, looking at strategic issues

firstDevelop data models of ever-more detail

AdvantagesReduce wasted effort, rewriting of codeExpandable to new requirements because

of systematic understandingDisadvantages

Slow to reach production codeMay be inflexible in rapidly-changing area

Page 43: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

43 Copyright © 2004 M. E. Kabay. All rights reserved.

Development: Bottom-up Design/DevelopmentStart with specific project

Often small-scaleConsistent with RAD/JADBuild up from existing project by adding

others as requiredAdvantages

Can be rapid to meet needsConsistent with Pareto Principle: meet 80% of

needs with first 20% of developmentDisadvantages

Can lead to false starts, reworking, difficult integration of different systems

Page 44: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

44 Copyright © 2004 M. E. Kabay. All rights reserved.

Development: Data Modeling

Complex, sophisticated processObserve what people do as well as what they

say about their information needsUsers do not know how to represent data

in data structuresHave to see what they need to construct

modelsBut what they do now may not be the best

for them – limited by current toolsGood communications skills essential

Page 45: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

45 Copyright © 2004 M. E. Kabay. All rights reserved.

Homework

Reread Chapter Two of Kroenke using Read-Recite-Review

For Thu the 29th of January 2004Answer questions 2.1 through 2.21 in

writingFor Tue the 27th

Prepare for lab work on by running MS-ACCESS on a lab computer (or your own)

Finish Ferrett et al Projects #1 & #2Look ahead to Ferrett Projects #3 & #4

Page 46: Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – 2004-01-22 Prof. M. E. Kabay, PhD, CISSP Norwich University mkabay@norwich.edu.

46 Copyright © 2004 M. E. Kabay. All rights reserved.

DISCUSSION


Recommended