Presentation is loading. Please wait.

Presentation is loading. Please wait.

Foundations of Relational Implementation (1) IS 240 – Database Management Lecture #13 – 2004-04-01 Prof. M. E. Kabay, PhD, CISSP Norwich University

Similar presentations


Presentation on theme: "Foundations of Relational Implementation (1) IS 240 – Database Management Lecture #13 – 2004-04-01 Prof. M. E. Kabay, PhD, CISSP Norwich University"— Presentation transcript:

1 Foundations of Relational Implementation (1) IS 240 – Database Management Lecture #13 – Prof. M. E. Kabay, PhD, CISSP Norwich University

2 2 Copyright © 2004 M. E. Kabay. All rights reserved. Topics Review of Relational Terminology Define DB Using DDL Allocate Disk Space Plan for Maintenance Loading the DB DML Interfaces

3 3 Copyright © 2004 M. E. Kabay. All rights reserved. Review of Relational Terminology Relation / table / file / dataset Tuple / row / record / entry Attribute / column / field Domain Uniqueness

4 4 Copyright © 2004 M. E. Kabay. All rights reserved. Key – Two Meanings Design: unique identifier(s) of row Implementation: performance tool Logical key: unique identifier Physical key: column with an index for faster performance

5 5 Copyright © 2004 M. E. Kabay. All rights reserved. Indexes Kroenke reserves word key for logical key Uses word index for physical key Indexes are useful Find rows fast Retrieve rows in a sorted order Enforce uniqueness

6 6 Copyright © 2004 M. E. Kabay. All rights reserved. Example of Indexes in a Database Compare # I/Os required to read all the order #9890 Without index With index on OrdNo With packing* on index * 1 block

7 7 Copyright © 2004 M. E. Kabay. All rights reserved. Implementing RDB Having designed a DB using the relational model, theres no problem in defining a DB using todays DBMS products Use the Data Definition Language (DDL) of the DBMS Formalized language for describing what we need Varies a bit from DBMS to DBMS Easy to learn once youre mastered any one of them

8 8 Copyright © 2004 M. E. Kabay. All rights reserved. Define DB Using DDL Text-file (schema) DDL Specific syntax Name all the elements Name all the tables Name all the indexes and links Graphical systems MS-Access uses tables and also graphics Easy to define details using text Structures can be linked using graphics Menus provide guidance, limits

9 9 Copyright © 2004 M. E. Kabay. All rights reserved. Allocate Disk Space PC-based products generally allocate space dynamically DB grows as needed Dont have to worry about defining maximum size Mainframe / server DBs generally require size definitions Need to reserve space in advance Performance issues become important Multiple disk drives or controllers Try to avoid thrashing of disk heads

10 10 Copyright © 2004 M. E. Kabay. All rights reserved. DB Performance Issues Computer system performance always depends on 5 factors Access to & speed of CPU Access to & speed of RAM Amount & speed of disk I/O Communications speed Application design DB performance often affected by Presence / absence of indexes Good / bad packing of records Locking strategies (coming in later lecture)

11 11 Copyright © 2004 M. E. Kabay. All rights reserved. Plan for Maintenance Databases often central components of production systems Plan for Backups Diagnostics to find corrupted data Child records without parents Record counters that are incorrect Pointers to non-existent records Data that violate business rules Archiving inactive records Compaction of data files

12 12 Copyright © 2004 M. E. Kabay. All rights reserved. Loading the DB Have to get data somewhere Most DBs get historical data Older DBs Special programs written to read old DB, write into new DB with correct format Often get exceptions – write to exception file May have large-scale data entry from paper records – need careful verification Some critical systems use dual data entry Compare records

13 13 Copyright © 2004 M. E. Kabay. All rights reserved. Types of Data Manipulation Languages (DMLs) Relational algebra Relational calculus Transform-oriented languages Graphical interfaces

14 14 Copyright © 2004 M. E. Kabay. All rights reserved. Relational Algebra Operators function on records Union / intersection etc. Much like set theory Procedural language Step-by-step changes in collections of data Not used in commercial DBs Useful to understand as preparation for SQL Will study in next lesson

15 15 Copyright © 2004 M. E. Kabay. All rights reserved. Relational Calculus Non-procedural theoretical framework for dealing with relations E.g., De Morgan's law, The complement of a union is equal to the union of the complements." Learned in mathematics and advanced theory of programming and data structures Not used in commercial DB processing Not part of this course

16 16 Copyright © 2004 M. E. Kabay. All rights reserved. Transform-Oriented Languages Non-procedural Change relations into a single relation Thus define conditions for selecting records and end up with a set of records that satisfy the conditions SQL is most important example of this kind of language Will study in detail in this course

17 17 Copyright © 2004 M. E. Kabay. All rights reserved. Graphical Interfaces (1) Query-by-Example (QBE) User sees place to enter specific values or ranges Generates SQL without bothering user

18 18 Copyright © 2004 M. E. Kabay. All rights reserved. Graphical Interfaces (2) Query-by-Form (QBF) Allows more complex queries Still generates underlying SQL

19 19 Copyright © 2004 M. E. Kabay. All rights reserved. DML Interfaces to the DBMS Forms (e.g., in MS-Access) Query languages (e.g., SQL) Stored procedures (incl. triggers) API = application program interface

20 20 Copyright © 2004 M. E. Kabay. All rights reserved. Homework For Thu 8 April 2004: REQUIRED Reread chapter 8, pp thoroughly using Read-Recite-Review phases of SQ3R Do exercises for 34 points For next Tuesday: Read onwards in chapter 8 from page 221 through 231 Continue working on MS-Access lab work

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


Download ppt "Foundations of Relational Implementation (1) IS 240 – Database Management Lecture #13 – 2004-04-01 Prof. M. E. Kabay, PhD, CISSP Norwich University"

Similar presentations


Ads by Google