DATABASES – I IS 524 Dr. Chandra Amaravadi.

Slides:



Advertisements
Similar presentations
Dr. Chandra Amaravadi Western Illinois University INTRO TO ENTERPRISE DATABASES - II.
Advertisements

Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
DATA, DATABASES, AND QUERIES Managing Data in Relational Databases CS1100Microsoft Access - Introduction1.
INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI.
INTRO TO ENTERPRISE DATABASES - I Dr. Chandra Amaravadi Western Illinois University 1.
11 INTRO TO DATABASES Part I IS 340 BY CHANDRA S. AMARAVADI.
DATABASE. A database is collection of information that is organized so that it can easily be accessed, managed and updated. It is also the collection.
Data-mining & Data As we used Excel that has capability to analyze data to find important information, the data-mining helps us to extract information.
1 INTRODUCTION TO DATABASE MANAGEMENT SYSTEM L E C T U R E
2005 SPRING CSMUIntroduction to Information Management1 Organizing Data John Sum Institute of Technology Management National Chung Hsing University.
DATABASE LOGICAL DESIGN - I Chandra S. Amaravadi 1.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Professor Michael J. Losacco CIS 1110 – Using Computers Database Management Chapter 9.
DataBase Management Systems Introduction to Database Technology EAK 362/2 MIS LECTURE 4 PART 1.
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
CISB113 Fundamentals of Information Systems Data Management.
Chapter 10 Database Management. Data and Information How are data and information related? p Fig Next processing data stored on disk Step.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
1 DATABASES – I IS 524 Dr. Chandra Amaravadi. 2 IN THIS PRESENTATION.. Importance of databases Real world concepts: entities, eclasses, attributes Data.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
© 2017 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
COP Introduction to Database Structures
Database Development Lifecycle
Introduction To DBMS.
IST 220 – Intro to Databases
Tutorial 3 Data Modelling.
IS 130 Information systems 1
INTRO TO ENTERPRISE DATABASES - I
Databases Chapter 16.
Introduction to Database Systems
Database Systems Chapter 3 1.
Information Systems Today: Managing in the Digital World
Introduction to Database
Introduction to Database
Chapter 1: Introduction
Fundamentals of Information Systems, Sixth Edition
Fundamentals & Ethics of Information Systems IS 201
Chapter Ten Managing a Database.
Chapter 12 Information Systems.
Exploring Microsoft Office Access
Fundamentals of Information Systems
Introduction to Database Systems
Chapter 4 Relational Databases
RELATIONAL DATABASE MODEL
Translation of ER-diagram into Relational Schema
Tools for Memory: Database Management Systems
Databases and Information Management
ORGANIZING DATA AND INFORMATION-II (Business & Data modeling)
From ER to Relational Model
Database Fundamentals
MIS2502: Data Analytics Relational Data Modeling
Databases and Information Management
Introduction to Customizing Reports in SAP
Chapter 1 Database Concepts.
Database Design Hacettepe University
Spreadsheets, Modelling & Databases
MIS2502: Data Analytics Relational Data Modeling
INFO/CSE 100, Spring 2006 Fluency in Information Technology
The ultimate in data organization
Chapter 1: Introduction
Chapter 1: Introduction
DATABASE TECHNOLOGIES
Chapter 3 Database Management
Chapter 1: Introduction
Summary Data Modeling SDLC What is Data Modeling
Introduction to Database
Chapter 1: Introduction
Information system analysis and design
Presentation transcript:

DATABASES – I IS 524 Dr. Chandra Amaravadi

IN THIS PRESENTATION.. Importance of databases Real world concepts: entities, eclasses, attributes Data model Organization concepts DBMS & DBMS activities and functions

NEED FOR DATABASES All organizations need to manage information A church needs to maintain information on donations A consulting company needs to manage its contacts A doctor needs to know if a patient is allergic to a particular medication. An airline exec needs to know occupancy on a flight. Information is the lifeblood of an organization.

NEED FOR DATABASES.. To get information when we need it, it needs organization. A database can be thought of as an organized collection of information. What is information used for? What is it about? Where does it orginate?

BASIC DATA CONCEPTS

REAL WORLD CONCEPTS Entities Entity Classes Attributes Data models Database approach/philosophy

ENTITIES Individual examples of things and objects are called entities. They are modelled only as a collection.

WE ARE MORE INTERESTED IN Eclasses has has Organization customers departments has eclasses has product Sales/vendor Organization deals with many eclasses

ENTITY CLASSES HAVE PROPERTIES Properties are called attributes customers Departments Dept. code, name, manager, budget machines/ parts Sales/vendors

DISCUSSION Classify the following as entity, entity class or attribute John (as a person) San Francisco (as name of a city) Customer Book Store# Customs Microsoft Microsoft employees The book “The Second Machine Age” Invoice Production

SUMMARY OF CONCEPTS Entity – Individual example of person, place or thing. Entity Class – Collection of related entities. Attributes – Properties of entity classes about which we would like to collect information. Eclasses & attributes are used in developing data models

DATA MODELS (ER MODELS) Abstract view of the data & relationships Captures relationships between eclasses Supports DB design & implementation Relationship between students and courses? between doctors and patients? between teams and players?

DATA MODELS… Three types of relationships among entity classes A B A B 1:1 For each value of A, one and only one value of B and vice versa. A B 1:M A For each value of A, many values of B, but for each B only one A. B M:N A B For each value of A, many values of B and vice versa.

DISCUSSION Identify the types of the following relationships Company -- president Instructor -- students Flights -- pilots City -- convention centers Club -- members Team – players (professional) Company -- city Books – authors Artists -- records

THE DATA BASE APPROACH Entity classes File 1 File 2 Organization cust. File 2 emp. Organization Data model Data base

BASIC ORGANIZATION CONCEPTS

BASIC ORGANIZATION CONCEPTS data vs information attribute primary key file record schema

DEFINING DATA Data: Data consists of raw facts e.g. 298-2034 USA 46 29 29 104 China 38 27 23 88 Russia 24 26 32 82 Great Britain 29 17 19 65 Germany 11 019 14 44 Japan 7 14 17 38 Australia 7 16 12 34 France 11 11 12 34 Are raw facts useful? meaningful?

INFORMATION Information: collection of facts, data presented in a context, elaboration of data. Country Gold Silver Bronze Total USA 46 29 104 China 38 27 23 88 Russia 24 26 32 82 Great Britain 17 19 65 Germany 11 14 44 Japan 7 Australia 16 12 35 France 34

INFORMATION AS A COLLECTION OF FACTS Name: Chris Nash DOB: 2-4-1965 Profession: Engineer Address: 415 Walnut street. Details describe a person more. They are called ______

NOTION OF A RECORD Collection of facts is called a ________ Acct#: 4555950 Date: 12/5/14 Time: 4:48 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank It is actually a collection of __________ values

ONE ATTRIBUTE HAS A UNIQUE VALUE Which of these has a unique value? Acct#: 4555950 Date: 12/5/14 Time: 4:48 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank The unique attribute is called ___________. 3300 3305 3313

ORGANIZATION OF DATA/ INFORMATION Transaction#: 55643 Date: 12/5/15 Time: 4:08 pm Merchant: Vitales Card type: Master Card Issuer: First Bank Transaction#: 55644 Date: 12/6/15 Time: 4:10 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank Observations about these two “units” of data?

TRADITIONAL CONCEPT OF A FILE Assume the following is stored somewhere, Western Illinois University strives to maintain a community which values academic excellence; institutional integrity; and justice, equity, and diversity. Such an environment is essential in fostering the intellectual growth and personal development of all students. Each member of the University community shares responsibility in maintaining conditions which support the University's purpose. The Code of Student Conduct is designed to provide basic guidelines to advance the University's mission as a premier educational institution. A traditional file is a collection of characters

CONCEPT OF A DATABASE FILE Transaction#: 55643 Date: 12/5/15 Time: 4:08 pm Merchant: Vitales Card type: Master Card Issuer: First Bank Transaction#: 55644 Date: 12/6/15 Time: 4:10 pm Merchant: WIU Union Card type: Master Card Issuer: First Bank Transaction ID Date Time Merchant 55643 12/05/15 4:08 pm Vitales 55644 12/06/15 4:10 pm WIU Union A database file consists of _________________ .

DATABASE ORGANIZATION Structure/schema Attributes/field names Primary key PROD# DESCR. PRICE QUANTITY IR888E Refrigerator $1,800 20 TS3233 Television $67 32 Record Record A database is organized into ______, _________ and _______. attr. values

DATABASE ORGANIZATION.. PRIMARY KEY (FYI) Also referred to as a key Every table should have one Generally short and a number Value should be unique in a table; in other words ____ ? Can be one attribute or a combination listed as left most attribute E.g. SS#, id#, vin#, isbn#

DATABASE ORGANIZATION Database – A group of related files; collection of information File/table – A group of related records Record – a grouping of related field values Attribute – property e.g. hair color Schema -- This is the logical view of the database (tables and fields) Primary key – An attribute whose values are unique within a file Secondary key – Any other attribute DBMS – software program to provide controlled data access Database Files/tables Records Attr. values

DBMS

DBMS DBMS - SW program to create, manage and provide controlled access to the data Example Access, Oracle, DB2 What can we do with a DBMS?

DBMS ACTIVITIES & FUNCTIONS Activities with DBMS Define structure/schema Data entry Modify data query data get reports

DATA DEFINITION Define structure/schema Field Name Data type Description Length Decimals Prod# Numeric Unique prod code 6 Descr Text Short prod description 25 Price Currency Product price 2 Attributes and data types (and other characteristics) are specified as part of data definition

DATA ENTRY Product #: Description: A form is used to enter data Heading PRODUCT DATA ENTRY Label Product #: Description: Field Data entry form

MODIFY DATA Modify data Add Delete Change Records/field values

Query by example (QBE) form QUERYING DATA -QBE Can use QBE or SQL to query data list products costing less than $200 prod# descr. price quantity < 200 Query by example (QBE) form list employees in finance department e_ssn ename edept e_join_dt “finance”

RETRIEVAL WITH SQL The structured query language can be used instead of QBE Each SELECT statement has three parts SELECT, FROM and WHERE SELECT is used to select output attributes FROM is used to specify the source tables WHERE is used for row selection criteria e.g. price < 400; zip = 61455 etc. SELECT <attr. list> FROM <tables> WHERE <condition1 AND/OR condition 2…>

RETRIEVAL WITH SQL.. Reservation RESULT SQL QUERY Flt# Confirm# Pname Confirm# AA1802 Smith PA5R2 PA802 LX5R2 UA3702 Mahoney ZB46A RESULT SQL QUERY Flt# Confirm# AA1802 PA5R2 PA802 LX5R2 Select Flt#, Confirm# From Reservation Where Pname = “Smith”;

ANOTHER EXAMPLE What is the result of the query? SELECT flt#, deptime, arrtime FROM ?? WHERE depcity = "PHX" and destcity = "ORD"; FLIGHTS flt # depcity destcity deptime arrtime AA 802 PHX ORD 1:51 AM 6:05AM UA 3702 COS D 7:35 AM 8:05 AM AA 812 SEA 4:55 AM 9:00 AM D 42 5:40 PM 9:15PM UA775 DFW STL 4:45 PM 5:30 PM What is the result of the query?

DISCUSSION Write SQL queries to list: 1) employee names. 2) Employees who live in Macomb. 3) employees who enjoy soccer. Emp EID eName eAddr eCity 423 Smith 100 Oak lane Macomb 425 501 Johnson 1430 N. Park street Rock Island

THE THEORY OF RETRIEVAL Dept dCode dName dMgr Fin. Finance Jon Sas Sales and service Ross Acc. Accounts Jan DEPTS. have EMPLOYEES Emp EID eName eAddr. 11893 Jon 100 Oak street 11895 Carey 15 Candy lane 11896 Ross 1317 Fox creek list EID, eName, dName

RETRIEVAL FROM MULTIPLE TABLES When data is retrieved from multiple tables, it is called a multi-table query Attr. From different tables are linked primary key in one table cross-reference key in the other table The linking is carried out in the “Where” part of a query

MULTI-TABLE SELECT STATEMENT Used to retrieve data from more than one table SELECT table1.attr1, table2.attr2 . . . . FROM table1, table2, . . . . . WHERE table1.fkey = table2.fkey AND/OR condition1 AND/OR . . . . . . . . . . . . . ; RULES When there are multiple tables, attr. names preceded by table name. “From” will have list of tables as usual. The WHERE part will have values of common attr. equated there can be more than one condition, connected by AND or OR Using the rules above, write a query to list EID, eName, dName

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

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

SUMMARY OF DBMS ACTIVITIES Activities with DBMS Define structure /schema Enter data modify data query data get reports

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

USEFULNESS OF DATABASES

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

IMPORTANCE OF DBMS’s Operational Usage: 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? Strategic Usage: To analyze trends Identify sales prospects

DISCUSSION QUESTIONS A collection of information about machines and parts is called _____? A collection of records is called________ ? The smallest unit of data in a database is _________ ? What is QBE apart from expansion of abbreviation? How does QBE differ from SQL? What does data definition mean? Where would databases be used? How are databases used? Do databases deal with data or information? What is a good database application?

THAT’S ALL FOLKS!