Upload
chi
View
33
Download
3
Tags:
Embed Size (px)
DESCRIPTION
Chapter 1 Overview of Database Concepts. Jason C.H. Chen , Ph.D. Professor of MIS School of Business, Gonzaga University Spokane, WA 99258 USA [email protected]. Objectives. Define database terms Identify the purpose of a database management system (DBMS) - PowerPoint PPT Presentation
Citation preview
Dr. Chen, Business Database Systems 1
BMIS441
• Read syllabus thoroughly and understand all policy – Attendance, Assignments– Quizzes, EXAMS– Seat chart etc.– MIS Career (see Bb)
• Methodology vs. Technology• Text books
Dr. Chen, Business Database Systems
Comments and Suggestions
A great teacher at summarizing concepts and is really dedicated to his job and loves what he does
At the beginning of the semester I felt that the rules of the class were a little extreme as far as grading and attendance went, yet as the year went on and i understood what was expected I felt that these expectations were reasonable. I feel that if they were explained better at the beginning of the semester I would have had less anxiety in relevance to the course.
Dr. Chen is a great professor. Loved his class.
I really enjoyed the course including both Dr. Chen's style of teaching and humor.
I fell that Dr. Chen really summarized the material well and showed the class how to apply the concepts learned in class to use. I fell like he did a good job making sure all key concepts were understood. I respected the fact that he set up individual meetings with all groups to talk about how they felt the class was going and how it could be improved, outside of class. It showed a lot about Dr. Chen's character
Dr. Chen, Business Database Systems
About SQL …
I thought this blog post was fun… and informative about some of the latest trends.http://blog.sqlizer.io/posts/sql-43/
Dr. Chen, Business Database Systems
Chapter 1Overview of Database Concepts
Jason C.H. Chen, Ph.D.Professor of MIS
School of Business, Gonzaga UniversitySpokane, WA 99258 USA
Dr. Chen, Business Database Systems
What is Information ?
DATA
Information is refined data.
INFORMATION
What is 80/20 rule?How to apply it to this scenario?
Dr. Chen, Business Database Systems
What is Information ?
DATA INFORMATION
80% of information/
valuable output
Trivial many (80%)? or
Vital few (20%)?
Other business example?
Dr. Chen, Business Database Systems 7
Data vs. Information
• Users really want is– Information
i What users can learn from the datavhow to satisfy their best customersvhow to allocate their resources most efficiently,vhow to minimize losses
Dr. Chen, Business Database Systems 8
Objectives of the MIS
Deliver the right informationto the right people,at the right time,with the right form.
Ultimately, MIS should improve the workers’ productivity.
who has what information about whom and when, where, and how will all be decided in the process of building an information system.
Dr. Chen, Business Database Systems 9
Objectives
• Define database terms• Identify the purpose of a database management
system (DBMS)• Explain database design using entity-relationship
models and normalization• Explain the purpose of a Structured Query
Language (SQL)• Understand how this textbook’s topics are
sequenced and how the two sample databases are used
Dr. Chen, Business Database Systems
A Relationship Between the Organization and the DataBase
OrganizationalIS Resources:
PictureOr
Model
OldState
NewState
Activities
DataBaseManagement
SystemsCorrespond with the processing of the events
(Add, modify, delete, …)
Transactions
D.B.
Information must be:
User
Events
1. Hardware2. Software3. Data4. Procedures5. People
1. Time: Timely, 2. Content: Accurate, relevant, and verifiable.3. Form: Presented in a useable form.
TM 0-10
Dr. Chen, Business Database Systems
A Relationship Between the Organization and the DataBase
OrganizationalIS Resources:1. Hardware2. Software3. Data4. Procedures5. People
PictureOr
Model
OldState
Events
NewState
Activities
DataBaseManagement
Systems D.B.
Transactions
(Add, modify, delete, …)Correspond with the processing of the events
Information must be:1. Time: Timely, 2. Content: Accurate, relevant, and verifiable.3. Form: Presented in a useable form.
User
TM 0-11
Dr. Chen, Business Database Systems 12
Questions
• Is MS/Access or Oracle (SQL/Server or IBM DB2) a data base?
• Y/N
Dr. Chen, Business Database Systems 13
Types of Data Processing
• Two types of data processing– File-based data processing
• e.g., applications developed by Java– Data-based data processing
• e.g, applications developed by Oracle or MS/Access)
Dr. Chen, Business Database Systems
Three file processing systems at a Furniture Company
Duplicate Data
What is the main problem in the
company’s processing systems?
Dr. Chen, Business Database Systems
Database Management System
??? Databasecontainingcentralized
shared data
Application#1
Application#2
Application#3
Dr. Chen, Business Database Systems
Database Management System
DBMS manages data resources like an operating system manages hardware resources
DBMS Databasecontainingcentralized
shared data
Application#1
Application#2
Application#3
What are the advantages of employing Data-based Data Processing?
Dr. Chen, Business Database Systems
Traditional File Processing
ProductSales rep
Supplier
Data Files
Purchasing System
Sales order processing
system
Product
Applications
Name, item#, description...
Name, item#, description...
Dr. Chen, Business Database Systems
Database Management Systems
Product
Sales rep
Supplier
Database
DatabaseManagem ent
System s
PurchasingSystem
Salesorder processing
system
Dr. Chen, Business Database Systems 19
Database Terminology
• Database – an organized collection of logically related data files
• Database management system (DBMS) – software used to create and interact with the database
Dr. Chen, Business Database Systems 20
Database Components• Character
– Basic unit of data– Can be a letter, number, or special symbol
• Field– A group of related characters– Represents an attribute or characteristic of an entity– Corresponds to a column in the physical database
• Record– A collection of fields for one specific entity– Corresponds to a row in the physical database
• File– A group of records about the same type of entity
Dr. Chen, Business Database Systems 21
• Break
Dr. Chen, Business Database Systems 22
Relational Database Terms• Entity: an object about which you want to store data• Table, column, row
– Flat file, attribute (or field), record• Relationships: links that show how different records are
related• Key Fields: establish relationships among records in
different tables• Five main types of key fields:
– primary keys– candidate keys– surrogate keys– foreign keys– composite keys
Dr. Chen, Business Database Systems 23
Primary Keys vs. Candidate Keys
• Primary key– Value must be unique for each record– Serves to identify the record– Present in every record– Can’t be NULL– Should be numeric
• Candidate key – Any field that could be used as the primary key– Should be a unique, unchanging numeric field
Dr. Chen, Business Database Systems 24
Surrogate Keys
• Surrogate key: created to be the record’s primary key identifier when no suitable primary key exists
• Surrogate key has no real relationship to the record to which it is assigned, other than to identify the record uniquely
• Developers configure the database to generate surrogate key values automatically
• In an Oracle database, you can automatically generate surrogate key values using a sequence
• Surrogate keys are always numerical fields, because the database generates surrogate key values automatically by incrementing the previous value by one
Dr. Chen, Business Database Systems 25
Foreign Keys• Foreign key: a field in a table that is a primary key in
another table• Foreign key creates a relationship between the two tables• Foreign key value must exist in the table where it is a
primary key
Dr. Chen, Business Database Systems 26
Composite Key
• Composite key: a unique key that you create by combining two or more fields
• Usually comprised of fields that are primary keys in other tables
ORDER_ID PRODUCT_ID ORDER_QUANTITY100 1 2100 2 2200 2 2200 1 1
Composite Key
Dr. Chen, Business Database Systems 27
Structured Query Language (SQL)
• Data sublanguage • Used to:
– Create or modify tables– Add data to tables– Edit data in tables– Retrieve data from tables
• ANSI and ISO standards
Dr. Chen, Business Database Systems 28
Data Models• A data model is a collection of concepts for
describing data.
CUSTOMER ORDER
• Three database models– Hierarchical– Network– Relational
Dr. Chen, Business Database Systems
Entity-Relationship Model (E-R Model)
• Used to depict the relationship that exists among entities
• The following relationships can be included in an E-R model:– One-to-one– One-to-many– Many-to-many
Dr. Chen, Business Database Systems 30
E-R Model Notation Examples
Figure 1-3 E-R Model notation examples
Please note that the name of entity should be singular even it contains multiple instances
Dr. Chen, Business Database Systems 31
One-to-One Relationship
• Each occurrence of data in one entity is represented by only one occurrence of data in the other entity
• Example: Each order has just one invoice and each invoice is assigned to just one order
ORDER INVOICE
Dr. Chen, Business Database Systems 32
One-to-Many Relationship
• Each occurrence of data in one entity can be represented by many occurrences of the data in the other entity
• Example: A class has only one instructor, but each instructor can teach many classes
Class Instructor
Dr. Chen, Business Database Systems 33
Many-to-Many Relationship• Data can have multiple occurrences in both
entities• Example: A student can take many classes,
and each class is composed of many students
• Can not be included in the physical database
Class Student
Dr. Chen, Business Database Systems 34
In-Class Exercise
• Work on – “JustLee” database and its “Cardinality”– “Customers” and “Orders” Entities
See file of “2. Customers_Orders (JLDB_Referential_Integrity)-out.pdf” on handout folder
Dr. Chen, Business Database Systems
ISBN Title Publication Date Cost Retail Category Publishe
r Contact Author
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson T.Peterson
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson J.Austin
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson J.Adams
1915762492 Handcranked Computers
21-JUN-05 21.80 25.00 Computer American Publishing
Davidson W.White
1915762492 Handcranked Computers
21-JUN-05 21.80 25.00 Computer American Publishing
Davidson L.White
6522489652 Meaningful Accounting
25-MAY-08 41.60 85.00 Accounting Articulate Publishing
Brown M.Kane
6522489652 Meaningful Accounting
25-MAY-08 41.60 85.00 Accounting Articulate Publishing
Brown S. Little
Q: Can we create/enter the data base on the following table immediately?
BOOKS tableneed to update multiple times to maintain its data integrity
Dr. Chen, Business Database Systems
Problem Solving for Modeling a Database Project
Business ProblemStudy and Analyze w/Team
???
IMPLEMENTATION
Dr. Chen, Business Database Systems
Problem Solving for Modeling a Database Project
Business ProblemStudy and Analyze w/Team
ER or other Model
Normalized Forms(3NF)
User interview & Integrated Model
Normalization
IMPLEMENTATION
Dr. Chen, Business Database Systems 38
JustLee Example E-R Model
Dr. Chen, Business Database Systems
Figure 1-5 JustLee Books’ table structures after normalization
Dr. Chen, Business Database Systems
Figure 1-5 JustLee Books’ table structures after normalization
Correction (one of the cpk and fk)
Revised Version on ORDERITEMS Table
Dr. Chen, Business Database Systems
Processes from 1NF 2NF 3NF
Category Contact
Computer Davidson
Accounting Brown
ISBN Title Publication Date Cost Retail Category Publisher
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
1915762492 Handcranked Computers
21-JUN-05 21.80 25.00 Computer American Publishing
6522489652 Meaningful Accounting
25-MAY-08 41.60 85.00 Accounting Articulate Publishing
ISBN Author
8843172113 T.Peterson
8843172113 J.Austin
8843172113 J.Adams
1915762492 W.White
1915762492 L.White
6522489652 M.Kane
6522489652 S. Little
ISBN Title Publication Date Cost Retail Category Publisher Contact Author
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson T.Peterson
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson J.Austin
8843172113 Database Implementation
04-JUN-03 31.40 55.95 Computer American Publishing
Davidson J.Adams
1915762492 Handcranked Computers
21-JUN-05 21.80 25.00 Computer Amercian Publishing
Davidson W.White
1915762492 Handcranked Computers
21-JUN-05 21.80 25.00 Computer Amercian Publishing
Davidson L.White
6522489652 Meaningful Accounting
25-MAY-08 41.60 85.00 Accounting Articulate Publishing
Brown M.Kane
6522489652 Meaningful Accounting
25-MAY-08 41.60 85.00 Accounting Articulate Publishing
Brown S. Little
Category Code Category
10 Computer
50 Accounting
fk(foreign key)
We will learn all detailed processes in the main text (ch.4)
Now, how many times are needed to maintain its data integrity (UPDATE)
Dr. Chen, Business Database Systems 42
Databases Used in this Textbook – JustLee Books Database
• Assumptions– No back orders or partial shipments– Only U.S. addresses– Completed orders are transferred to the annual
SALES table at the end of each month to enable faster processing on the ORDERS table
Dr. Chen, Business Database Systems 43
Study all tables in the JustLee Books Database (JLDB)
• Primary key• Candidate key• Surrogate key• Foreign key• Composite key
Dr. Chen, Business Database Systems 44
Topics of the Text
• The first half of the text will focus on creating a database
• The second half of the text will focus on querying or retrieving data from a database
Dr. Chen, Business Database Systems 45
System Response TimeDepends on ...
• the speed of the network• the size of the database• the way the database is used …• a personal database running on a server
might handle 10 users making database transactions at the same time before becoming overloaded.
Dr. Chen, Business Database Systems
SQL, SQL*Plus, and PL/SQLLanguage or Tool Description
SQL A command language for communication with theOracle 10/11Server from any tool or application. OracleSQL contains many extensions.
SQL*Plus An Oracle tool that recognizes and submits SQL andPL/SQL statements to the Server for execution andcontains its own command language.
PL/SQL An Oracle Procedural Language for writing applicationlogic and manipulating data outside the database.
SQL*Plus ServerBuffer
SQL and PL/SQLScripts
Terminal
Dr. Chen, Business Database Systems 47
HW• Do Hands-On Assignments (p.21)• Class Exercise #1• HW: #3, 5 and #10 (ER-M)• Draw with Visio (or Word) and print a
hardcopy• You should read the pptx file and chapter 1 (up to
page 6) of Oracle 11g to get basic concepts about database and DBMS.
• Figures 1-4 and 1-5 should be studied thoroughly.
Dr. Chen, Business Database Systems 48
Installing Personal Oracle11g
• I created a “Discussion Questions” on the Bb for you to share (or post question) your experience on installation of Oracle 11g. Please participate and it will be also your part of class performance.
• • Please note that if your computer with 64-bit operating
system such as Windows 7, you can’t use the DVD to install Oracle since it is for 32-bit OS. Rather you need to download 64-bit Oracle 11g from the Oracle site (www.oracle.com) or type in keyword search of “Oracle 11g download”.
Dr. Chen, Business Database Systems 49
Summary
• A DBMS is used to create and maintain a database• A database is composed of a group of interrelated
tables• A file is a group of related records; a file is also
called a table in the physical database• A record is a group of related fields regarding one
specific entity; a record is also called a row• A record is considered unnormalized if it contains
repeating groups
Dr. Chen, Business Database Systems 50
Summary (continued)
• A record is in first-normal form (1NF) if no repeating groups exist and it has a primary key
• Second-normal form (2NF) is achieved if the record is in 1NF and has no partial dependencies
• After a record is in 2NF and all transitive dependencies have been removed, then it is in third-normal form (3NF), which is generally sufficient for most databases
• A primary key is used to uniquely identify each record
Dr. Chen, Business Database Systems 51
Summary (continued)
• A common field is used to join data contained in different tables
• A foreign key is a common field that exists between two tables but is also a primary key in one of the tables
• A lookup table is a common term for a table referenced in a foreign key
• A Structured Query Language (SQL) is a data sublanguage that navigates the data stored within a database’s tables