DOC PREVIEW
UW CSE 444 - Database Design

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Database DesignDatabase Design FormalismsObject Definition LanguageODL Class DeclarationsODL ExampleODL DeclarationsSlide 7Slide 8Slide 9Slide 10Types in ODLAllowable Types in ODLDatabase Design•Why do we need it?– Agree on structure of the database before deciding on a particular implementation.•Consider issues such as:–What entities to model–How entities are related–What constraints exist in the domain–How to achieve good designsDatabase Design Formalisms•Object Definition Language (ODL):– Closer in spirit to object-oriented models•Entity/Relationship model (E/R):–More relational in nature.•Both can be translated (semi-automatically) to relational schemas (with varying amount of pain).•ODL to OO-schema: direct transformation (C++ or Smalltalk based system).Object Definition Language•Is part of ODMG, which also gave us OQL. •Resembles C++ (and Smalltalk).•Basic design paradigm in ODL: –Model objec ts and their properties.•For abstraction purposes:–Group objects into classes.•What qualifies as a good class?–Objects should have common properties.ODL Class DeclarationsInterface <name> { attributes: <type> <name>; relationships <range type> <name>; methods}Method example: float gpa(in: Student) raises (noGrades)Arbitrary function can compute the value of gpa, based on astudent object given as input.ODL ExampleProductPersonCompanycategorynamepricenamestockpricenameaddress ssnODL DeclarationsInterface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category }Interface Company { attribute string name; attribute float stockprice; }Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; }ODL ExampleProductPersonCompanycategorynamepricenamestockpricenameaddress ssnbuysworksFormadeByODL DeclarationsInterface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category; relationship <Company> madeBy; }Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; relationship set <Product> buys; relationship set <Company> worksFor;}ODL ExampleProductPersonCompanycategorynamepricenamestockpricenameaddress ssnbuysworksFormadeByemploysmakesODL DeclarationsInterface Company { attribute string name; attribute float stockprice; relationship set <Product> makes inverse Product::madeBy; relationship set <Person> employs inverse Person::worksFor; }Types in ODLBasic types: Atomic types (e.g., string, integer, …) Interface types (e.g., Person, Product, Company)Constructors: Set: (1, 5, 6) Bag: (1, 1, 5, 6, 6 ) List: (1, 5, 6, 1, 6 ) Array: Integer[17] Struct: {string street, string city, integer zipcode}Allowable Types in ODLFor attributes: start with atomic or struct, and apply a collection type. OK: string, set of integer, bag of Address. Not OK: Product, set of set of integer.For relationships: start with interface type and apply a collection type. OK: Product, set of Product, list of Person. Not OK: struct {pname Product, cname Company} set of bag of Product


View Full Document

UW CSE 444 - Database Design

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Database Design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Database Design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Database Design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?