CS317 File and Database Systems

advertisement
CS317
File and Database Systems
http://www.hgtv.com/dream-home/front-yard-pictures-from-hgtv-dream-home-2014/pictures/index.html
Lecture 6-2 – DBMS Development
Dream Home Case Study
September 23, 2014
 Sam Siewert
Reminders…
Warm-Up Quiz for Exam-1 next Week
Final Material on Chapter 9, 10, 11 This Week
Review for Exam #1 on Friday
Exam #1 on October 5 & 7
– Monday - Knowledge and Concepts
– Wednesday - Theory, Implementation and Methods
Assignment #3 Due on Sunday, 10/11
 Sam Siewert
2
DBMS Analysis and Design
Bottom-Up & Top-Down for
DreamHome Case Study
 Sam Siewert
3
For Discussion…
Assignment #3 – Work with Dream Home v. 1.0 to 2.0
1. Create your <name>DHV1 and <name>DHV2 as Needed and
Ask for any Privileges you Want Added from Your DBA
2. Real-world Scenario – Update Current Database to New
Schema and Reload Old Data Along with New Data
3. Bottom-Up Design focus on Attributes, Attribute Domains,
Tables, Keys and Relations, … At DBMS Physical Layer
4. Top-Down Design focus on Information Models using ERD
Driven by Concept and Requirements
5. Likely Will Encounter Both Scenarios
 Sam Siewert
4
DreamHome v. 1.0
Based on Earlier Edition of Connolly-Begg
Original Source was Schema and Data for Ingres DB
Instructor Adapted to Schema Generation (no changes
required) and Data Loading (significant changes
required) for MySQL
Version 1.0 Schema http://mercury.pr.erau.edu/~siewerts/cs317/code/Dreamh
ome-db-v1.0/DreamHome-Tables-Old-Schema.html
Version 1.0 SQL to Create Schema http://mercury.pr.erau.edu/~siewerts/cs317/code/Dreamh
ome-db-v1.0/DreamHome_schema_v1.0.sql
 Sam Siewert
5
DreamHome v. 1.0 Data
Tab delimited http://mercury.pr.erau.edu/~siewerts/cs317/code/Dreamhome
-db-v1.0/Tab-data/
Excel CSVs http://mercury.pr.erau.edu/~siewerts/cs317/code/Dreamhome
-db-v1.0/CSV-data/
Data Load SQL
–
–
–
–
–
–
–
Branch.sql
Staff.sql
Property_For_Rent.sql (PropertyForRent)
Renter.sql (Client)
Owners.sql (PrivateOwner)
Viewing.sql
(Registration) – New Table in v. 2.0
 Sam Siewert
6
DreamHome Schema
Page 112, Figure 4.3
Chapter 7, Problem 7.21,
7.22
Create from DreamHome
version 1.0
Can be Used to Verify
Examples in Chapter 5 & 6
 Sam Siewert
7
DreamHome v. 1.0 on Adminer
6 Tables, Missing Registration Table
9 More Differences Compared to DreamHome 2.0 on
Page 112, Figure 4-3
 Sam Siewert
8
Example 6.24
List the name of all clients who have viewed a property,
along with any comments supplied.
– Results the Same (NULL), but Order is Different from Book
– Need to Adapt Query for this View a Bit
SELECT c.clientNo, fName, IName, propertyNo, comment
FROM Client c, Viewing v
WHERE c.clientNo = v.clientNo
 Sam Siewert
9
Example 6.25
For each branch office, list the staff number and names of
staff who manage properties and the properties that they
manage.
– Results … Almost Identical other than Attribute names and B3 vs.
B003
– Need to Adapt Query for this View a Bit
SELECT s.branchNo, s.staffNo, fName, IName, propertyNo
FROM Staff s, PropertyForRent p
WHERE s.staffNo = p.staffNo
ORDER BY s.branchNo, s.staffNo, propertyNo;
 Sam Siewert
10
Adaptation
Missing Table must be Added and Populated – Only
Option
Attribute name changes – Handle with Updated Views or
Alter Tables
Table name changes? – Updated Views (Stored
Queries) or change Table names
Unload, Update Schema, Update Data, Reload?
Adapt from Existing v. 1.0 with SQL Script?
 Sam Siewert
11
Connolly-Begg Chapter 11
DBMS Development Lifecycle
DreamHome Top-Down
 Sam Siewert
12
Fact-finding techniques
It is critical to capture the necessary facts to build the
required database application.
These facts are captured using fact-finding techniques.
The formal process of using techniques such as interviews
and questionnaires to collect facts about systems,
requirements, and preferences.
13
Examples of data captured and documentation
produced during the database application lifecycle
Focus on Views and
Application Support
(Mobile & Office)
Page 112 Improved Schema
Prototype is v. 1.0
Our Focus in Assignment #3
To Adapt v. 1.0 to
2.0 DreamHome
Use Chapter 6 Examples
To Test v. 2.0 You Adapted
14
Fact-Finding Techniques
A database developer normally uses several fact-finding
techniques during a single database project including:
–
–
–
–
–
examining documentation
interviewing
observing the organization in operation
research
questionnaires
15
Examining documentation – Chapter 6 & 11
Can be useful
– to gain some insight as to how the need for a database arose.
– to identify the part of the organization associated with the problem.
– To understand the current system.
Chapter 11
Chapter 11
Page 112
16
Advantages and disadvantages of
interviewing
(Voice of the Customer)
17
Research
Useful to research the application and problem.
Use computer trade journals, reference books, and the Internet
(including user groups and bulletin boards).
Provide information on how others have solved similar problems,
plus whether or not software packages exist to solve or even
partially solve the problem.
18
Questionnaires
Conduct surveys through questionnaires, which are specialpurpose documents that allow facts to be gathered from a
large number of people while maintaining some control over
their responses.
There are two types of questions, namely free-format and
fixed-format.
Really Works! – As Long as You have Interested
Customers, Who Want a New and Improved Version or
Product
19
Advantages and disadvantages of using
questionnaires
20
Mission Statement for DreamHome Database System
Similar to UML Context Diagram
21
Cross-reference of user views with main types of
data used by each
Looks Like a Candidate for CENTRALIZED rather than
VIEW INTEGRATION Approach
22
Download