abc insurance co. paul barry steve randolph jing zhou csc8490 database systems & file management...

22
ABC Insurance ABC Insurance Co. Co. Paul Barry Paul Barry Steve Randolph Steve Randolph Jing Zhou Jing Zhou CSC8490 Database Systems & File CSC8490 Database Systems & File Management Management Dr. Goelman Dr. Goelman Villanova University Villanova University August 2, 2004 August 2, 2004

Upload: virginia-watson

Post on 12-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

ABC Insurance ABC Insurance Co.Co.

Paul BarryPaul Barry

Steve RandolphSteve Randolph

Jing ZhouJing Zhou

CSC8490 Database Systems & File CSC8490 Database Systems & File ManagementManagement

Dr. GoelmanDr. Goelman

Villanova UniversityVillanova University

August 2, 2004August 2, 2004

Page 2: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Presentation TopicsPresentation Topics ConceptConcept

Initial DesignInitial Design Extended DiagramExtended Diagram Alternate Design FormatsAlternate Design Formats

ImplementationImplementation SQL Schema Definition and SQL Schema Definition and Loader ScriptsLoader Scripts Database InstanceDatabase Instance

ApplicationApplication SQL*Plus and PL/SQL Reports and TriggersSQL*Plus and PL/SQL Reports and Triggers ABC GUIABC GUI

SummarySummary

Page 3: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Initial DesignInitial Design ConceptsConcepts Business Rules (Mini-world Business Rules (Mini-world

Description)Description) ER Diagram (ER Diagram (linklink)) Schema Diagram (Schema Diagram (linklink))

Page 4: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Extended DesignExtended Design Additional Sub-classes:Additional Sub-classes:

PoliciesPolicies VehiclesVehicles

EER Diagram (EER Diagram (linklink)) Extended Schema Diagram (Extended Schema Diagram (linklink)) UML Diagram (UML Diagram (linklink)) ODM Diagram (link)ODM Diagram (link) ODL (link)ODL (link)

Page 5: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

SQL Schema Definition ScriptsSQL Schema Definition Scripts

What’s in the SQL schema script?What’s in the SQL schema script? DDLDDL statements for creating 15 tables statements for creating 15 tables Views are defined for subclassesViews are defined for subclasses Check total specialization constraintsCheck total specialization constraints Grant commands Grant commands Alter statements for adding foreign keys constraints Alter statements for adding foreign keys constraints

to tablesto tables

Page 6: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Constraints & ViewsConstraints & Views Use Not Null, Primary key, Foreign key and Check Use Not Null, Primary key, Foreign key and Check

constraints constraints Provide rules for data entry Provide rules for data entry Prevent the deletion of a table if there are Prevent the deletion of a table if there are

dependencies from other tablesdependencies from other tables Establishes relationship between the tables. Establishes relationship between the tables. Assertions are completeness constraints and check Assertions are completeness constraints and check

total specialization of super classes to sub classes.total specialization of super classes to sub classes. Views associated with sub-classes Views associated with sub-classes Each view is provided for the subclass with its Each view is provided for the subclass with its

inherited attributes.inherited attributes. linklink

Page 7: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

SQL Schema Loader ScriptsSQL Schema Loader Scripts

We use SQL *Loader to load the data into We use SQL *Loader to load the data into tablestables

SQL *Loader is a utility for loading data from SQL *Loader is a utility for loading data from external files into an Oracle tableexternal files into an Oracle table

It requires two primary It requires two primary filesfiles: Control file and : Control file and Data fileData file

Control file contains information on the format Control file contains information on the format of the data and loading instructionsof the data and loading instructions

Data file contains the records to be loaded into Data file contains the records to be loaded into Oracle Oracle

Data file also can be included into control fileData file also can be included into control file They are separated by key word ‘BEGINDATA’They are separated by key word ‘BEGINDATA’

Page 8: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Database InstanceDatabase Instance

Sample relation instances after schema definition and data loading

Page 9: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Report: Policy_InfoReport: Policy_Info

This report shows general policy information This report shows general policy information grouped by type of policy (auto or life grouped by type of policy (auto or life insurance). Within each of these groupings a insurance). Within each of these groupings a row is displayed for each policy showing row is displayed for each policy showing details on the policy including the member ID details on the policy including the member ID (identifies the owner of the policy), the (identifies the owner of the policy), the premium for the policy and any balance that premium for the policy and any balance that has not been paid.has not been paid.

Policy_Info.Policy_Info.sqlsql OutputOutput

Page 10: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Transaction: New_ClaimTransaction: New_Claim

This SQLPlus command file accepts a policy This SQLPlus command file accepts a policy number and the amount for an auto claim as number and the amount for an auto claim as input. Within an anonymous PL/SQL block the input. Within an anonymous PL/SQL block the new claim is added to the database. It also new claim is added to the database. It also calculates the amount of the claims against calculates the amount of the claims against this policy within the last 2 years and if the this policy within the last 2 years and if the amount is greater than $5000 the premium is amount is greater than $5000 the premium is increased by 10%.increased by 10%.

New_Claim.sqlNew_Claim.sql OutputOutput

Page 11: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Procedure: Procedure:

A procedure is a named PL/SQL block that A procedure is a named PL/SQL block that performs an actionperforms an action

A procedure can be stored in the database, as a A procedure can be stored in the database, as a schema object, for repeated executionschema object, for repeated execution

QUERY_MB is a procedure that is associated with QUERY_MB is a procedure that is associated with MEMBER entity to display member’s informationMEMBER entity to display member’s information

It takes one parameter for MemberId from It takes one parameter for MemberId from execute command and returns 3 parameter execute command and returns 3 parameter values to the calling environment.values to the calling environment.

Procedure.sqlProcedure.sql OutputOutput

Page 12: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

TriggerTrigger

A data Trigger to associate with member table A data Trigger to associate with member table when an insert or update statement is issued.when an insert or update statement is issued.

The Trigger checks the member’s date of birth. The Trigger checks the member’s date of birth. If person's age is under 18, the trigger will If person's age is under 18, the trigger will raise an error message.raise an error message.

Trigger.sqlTrigger.sql OutputOutput

Page 13: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

ABC GUIABC GUI

DB Front-End: GUI implemented using Java’s Swing DB Front-End: GUI implemented using Java’s Swing API. (API. (linklink))

Two categories of functionality:Two categories of functionality: Canned Queries – Predefined select statementsCanned Queries – Predefined select statements User-Defined Queries – Can accommodate all valid User-Defined Queries – Can accommodate all valid

SQL statements (insert, update, select, nested SQL statements (insert, update, select, nested queries, etc.)queries, etc.)

GUI-DB communication via Java’s JDBC API.GUI-DB communication via Java’s JDBC API. Classes from the JDBC API (Connection, Statement, Classes from the JDBC API (Connection, Statement,

DriverManager, ResultsSet, etc.) used to connect and DriverManager, ResultsSet, etc.) used to connect and execute SQL statements on the data in the database. execute SQL statements on the data in the database.

Page 14: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

SummarySummary Database designed and implemented for an Database designed and implemented for an

Insurance Company.Insurance Company. Design extended to include sub-class hierarchiesDesign extended to include sub-class hierarchies Data structure supports basic business rules and Data structure supports basic business rules and

functional dependenciesfunctional dependencies All tables are BCNF – no update anomaliesAll tables are BCNF – no update anomalies Table level constraints implemented to ensure data Table level constraints implemented to ensure data

integrityintegrity Reports, transactions, views and procedures Reports, transactions, views and procedures

created for enhanced convenience and increased created for enhanced convenience and increased breadth of functionality.breadth of functionality.

Convenient user interface providedConvenient user interface provided

Page 15: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

Support SlidesSupport Slides

Page 16: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

POLICY

AGENT

MEMBER

CLAIM

Has_AFiled_Against

Has_A

Is_A

VEHICLE

Cov ered_By

1

N

M

N1

N

1

1

1

1

1

N

MemberID

Name

Fname

Minit

Lname

Address Birth_Date

Sex

PolTy pe

Activ e

Name

Address

District

Policy No

VID Primary _Oper

ClassUse_Cat

ClaimIDClaim_Date

Amount

Paid_YN

Ty pe

Amout

Premium

Balance

Start_Date

End_Date

Liability _Limit

Collision_Limit

Premium

Balance

AgentID

AUTO_POLICY

Is_A Is_A

LIFE_POLICY

PhoneNo

PhoneNo

Benef iciaryDeductible

DRIVER

Insures

N

Name

Fname

MinitLname

Birth_Date

Sex

LicenseNo

Risk_Cat

1

ER DiagramER Diagram

return

Page 17: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

MEMBER

MemberID Fname Minit Lname Address Birth_Date Sex

AGENT MEM_PHONE

AgentID Fname Minit Lname Address Distinct MID PhoneNo

POLICY AGENT_PHONE

PolicyNo PolType Active AID MID AID PhoneNo

CLAIM POLICY_CLAIM

ClaimID Claim_Date Amount Paid_YN PNo CID

AUTO_POLICY

PolicyNo Start_Date End_Date Liability_Limit Collision_Limit Deductible Premium Balance

VEHICLE

VID Use_cat Class Primary_Oper PolicyNo

LIFE_POLICY

PolicyNo Type Amount Premium Balance

BENEFICIARY

FName LName Minit PolicyNo

DRIVER

FName LName Minit Birth_Date Sex LicenseNo Risk_Cat PolicyNo

ABC Insurance Company Schema Diagram

return

Page 18: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

EER DiagramEER Diagram

POLICY

AGENT

MEMBER

CLAIM

Has_AFiled_Against

Has_A

VEHICLE

Covered_By

1

N

M

N1

N

1

N

MemberID

Name

Fname

Minit

Lname

Address Birth_Date

Sex

Active

Name

Address

District

PolicyNo

VID

Primary_OperUse_Cat

ClaimIDClaim_Date

Amount

Paid_YN

Type

Amout

Start_Date

End_Date

Liability_Limit

Collision_Limit

AgentID

AUTO_POLICY

LIFE_POLICY

PhoneNo

PhoneNo

Beneficiary

Deductible

DRIVER

Insures

N

Name

Fname

MinitLname

Birth_Date

Sex

LicenseNo

Risk_Cat

1

PolType

d

HOME_OWNERS_POLICY

Premium

Balance

Deductible

Address

Dwelling_Limit

Pers_Prop_Limit

COMMERCIAL_VEHICLE

NON_COMMERCIAL_VEHICLE

d

Business

Class

Renewal_Date

Class

PolType

return

Page 19: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

MEMBER

MemberID Fname Minit Lname Address Birth_Date Sex

AGENT MEM_PHONE

AgentID Fname Minit Lname Address Distinct MemberID PhoneNo

POLICY AGENT_PHONE

PolicyNo PolType Active AgentID MemberID Balance Premium AgentID PhoneNo

CLAIM POLICY_CLAIM

ClaimID Claim_Date Amount Paid_YN PolicyNo ClaimID

AUTO_POLICY

PolicyNo Liability_Limit Collision_Limit Deductible Start_Date End_Date

HOME_OWNERS_POLICY

PolicyNo Address Deductible Dwelling_Limit Pers_Prop_Limit Renewal_Date

LIFE_POLICY

PolicyNo Type Amount

BENEFICIARY

PolicyNo Fname Minit Lname

DRIVER

FName Minit Fname License_No Birth_Date Sex Risk_Cat PolicyNo

VEHICLE

VID Class PolicyNo

NON_COMMERCIAL_VEHICLE

VID Use_cat Primary_Oper

COMMERCIAL_VEHICLE

VID Business

ABC Insurance Company Extended Schema Diagram

return

Page 20: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

UML DiagramUML Diagram

return

Page 21: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

return

Member

PolicyAgent Claim

Auto_Policy Life_Policy Home_Owners_Policy

DriverVehicle

Commercial_Vehicle

Non_Commercial_Vehicle

ABC Insurance Co.

Has_Policies

Has_Member

Filed_AgainstHas_ClaimsHas_Policies Has_Agent

Covers_Drivers Covers_Vehicles

Insured_ByInsured_By

ODL DiagramODL Diagram

Page 22: ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004

return