Download - Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Transcript
Page 1: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Quiz2

• Quiz 2 in the second half

1. :Group Presentation: need group name,members(two at the most).Next week (14th) lecture in the first half and presentations in the second half.

Page 2: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Organizing Data and Information

• Objectives: Define general data management concepts and terms, highlighting the advantages and disadvantages of the database approach to data management

• Name three database models and outline their basic features, advantages, and disadvantages

• Identify the common functions performed by all database management systems and identify three popular end-user database management systems

Page 3: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Principles

• The database approach to data management provides significant advantages over the traditional file-based approach

• A well designed and well managed database is a valuable tool in supporting decision making

Page 4: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Thought provoking

• How can database be used to support critical business objectives?

• What are some of the issues associated with compiling and managing massive amounts of data?

Page 5: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Catalina Marketing Corporation

• Supplier of in-store electronic scanner-activated consumer promotions.Provide marketing services to consumer goods companies

• Its network provides Individually customized communications and promotions based on customer purchases

• The network uses Actual purchase behavior to target the future buying behavior

• shopping pattern of 150 million shoppers each week in more than 11,000 supermarkets captured and stored in its enormous database,2 Tb.The database has 18 Billion rows of data,for past 65 weeks

• Each retailer that subscribe to Catalina has a PC in the supermarket• Catalina pools this pc nightly via a data network• 70 million rows of data of that day purchase loaded into database

Page 6: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Catalina Marketing Corporation

• Catalina also downloads to that store pc the information about targeted promotion scheduled for the next day

• As items are scanned at the checkout counter, the PC flags any item or the shopper, if the store has a loyalty program– eligible for promotion

• A printer at checkout counter prints out a targeted coupon ,rebate, in-store game, or other incentive

• Two customers buying the same product can get different offers

• Occasional user can have a coupon while a user of competitive product may get a free sample

• Coupon redemption rates 0.6%,4.3%, 8.9% for magazine and newspaper,direct mail, Catalina marketing

Page 7: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

• The Catalina Marketing Network program also arms consumer-goods manufacturers and supermarket retailers with Stealth Campaign

• A latest marketing weapon,the act of moving in a covert(secret) way

• Stealth marketing lets manufacturers and retailers promote specific items and judge campaign effectiveness without their competitors ever knowing that a promotion took place.

• Traditional advertising tools;newspapers,radio,and TV.inform consumer,but also alert competitors

Page 8: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Database Management System

• Throughout your career, you will be accessing a variety of databases

• Simple roster of departmental employees

• Fully integrated corporatewide database

• DBMS: A software to access database

• It consists of a group of programs that manipulate the database

• Provides an interface to the users and application programs to talk to underlying database

• Database environment:database,DBMS,and application programs

• Knowledge of database can enhance your ability to use computerized database systems to support IS and org. goals

Page 9: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Hierarchy of database

• Bit: 0 or 1 On or Off

• Byte: typically 8 bits = 1 Byte

• Character: each byte represent a character (a..z,A..Z,0..9,:;![]()*&^%$#@ )

• Field: made up of characters

• Record: collection of related fields

• File: A collection of related records

• Database:A collection of integrated and related files

Page 10: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Data Entities,Attributes, Keys

• Entity: generalized class of people, places, or things for which data is

collected , stored, and maintained• Attribute: characteristic of an entity• Data item: specific value of an attribute• Key: A field or set of fields in a record that is used to identify the

record• Primary Key:a field or set of fields that uniquely identifies the

record

Page 11: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Traditional Approach

• Manage data via separate data files for each application program

• Payroll file , invoicing file, customer, inventory file• Flaws : data redundancy (customer name & address)• Data Integrity: how accurate data is (keeping customers

address in only one file• Drawback: Program data dependencies:In computerized

database systems, data organized for a particular program(say billing)

• Example: zip code format five numbers,other has nine number-format

Page 12: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Database Approach

• A pool of related data is shared by multiple application programs

• Have tables which contain records, e.g. employee, project,items, and customers

• RDBMS: relational database management system• Advantages: • Improved strategic use of corporate data:• accurate,complete,up-to-date is available to decision

makers, when and where they need it• no data redundancy: stored in one location• efficient usage of storage space ,data integrity,

Page 13: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Advantages

• sharing data,information resources: cost of hardware , software , and DBA,data entry operator, and programmers spread over a large number of applications and users

• Easier: centrally monitored, controlled, edited

• Enhanced security

• Standardization of data access: primary feature,same procedures are used by all application programs to retrieve data and information

Page 14: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Disadvantages

• If for some reason there is a failure in DBMS, all programs are affected

• If security is breached more data is accessible to unwanted persons

• Mainframe DBMS cost hundreds of thousands of dollars

• Specialized staff required

Page 15: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Data Modeling

• Key considerations:

1. what data to be stored

2. Who will have access to it

3. How to use data

• Then create the database

• Building a database requires two different types of designs logical design and physical design

• Logical design: every thing starts with logic

Page 16: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Logical Design

• shows an abstract model how data should be structured, and arranged to meet ORG information needs

• Identifying relationships among different data items and grouping them in an orderly fashion

• Database is used by IS ,and IS is used throughout an org , users assist in logical design

Page 17: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Physical Design

• Based on logical design• Fine-tunes it for performance and cost consideration• Examples: improved response time, DBMS can tell you the

time your query took, e.g. 3seconds improve it• reduced storage space, lower operating cost• Logical design could be altered, some data attribute are

repeated in more than one entity• Is this not redundant?• Yes we call it planned data redundancy• It is done to speed up the user reports or queries

Page 18: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Data Model

• Data Mode:Tool database designers use to show the logical relationships among data

• A diagram of entities and their relationships• Data modeling involves understanding a specific business

problem • Analyzing data and information needed to deliver a solution• Enterprise data modeling: when scope is entire org• Starts with finding data and information needs of the org at

strategic level and specific needs for various functional areas

Page 19: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Entity-Relationship (ER) diagrams

• Use graphic symbols to show the organization of data and relationship between data

• Box: for entity• Diamond: relationship between entities• Oval: attribute• Types of relationship between entities• one to one• One to many• Many to many

Page 20: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Customer

FirstName

Last Name

IDNumber

Product

Part number

Name Color

Order

1

N

Page 21: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

MySQL

• Open source DBMS

• Execute mysql (already installed ,created databases, and tables)

• Command: show databases; (end with ;)

• Use se452; (se452 is a database)

• Show tables;

• Describe address; (address is a table in se452 database) show attributes and their types

• Select * from address; shows all records in the table

mysql > insert into address values(12,"B 71 block 10 Gulshan");

query OK, 1 row affected (0.03 sec)

Page 22: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Database Models

• Three logical database models

1. Hierarchical(Tree) Models

2. Network Model

3. Relational Model (most popular)

Page 23: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Hierarchical

• Data is organized in a top-down, or inverted tree,structure

• Must follow a definite path (searching a record is slow)

• To Best suited One-to-many relationship among the elements

• Parent children

Page 24: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Hierarchical

project

Department A

DepartmentB

DepartmentC

Employee1

Employee2

Employee3

Employee4

Employee5

Page 25: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Network Models

• Expansion of the hierarchical model

• Owner-member relationship

• Member may have many owners

• Deficiency : once relationships are established between data elements , it is difficult to modify them or to create new relationships

• Many-to-many relationship among the elements

Page 26: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Network Models

Project1

Project2

DepartmentA

DepartmentB

DepartmentC

Page 27: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Relational Models

• Tabular format

• All data elements are placed in two-dimensional tables, called relations

• Relation: Logical equivalent of files

• Tables: rows and columns

• Each row represents a data entity,columns represent attributes

• Each attribute can have only one value (data types char, varchar, number)

• Domain: allowable values for attributes e.g. gender M or F

• Pay rate can not be negative numbers e.g. -$5.0 can not be entered into database

Page 28: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

• Once database and its tables are created we can populate these tables with records

• Can query a database about the records• Selection: shows only those records according to a specific criteria

(works on rows)• Select * from employees where salary > 2000 ;• Projection:works on columns, eliminating columns based on a

specific criteria• Joining: combining two or more tables• Linking: combining two or more tables using common attributes to

form a new table with only the unique data attributes ; power and flexibility of RDB

Page 29: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

• Many company use it for large corporate database, such as marketing and accounting

• Relational model can be used with PC and mainframe systems

Page 30: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Data Cleanup

• Database created with data from multiple sources, those disparate sources may store different values for the same customer due to spelling errors, multiple account numbers, and address variations

• Purpose of data cleanup is to look for and fix these and other inconsistencies that can result in duplicate or incorrect records ending up in the database

Page 31: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

DBMSs

• A group of programs used as an interface between database and application programs or

• A database and the user

• DBMSs classified by the database model they support

• Example: A relational database management system follows the relational model

• Access by Microsoft for PC

• Mainframe RDBMSs include DB2 by IBM, Oracle, Sybase, and Informix.

• Common functionalities: user view, creating and modifying, storing and retrieving data, manipulating data, and generating reports

Page 32: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

User View

• DBMS must know the logical and physical structure of the data and the relationship among the data in the database

• Schema: A description of the entire database

• Can be a separate file

• Can be part of the database

• Subschema: A file that contains a description of a subset of the database and identifies which users can view and modify the data items in the subset

• Programmers and managers needs only a subset of the database

• Example: a sales representative might need only data describing customers in her region, not the sales data for the entire nation

Page 33: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

DBMS

Schema

SubschemaA

SubschemaB

SubschemaC

User 1 User 2 User 3 User 4 User 5 User 6

Page 34: Quiz2 Quiz 2 in the second half 1.:Group Presentation: need group name,members(two at the most).Next week (14 th ) lecture in the first half and presentations.

Creating and Modifying Database

• Schema and subschemas are entered into database via DDL

• DDL: A data definition language

• DDL: a collection of instructions and commands used to define and describe data and data relationships in a specific database

• In general , a DDL describes logical access paths and logical records in the database