50
Databases Nanda Ganesan, Ph.D.

Chapter 5 Databases

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 5 Databases

Databases

Nanda Ganesan, Ph.D.

Page 2: Chapter 5 Databases

Objective

Q1: What is the purpose of a database?Q2: What is a database?Q3: What is a database management system (DBMS)?Q4: How do database applications make

databases more useful?Q5: What is a NoSQL DBMS?

Copyright © 2015 Pearson Education, Inc.

Page 3: Chapter 5 Databases

Q3: What Is a Database Management System (DBMS)?

• Program used to create, process, and administer a database

• Licensed from vendors such as IBM, Microsoft, Oracle, and others

• DB2 from IBM, Access and SQL Server from Microsoft, Oracle Database from Oracle Corporation

• MySQL - open source, license-free for most applications Copyright © 2015 Pearson Education, Inc.

Page 4: Chapter 5 Databases

Database Definition

• Database Management System (DBMS)– Access, Oracle etc.

• Database Application Systems– Student enrollment management system,

enrollment management system

Page 5: Chapter 5 Databases

Data and Information

• Data– Unprocessed

• Information – Processed

Page 6: Chapter 5 Databases

Q1: What Is the Purpose of a Database?

• Organize and keep track of things• Keep track of multiple themes• General rule: Single theme - store in a spreadsheetMultiple themes - use a database

Copyright © 2015 Pearson Education, Inc.

Page 7: Chapter 5 Databases

A List of Student Grades Presented in a Spreadsheet – Single Theme

Copyright © 2015 Pearson Education, Inc.

Page 8: Chapter 5 Databases

Student Data Shown in a Form, from a Database

Copyright © 2015 Pearson Education, Inc.

Page 9: Chapter 5 Databases

Data Processing

• Data Integrity– Database is as valid as the correctness of

the information stored and processed – GIGO

Page 10: Chapter 5 Databases

Good Information Characteristics

• Accurate• Verifiable• Timely• Organized• Accessible• Useful• Cost-effective

Page 11: Chapter 5 Databases

Data Hierarchy

Database Server

Database Application 1

File 1.1

Record 1

Field1 (Primary)

Field 2

Record 2

File 1.2

Database Application 2 File 2.1

Page 12: Chapter 5 Databases

Q2: What Is a Database?

Copyright © 2015 Pearson Education, Inc.

Page 13: Chapter 5 Databases

Hierarchy of Data Elements

Copyright © 2015 Pearson Education, Inc.

Page 14: Chapter 5 Databases

Components of a Database

Copyright © 2015 Pearson Education, Inc.

Page 15: Chapter 5 Databases

Example of Relationships Among Rows

Copyright © 2015 Pearson Education, Inc.

Page 16: Chapter 5 Databases

Sample Metadata (in Access)

Page 17: Chapter 5 Databases

Database Components

Page 18: Chapter 5 Databases

File Characteristics

Page 19: Chapter 5 Databases

Data Types

Text Numeric AutoNumber Currency

Date Memo Hyperlink

Object Attachment

Yes/No

Page 20: Chapter 5 Databases

Data Dictionary

Page 21: Chapter 5 Databases

Maintaining Data

• Add• Modify• Delete• Validate

Page 22: Chapter 5 Databases

Data Validation

Alphabetic/Numeric Check Range check Consistency check

Completeness check Check digit

Page 23: Chapter 5 Databases

Evolution of Database Management Systems

• File processing system• Hierarchical database systems• Relational database systems• Object oriented database systems

Page 24: Chapter 5 Databases

File Processing and Database System

Page 25: Chapter 5 Databases

Advantages of Database Systems

• Reduced data redundancy• Improved data integrity• Efficiently shared data• Relatively simple development

Page 26: Chapter 5 Databases

Examples of Database Management Systems

Page 27: Chapter 5 Databases

Q4: How Do Database Applications Make Databases More Useful?

• Database application– Collection of forms, reports, queries and

application programs serves as intermediary between users and database data.

• Application programs– Provide security, maintain data

consistency, and handle special cases.Copyright © 2015 Pearson Education, Inc.

Page 28: Chapter 5 Databases

Specific Purposes of Four Elements of a Database Application

Copyright © 2015 Pearson Education, Inc.

Page 29: Chapter 5 Databases

Traditional Forms, Queries, Reports, and Applications

Copyright © 2015 Pearson Education, Inc.

Page 30: Chapter 5 Databases

Browser Forms, Reports, Queries, and Applications

Copyright © 2015 Pearson Education, Inc.

Page 31: Chapter 5 Databases

Browser Report for SharePoint Site

Copyright © 2015 Pearson Education, Inc.

Page 32: Chapter 5 Databases

Access Database Components

• Tables• Queries• Forms• Reports• Macros• Modules• Visual Programming (Visual Basic)

Page 33: Chapter 5 Databases

Relational Database

• The entity-relationship model• Entities (objects)

– Students, classes etc.• Relationships

– Enrollment (Student to Classes)

Page 34: Chapter 5 Databases

Types of Relationships

• One-to-one• One-to-Many• Many-to-Many• A design example

– Creating tables to capture a database

Page 35: Chapter 5 Databases

Querying the Tables and the Database

• Query by Example• Query Language

– SQL is the most popular query language

Page 36: Chapter 5 Databases

Processing the Database• Structured Query Language - SQL (see-quell)

– International standard – Used by most popular DBMS

INSERT INTO Student([Student Number], [Student Name], HW1, HW2, MidTerm)VALUES (1000, ‘Franklin, Benjamin’, 90, 95, 100);

Copyright © 2015 Pearson Education, Inc.

Page 37: Chapter 5 Databases

Sample SQL Statement

Page 38: Chapter 5 Databases

Administering the Database

• Used to set up a security system involving user accounts, passwords, permissions, and limits for processing.

• Permissions can be limited in very specific ways.

• Backing up database data, adding structures to improve performance of database applications, removing unwanted data.

Copyright © 2015 Pearson Education, Inc.

Page 39: Chapter 5 Databases

Other Database Models

• Object oriented database model– Contains code and data

• Multidimensional database– In comparison, relational database is a

two-dimensional database • Web database

– Back end database to a front-end web server

Page 40: Chapter 5 Databases

Database Personnel

• Database analyst• Database administrators• Database users

Page 41: Chapter 5 Databases

Experiencing MIS InClass Exercise 5: How Much Is a Database Worth?

• Data has resale value.• Data on everything customers do. • Use to target customer for offerings they care about, avoid those they don’t.

• Costly and difficult to replace data collected over many years.

Copyright © 2015 Pearson Education, Inc.

Page 42: Chapter 5 Databases

Other Database Terms

• Data warehouse• Data mining

Page 43: Chapter 5 Databases

Big Data

• The processing of large amount of data– FaceBook– Supermarkets

Page 44: Chapter 5 Databases

Q5: What Is a NoSQL DBMS?NOSQL DBMS (NotRelational DBMS

• Supports very high transaction rates • Relatively simple data structures• Replicated on many servers in the cloud

• Examples• Dynamo (Amazon)• Bigtable (Google)• Cassandra (Facebook)

Copyright © 2015 Pearson Education, Inc.

Page 45: Chapter 5 Databases

Will NoSQL Replace Relational DBMS Products?

•Conversion very expensive and disruptive.

•Very technical, limited to those with a deep background in computer science.

•Requires years of training to use.•Organization may choose NoSQL products for specialized applications.

Copyright © 2015 Pearson Education, Inc.

Page 46: Chapter 5 Databases

Guide: No, Thanks, I’ll Use a Spreadsheet

• Story of the failed database project• Database works but doesn’t meet the requirements of

this salesperson.• Cause of database failures usually either

incompetent database developers or underfunding.

• Causes of systems development failure--poor communication between users and systems developers, lack of clear requirements, and inability to manage requirements.

Copyright © 2015 Pearson Education, Inc.

Page 47: Chapter 5 Databases

Guide: No, Thanks, I’ll Use a Spreadsheet (cont'd)

• Databases take time to build.• Complicated to operate.• Need IS people to create and keep them running.

• Salesman doesn’t want to share data.• Spreadsheets sometimes better option, especially if data needs are simple.

Copyright © 2015 Pearson Education, Inc.

Page 48: Chapter 5 Databases

Case Study 5: Fail Away with Dynamo, Bigtable, and Cassandra

•Current relational DBMS products not designed for large, multi-server systems

•NoSQL databases – Dynamo (elastic), Bigtable (elastic), Cassandra (used by Facebook, Twitter, Digg, Reddit)

•Amazon: Dynamo•Google: Bigtable processes petabytes of data on hundreds of thousands of servers

Copyright © 2015 Pearson Education, Inc.

Page 49: Chapter 5 Databases

Case Study 5: Fail Away with Dynamo, Bigtable, and Cassandra

•Current relational DBMS products not designed for large, multi-server systems

•NoSQL databases – Dynamo (elastic), Bigtable (elastic), Cassandra (used by Facebook, Twitter, Digg, Reddit)

•Amazon: Dynamo•Google: Bigtable processes petabytes of data on hundreds of thousands of servers

Copyright © 2015 Pearson Education, Inc.

Page 50: Chapter 5 Databases

END