Presentation is loading. Please wait.

Presentation is loading. Please wait.

11 INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI.

Similar presentations


Presentation on theme: "11 INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI."— Presentation transcript:

1 11 INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI

2 2 IN THIS PRESENTATION.. Data vs information Database organization file, record, attribute/field DBMS activities and functions DBMS components Importance of databases

3 3 DATA VS INFORMATION

4 4 DEFINING DATA AND INFORMATION Data: Data consists of raw facts e.g. 298-2034 Information: Data presented in a context e.g. someone’s phone# Some more examples: a) IS340 a) IS340 is a core course for BBA. b) Joan Smith b) Joan Smith is an arts & sciences student c) Score was 94-72 c) Score in the Celtics-Bulls game was 94-72.

5 5 DATA IS NOT USUALLY ISOLATED Example information about a person Name: Steve Nash DOB: 2-4-1965 Profession: Basket ball player Address: 415 Walnut street. These describe a person more. They are called ????.

6 6 ANOTHER EXAMPLE Example information about a credit card transaction: Date: 12/5/08 Time: 4:48 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank These describe a transaction more.

7 7 ONE ATTRIBUTE HAS A UNIQUE VALUE One of these is always unique: Acct#: 4555950 Date: 12/5/08 Time: 4:48 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank The unique attribute is called ???

8 8 CHARACTERISTICS OF DATA/ INFORMATION WHAT CAN WE SAY ABOUT THE TWO TYPES OF DATA? Transaction#: 55643 Date: 12/5/08 Time: 4:08 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank Transaction#: 55644 Date: 12/5/08 Time: 4:20 pm Merchant: Vitales Card type: Master Card Issuer: Midwest Bank

9 9 CHARACTERISTICS OF DATA/ INFORMATION… Transaction ID Transaction Date Transaction Time Merchant 5564312/05/084:08 pmWIU Union 5564412/05/084:20 pmVitales Data is typically organized into ?? Transaction#: 55643 Date: 12/5/08 Time: 4:08 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank

10 10 Transaction ID Transaction Date Transaction Time Merchant 5564312/05/084:08 pmWIU Union 5564412/05/084:20 pmVitales HISTORICAL APPROACH TO DATA 55643 12/05/08 4:08pm WIU Union 55644 12/05/08 4:20pm Vitales 55646 01/07/09 8:05am Pizza Hut 55643 $25.60 MasterCard 55644 $38.00 Visa 55644 $63.00 Visa 55646 $55.00 American Express This is called ___________ __________.

11 11 FILE PROCESSING PROBLEMS What problems did the file processing approach result in?

12 12 DATABASE ORGANIZATION

13 13  Database - Organized collection of information  DBMS - SW program to manage and provide controlled access to the data DEFINITIONS

14 14 Database – A group of related files File/table – A group of related records Record – a grouping of related fields Field – a grouping of characters (one row) Schema -- This is the logical view of the database (tables and fields) Primary key – An attribute whose values are unique within a file Database Files/tables Records Fields DBMS ORGANIZATION

15 15 Primary key Record Attr. values Attributes/field names Structure/schema DBMS ORGANIZATION PROD#DESCR.PRICEQUANTITY IR888ERefrigerator$1,80020 TS3233Television$6732 Record

16 16 DBMS ACTIVITIES

17 17 DBMS ACTIVITIES & FUNCTIONS Define structure / schema Enter data modify data query data get reports Activities with DBMS

18 18 Define structure/schema DBMS ACTIVITIES & FUNCTIONS Field NameData typeDescriptionLengthDecimals Prod#NumericUnique prod code 60 DescrTextShort prod description 250 PriceCurrencyProduct price62

19 19 Enter data -- Create a data entry form PRODUCT DATA ENTRY Product #: Description: Label Field Heading Data entry form DBMS ACTIVITIES & FUNCTIONS

20 20 DBMS ACTIVITIES & FUNCTIONS u Add u Delete u Change Modify data Records/field values

21 21 Query data list products costing more than $2,000 Query by example form DBMS ACTIVITIES & FUNCTIONS

22 22 RH PH Detail Fields PF RF PRODUCT LISTING PRODUCT #DESCR.PRICE Product # Descr.Price Average Price Title Column Headings Footer A report specification

23 23 GETTING DATA OUT.. PRODUCT LISTING PROD# DESCRIPTION PRICE M100 Chair $ 50.00 M150 Table $200.00 Average Price $153.00 A generated report

24 24  Activities with DBMS ◦ Define structure / schema ◦ Enter data ◦ modify data ◦ query data ◦ get reports è DBMS components

25 D B M S Kernel Major Components of DBMS Export/Import Data Defn. Data Defn. SQL Prog. Language Interface Prog. Language Interface Data Diction- ary Data Diction- ary Screen/ Report Gen. Screen/ Report Gen. Appln. Gen. Appln. Gen.

26 DBMS COMPONENTS.. Data definition – the facility through which schema is defined. (how new tables are created). SQL interface – the facility through which SQL commands are typed in. Programming language interface – the facility which processes SQL commands embedded in application program. Also known as the host language interface. Data dictionary – the facility that records details about the schema, reports, data entry forms etc. Screen & reports- the facility through which data entry screens and reports are created. Appln. Generation- the facility through which applications are created. Export/Import -- the facility through which files can be imported/exported in different DBMS formats. DBMS Kernel -- the actual programs which interact with the O/S and carry out data I/O.

27 27 Suppose we have detailed information on each and every transaction in a store, what can we do with that? What if a customer wants to return a shirt purchased in the store? What if a manager wants to know what products were sold on a particular day? USAGE OF DATA/INFORMATION

28 28  To store and record information e.g. bal, price, grades etc.  To retrieve information e.g. check#432 cashed?  To report information e.g. daily sales  To answer queries e.g. how many shoes were sold? IMPORTANCE OF DBMS’s Databases are used:  To analyze trends  Identify sales prospects Advanced uses:

29 29 INTRO TO DATABASES - II IS 340 BY CHANDRA S. AMARAVADI

30 30 DBMS EVOLUTION

31 31 EVOLUTION OF DBMS File processing systems Hierarchical systems Relational systems 1 March 2002 Greece 2 July 2003 Italy 3 …………….. Person Photo1Photo2 GreeceItaly PhotoId

32 32 EVOLUTION OF DBMS.. FILE PROCESSING SYSTEMS:  Data in the form of “flat files” (ascii files)  Each program had its own specific files  Data was duplicated across files. A system where data was managed by the program in the form of flat files.

33 33 EVOLUTION OF DBMS.. PROBLEMS CAUSED BY FILE PROCESSING l Uncontrolled redundancy l Poor data quality (a.k.a.?) l Lack of data sharing

34 34 HIERARCHICAL MODEL.. l Structure is hierarchical (not flat) l There are one or more root segments l segments are linked hierarchically l Difficult to write queries but very efficient (fast)!

35 35 HIERARCHICAL MODEL NAMETOTAL_ENROLLNO_OF_PHD ASNAMEJOB_TITLEFNAMERANKDEGREE (D) DEPARTMENT (A) ADMIN-STAFF(F) FACULTY What do you call this?

36 36 Data organized into tables Data retrieved by using SQL, 4 th GL joins tables by equating values of cross reference keys. RELATIONAL MODEL 8895 Smith 4/16/90 $35,000 8896 Farley 4/22/91 $300 8897 Gomez 1/10/00 $2,000 ACCT ACCT# NAME DT. OPENED BALANCE

37 37 THE DATABASE DEVELOPMENT APPROACH

38 38 cust. empl. prod Organization Entity classes Data model File 2 File 1 Data base

39 39 THE DATABASE CONCEPT.. u Organizations need to collect and manage information. u Typically this need can be summarized in terms of entity classes and their relationships u Known as a (conceptual) data model/ER model u ER model is converted to database model u Implemented

40 40 u Integrated conceptualization u Convert it to design u Go through development process u Different users/programs can share the information easily u Can access info via SQL u Can get reports easily Database DBMS Prog. 2Prog. 1

41 41 CUSTOMER ACCTS.LOANS CROSS REFERENCE REPORT ACCT. DATALOAN DATA GETTING INFORMATION FROM FILE PROCESSING

42 42 GETTING INFORMATION FROM A DATABASE ACCT# NAME DT. OPENED BALANCE 8895 Smith 4/16/90 $35,000 8896 Farley 4/22/91 $300 8897 Gomez 1/10/00 $2,000 ACCT LID AMOUNT INT. RATE BALANCE LOAN 9978 $6,000 6.0% $2,440 9978 $5,000 7.1% $5,000 9992 $1,000 8.5% $ 400 How can We combine these two Tables?

43 43 DATA MODELS

44 44 DATA MODELS -- BASIC CONCEPTS Data models: representations of relationships among entity classes Entity – Individual example of person, place or thing. Entity Class – Collection of related entities (eclass). Attributes – Properties of entity classes about which we would like to collect information. Primary key -- An attribute whose values are unique within an entity class (pkey).

45 45 DISCUSSION u San Francisco u Tires u Customer u Book u ISBN# u Neon u Peoplesoft u Cust. balance u Microsoft u Microsoft employees u Date of Birth u Invoice Classify the following as entity, entity class or attribute

46 46 DATA MODELS… Cardinality: Number of entities participating in a relationship A B 1:1 A B 1:M A B M:N For each value of A, one and only one value of B and vice versa. For each value of A, multiple values of B, but for each B only one A. For each value of A, many values of B and vice versa.

47 47 DISCUSSION Identify the types of the following relationships l company -- president l instructor -- students l plane -- pilots l city -- convention centers l department -- employees l team -- players l company -- city l books – authors l city -- subdivisions l product -- warranty

48 48 AN EXAMPLE ER CHART CUSTOMER ORDERS Places Cust#Name PRODUCTSAre for ENTITY CLASS ATTRIBUTE RELATIONSHIP Ord# Ord dt

49 49 Draw Data Models (ER models) corresponding to the following Situations: Students take courses from professors Clients can book one or more properties with a rental agency. Each property can be booked by more than one client (for different dates). Trains arrive and depart from platforms in train stations, corresponding to the cities that they stop in. A city can have many Stations. Airlines operate a number of flights which arrive and depart from Gates. There could be several flights from a gate, but each flight is assigned only one gate. Each airline operates a gate or a set of Gates which are leased to them by the airport. DISCUSSION

50 50 Design a database for the following situation: Bellsouth, a telephone company needs a database to maintain records of its automobiles, repairs, mechanics and special equipment needed to repair cars. Mechanics are assigned skill codes based on the type of repairs they can carry out. For e.g. Class III mechanics can perform reborings, engine overhauls and transmission repairs. The repair shops are located in 300 cities and towns throughout the state. Mechanics can be assigned to only one repair shop at a time. The application requires knowing what equipment is (for e.g. diagnostic equipment, hydraulic machinery) is at what location and also the repairs carried out on each vehicle. For each vehicle the application requires knowing its identification number, mileage and repair history. DISCUSSION

51 51 DISTRIBUTED AND MULTI-MEDIA DATABASES, DATA WAREHOUSES

52 52 CENTRALIZED DATABASES u The database is in one physical location. u All applications regardless of whether the clients are located in Seoul or Detroit need to access data from that physical location. u What are the limitations? Centralized databases

53 53 DISTRIBUTED DATABASES u Replicated -- copies of the database maintained in multiple sites u Partitioned -- database is physically divided into chunks The data is physically stored in multiple geographical locations

54 54 REPLICATED DATABASES..

55 55 PARTITIONED DATABASES.. Emp IDEmp Name 11049 Cathy 200 Meadowbrook Emp Address 11051 Richard 13 E. Willow 11054 Hugh 1400 E. Washington ……. …….. …………………..

56 56 PARTITIONED DATABASES u The database is divided into chunks. u What is the logical way of doing this? u Different chunks are placed in different locations. u All the locations are connected. u What are the advantages and limitations? The database is in multiple physical locations

57 57 MULTI-MEDIA DATABASES Emp IDEmp Name Emp. Picture Emp Address A database that is able to handle multiple data types: u Conventional information u Images u Audio & video Capable of storing, retrieving and updating this type of information Emp.jpg

58 58 MULTI-MEDIA DATABASES.. APPLICATIONS u Travel bureaus u Hospitals u Manufacturing u Training

59 59 MULTI-MEDIA DATABASES.. u Storage space u Retrieval u Modification ISSUES

60 60 u DATA WAREHOUSE: Historical data organized for analysis and decision making. u DATA MART: smaller version of data warehouse, specialized by functional area e.g. marketing n ON-LINE ANALYTICAL PROCESSING (OLAP): organizes data into a “cube” for decision analysis. DATA WAREHOUSES

61 61 HISTORICAL INFORMATION INTERNAL DATA SOURCES EXTERNAL DATA SOURCES OPERATIONAL, HISTORICAL DATA DATA WAREHOUSE EXTRACT, TRANSFORM OLAP DATA MINING DATA WAREHOUSING & OLAP

62 62 DISCUSSION QUESTIONS n Are Databases and DBMSs one and the same? n Does a record consist of files? n What is the smallest unit of data in the database? n Does data integrity refer to data quality? n What does the detail line of a report consist of? n Is an “employee” an entity class or an attribute? n Is the data dictionary useful while creating the database? n Why do we use SQL? n Is it necessary to use SQL to produce database reports? n If we have a number of diskettes in alphabetical sequence, is this an example of a file organization? If so, what type? n Would multi-national organizations prefer centralized databases?

63 63 THAT’S ALL FOLKS!

64 64 THAT’S ALL FOLKS!

65 65 THAT’S ALL FOLKS!


Download ppt "11 INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI."

Similar presentations


Ads by Google