Presentation is loading. Please wait.

Presentation is loading. Please wait.

11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School.

Similar presentations


Presentation on theme: "11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School."— Presentation transcript:

1 11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School of Information Management and Systems SIMS 257: Database Management

2 11/7/2000Database Management -- R. Larson Review OLAP Data Mining

3 11/7/2000Database Management -- R. Larson OLAP Online Line Analytical Processing –Intended to provide multidimensional views of the data –I.e., the “Data Cube” –The PivotTables in MS Excel are examples of OLAP tools

4 11/7/2000Database Management -- R. Larson Data Cube

5 11/7/2000Database Management -- R. Larson Operations on Data Cubes Slicing the cube –Extracts a 2d table from the multidimensional data cube –Example… Drill-Down –Analyzing a given set of data at a finer level of detail

6 11/7/2000Database Management -- R. Larson Data Mining Data mining is knowledge discovery rather than question answering –May have no pre-formulated questions –Derived from Traditional Statistics Artificial intelligence Computer graphics (visualization)

7 11/7/2000Database Management -- R. Larson Goals of Data Mining Explanatory –Explain some observed event or situation Why have the sales of SUVs increased in California but not in Oregon? Confirmatory –To confirm a hypothesis Whether 2-income families are more likely to buy family medical coverage Exploratory –To analyze data for new or unexpected relationships What spending patterns seem to indicate credit card fraud?

8 11/7/2000Database Management -- R. Larson Data Mining Applications Profiling Populations Analysis of business trends Target marketing Usage Analysis Campaign effectiveness Product affinity

9 11/7/2000Database Management -- R. Larson Data Mining Algorithms Market Basket Analysis Memory-based reasoning Cluster detection Link analysis Decision trees and rule induction algorithms Neural Networks Genetic algorithms

10 11/7/2000Database Management -- R. Larson Today Object-Oriented Database Systems Inverted File and Flat File DBMS Object-Relational DBMS –OR features in Oracle

11 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts Each real-world entity is modeled by an object. Each object is associated with a unique identifier (sometimes call the object ID or OID)

12 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts Each object has a set of instance attributes (or instance variables) and methods. –The value of an attribute can be an object or set of objects. Thus complex object can be constructed from aggregations of other objects. –The set of attributes of the object and the set of methods represent the object structure and behavior, respectively

13 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts The attribute values of an object represent the object’s status. –Status is accessed or modified by sending messages to the object to invoke the corresponding methods

14 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts Objects sharing the same structure and behavior are grouped into classes. –A class represents a template for a set of similar objects. –Each object is an instance of some class.

15 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts A class can be defined as a specialization of of one or more classes. –A class defined as a specialization is called a subclass and inherits attributes and methods from its superclass(es).

16 11/7/2000Database Management -- R. Larson Object-Oriented DBMS Basic Concepts An OODBMS is a DBMS that directly supports a model based on the object- oriented paradigm. –Like any DBMS it must provide persistent storage for objects and their descriptions (schema). –The system must also provide a language for schema definition and and for manipulation of objects and their schema –It will usually include a query language, indexing capabilities, etc.

17 11/7/2000Database Management -- R. Larson Generalization Hierarchy Employee No Name Address Date hired Date of Birth employee Contract No. Date Hired consultant Annual Salary Stock Option Salaried Hourly Rate Hourly calculateAge AllocateToContractcalculateStockBenefit calculateWage

18 11/7/2000Database Management -- R. Larson Inverted File DBMS Usually similar to Hierarchic DBMS in record structure –Support for repeating groups of fields and multiple value fields All access is via inverted file indexes to DBS specified fields. Examples: ADABAS DBMS from Software AG -- used in the MELVYL system

19 11/7/2000Database Management -- R. Larson Flat File DBMS Data is stored as a simple file of records. –Records usually have a simple structure May support indexing of fields in the records. –May also support scanning of the data No mechanisms for relating data between files. Usually easy to use and simple to set up

20 11/7/2000Database Management -- R. Larson Intelligent Database Systems Intelligent DBS are intended to handle more than just data, and may be used in tasks involving large amounts of information where analysis and “discovery” are needed. The following is based on “Intelligent Databases” by Kamran Parsaye, Mark Chignell, Setrag Khoshafian and Harry Wong AI Expert, March 1990, v. 5 no. 3. Pp 38-47

21 11/7/2000Database Management -- R. Larson Intelligent Database Systems They represent the evolution and merging of several technologies: –Automatic Information Discovery –Hypermedia –Object Orientation –Expert Systems –Conventional DBMS

22 11/7/2000Database Management -- R. Larson Intelligent Database Systems Intelligent Databases Expert Systems Traditional Databases Hypermedia Automatic discovery Object Orientation

23 11/7/2000Database Management -- R. Larson Intelligent Database Architecture Intelligent Database Engine High-Level User Interface High-Level Tools

24 11/7/2000Database Management -- R. Larson Environment Components Data Dictionary Concept Dictionary Flexible queries Error detection Automatic Discovery

25 11/7/2000Database Management -- R. Larson Intelligent Databases Data Dictionary contains the system metadata Concept Dictionary defines ‘virtual fields’ based on approximate definitions Data Analysis and discovery –Find patterns –detect errors –Process queries

26 11/7/2000Database Management -- R. Larson Intelligent Databases Automatic Discovery –Data comprehension –Form Hypotheses –Make queries –View results and perhaps modify hypotheses –Repeat

27 11/7/2000Database Management -- R. Larson Intelligent Databases Automatic Error Detection –Integrity Constraints –Rule systems –Analysis of data for anomalies

28 11/7/2000Database Management -- R. Larson Intelligent Databases Flexible Query Processing –Approximate and “fuzzy” queries SELECT NAME, AGE, TELEPHONE FROM PERSONEL WHERE NAME = ‘Dovid Smith’ and AGE IS-CLOSE-TO 19; confidence factors –Ranked query results

29 11/7/2000Database Management -- R. Larson Intelligent Databases Intelligent User Interfaces –Hyperlinked data in the data/knowledge base –Multimedia presentations –Dynamic linking of related information

30 11/7/2000Database Management -- R. Larson Intelligent Databases Intelligent Database Engine –OO support –Inference features –Global optimization –Rule manager –Explanation manager –Transaction manager –Metadata manager –Access module –Multimedia manager

31 11/7/2000Database Management -- R. Larson Object Relational Databases Background Object Definitions –inheritance User-defined datatypes User-defined functions

32 11/7/2000Database Management -- R. Larson Object Relational Databases Began with UniSQL/X unified object-oriented and relational system Some systems (like OpenODB from HP) were Object systems built on top of Relational databases. Miro/Montage/Illustra built on Postgres. Informix Buys Illustra. (DataBlades) Oracle Hires away Informix Programmers. (Cartridges)

33 11/7/2000Database Management -- R. Larson Object Relational Data Model Class, instance, attribute, method, and integrity constraints OID per instance Encapsulation Multiple inheritance hierarchy of classes Class references via OID object references Set-Valued attributes Abstract Data Types

34 11/7/2000Database Management -- R. Larson Object Relational Extended SQL (Illustra) CREATE TABLE tablename {OF TYPE Typename}|{OF NEW TYPE typename} (attr1 type1, attr2 type2,…,attrn typen) {UNDER parent_table_name}; CREATE TYPE typename (attribute_name type_desc, attribute2 type2, …, attrn typen); CREATE FUNCTION functionname (type_name, type_name) RETURNS type_name AS sql_statement

35 11/7/2000Database Management -- R. Larson Object-Relational SQL in ORACLE CREATE (OR REPLACE) TYPE typename AS OBJECT (attr_name, attr_type, …); CREATE TABLE OF typename;

36 11/7/2000Database Management -- R. Larson Example CREATE TYPE ANIMAL_TY AS OBJECT (Breed VARCHAR2(25), Name VARCHAR2(25), Birthdate DATE); Creates a new type CREATE TABLE Animal of Animal_ty; Creates “Object Table”

37 11/7/2000Database Management -- R. Larson Constructor Functions INSERT INTO Animal values (ANIMAL_TY(‘Mule’, ‘Frances’, TO_DATE(‘01-APR-1997’, ‘DD-MM- YYYY’))); Insert a new ANIMAL_TY object into the table

38 11/7/2000Database Management -- R. Larson Selecting from an Object Table Just use the columns in the object… SELECT Name from Animal;

39 11/7/2000Database Management -- R. Larson More Complex Objects CREATE TYPE Address_TY as object (Street VARCHAR2(50), City VARCHAR2(25), State CHAR(2), zip NUMBER); CREATE TYPE Person_TY as object (Name VARCHAR2(25), Address ADDRESS_TY); CREATE TABLE CUSTOMER (Customer_ID NUMBER, Person PERSON_TY);

40 11/7/2000Database Management -- R. Larson What Does the Table Look like? DESCRIBE CUSTOMER; NAME TYPE ----------------------------------------------------- CUSTOMER_ID NUMBER PERSON NAMED TYPE

41 11/7/2000Database Management -- R. Larson Inserting INSERT INTO CUSTOMER VALUES (1, PERSON_TY(‘John Smith’, ADDRESS_TY(‘57 Mt Pleasant St.’, ‘Finn’, ‘NH’, 111111)));

42 11/7/2000Database Management -- R. Larson Selecting from Abstract Datatypes SELECT Customer_ID from CUSTOMER; SELECT * from CUSTOMER; CUSTOMER_ID PERSON(NAME, ADDRESS(STREET, CITY, STATE ZIP)) --------------------------------------------------------------------------------------------------- 1 PERSON_TY(‘JOHN SMITH’, ADDRESS_TY(‘57...

43 11/7/2000Database Management -- R. Larson Selecting from Abstract Datatypes SELECT Customer_id, person.name from Customer; SELECT Customer_id, person.address.street from Customer;

44 11/7/2000Database Management -- R. Larson Updating UPDATE Customer SET person.address.city = ‘HART’ where person.address.city = ‘Briant’;

45 11/7/2000Database Management -- R. Larson Functions CREATE [OR REPLACE] FUNCTION funcname (argname [IN | OUT | IN OUT] datatype …) RETURN datatype (IS | AS) {block | external body}

46 11/7/2000Database Management -- R. Larson Example Create Function BALANCE_CHECK (Person_name IN Varchar2) RETURN NUMBER is BALANCE NUMBER(10,2) BEGIN SELECT sum(decode(Action, ‘BOUGHT’, Amount, 0)) - sum(decode(Action, ‘SOLD’, amount, 0)) INTO BALANCE FROM LEDGER where Person = PERSON_NAME; RETURN BALANCE; END;

47 11/7/2000Database Management -- R. Larson Example Select NAME, BALANCE_CHECK(NAME) from Worker;

48 11/7/2000Database Management -- R. Larson TRIGGERS Create TRIGGER UPDATE_LODGING INSTEAD OF UPDATE on WORKER_LODGING for each row BEGIN if :old.name <> :new.name then update worker set name = :new.name where name = :old.name; end if; if :old.lodging <> … etc...


Download ppt "11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School."

Similar presentations


Ads by Google