Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representing Information. Data Models A data model is a precise description of information content Types of data models Conceptual (high-level): in terms.

Similar presentations


Presentation on theme: "Representing Information. Data Models A data model is a precise description of information content Types of data models Conceptual (high-level): in terms."— Presentation transcript:

1 Representing Information

2 Data Models A data model is a precise description of information content Types of data models Conceptual (high-level): in terms that users will understand Logical: in terms that a relational database system will understand (close to the way data is stored) Physical (low-level, how data is actually stored): in terms of the underlying computer hardware and operating system (memory/file system)

3 Data Models A Schema is a data model that is intended to be used with a specific database system External schemas are defined for the users of a database Logical schema defines the representation as a collection of tables that are stored in a database server Internal schema defines the representation used by the database server to store the tables in memory or files

4 Data Models Distinction between a schema and actual database: intension vs. extension Populating a database

5 Requirements In this phase database designers gather information about the database system in need Database designers model the database according to user requirements Database attributes and characteristics conform to users’ actual “ vocabulary”

6 Organizing Information Entity An abstraction of the object that contains those characteristics important to the information system Entity class The common characteristics that represent a set of entities Attribute A characteristic/property that helps to describe an object Attribute value The value of a particular characteristic

7 Organizing Information Examples Entity: A customer, or the characteristics of a customer that are of interest Entity class/type: All of the potential customers, or the information about them Attribute: hair color or last name Attribute value: hair color is brown or last name is ‘Breaux’

8 Examples of Entity Classes Entity ClassDescription Customer A customer of the business Video An item in the rental inventory Employee A person who works in one or more stores Store One of the retail outlets of BigHit Video Rental The rental of a video by a customer for a specific period and cost Purchase Order A request to purchase an item

9 Attributes An attribute has: Name, Type, Restriction, Description Domain of an attribute: set of all possible values Attribute Single valued /simple/atomic Multi-valued (each element is a possible value): college degree, car color Composite (the whole is one value): consists of several atomic attributes (date, address)

10 Examples AttributeTypeRestrictions on Values DescriptionSample Value title StringUnboundedThe title of an item Annie Hall ssn String9 digits (0–9)A Social Security number 211009008 accountId Number4 byte integerThe identifier of a customer account 101 AddressComposite2 stringsStreet, city, st., Zip …. otherUsers SetSet of strings of 30 characters Names of other people authorised to use the account Jeremiah Block Kenneth Block

11 Key Attributes A key attribute is an attribute that uniquely identifies a single entity within the class Examples Employee : SSN Book : ISBN Customer : AccountId A key may be a composite attribute: Full Name

12 Attribute Constraints Key Constraint: The system respects this constraint by rejecting an entity with an existing key Null Constraint: the value can (not) be NULL (unknown, not applicable) Derived: value not entered but computed based on other attributes’ values

13 Relationships A relationship type between 2 entity classes represents the possibility that two entities may be related (x-product) A customer may rent a video A relationship (or relationship instance) is a connection between 2 entities (actual tuple) Customer Jane Block rents the video with videoId 90987 To maintain flexibility in relationships, relationship types are not defined as attributes The customer accountId is not an attribute of the Video entity class

14 Example (Customer and Video) Account ID: 101 video ID: 90987 Date: January 9, 2002Cost: $2.99 Jane Block 1010 Main St. Apopka, FL 30458 ElizabethDate due: January 11, 2002

15 Constraints on Relationships A relationship type may be limited in how many relationships an object may have The cardinality of a relationship type may be One-to-one: Each object of a class may have no more than one object of the other class One-to-many: One of the classes allows and entity to have any number of related entities, but the other class restricts its entities to be related to no more than one entity. Many-to-many: Entities of both classes may have any number of related entities of the other class.

16 Other Constraints Min/Max constraints Mandatory Participation Constraint and Optional Participation Constraint

17 Higher-order relationships A relationship can involve more than two entities Example: Store-Video-Supplier relationship

18 Example (Case in Point) Determining entity classes, attributes and relationship types for BigHit Online video sales Process Evaluate statement of goals for information system Define entity classes Define attributes for entity classes Define relationship types Determine cardinalities of relationship roles Add attributes to relationship types as necessary Evaluate entity classes, attributes, and relationship types for clarity, accuracy, and completeness

19 Example Statement of goals is highlighted to identify different kinds of information

20 Example Entities: Customer (key: account, last name, first name, address, email, credit card, password) Movie (key: id, title, genre, length) Sale (key: id, cost, date, credit card) Shopping Cart (key: id, date)

21 Example Relationship Type Entity Class Cardinality Ratio Attibutes PurchasesCustomerSale one-to-many IncludesSaleMovie many-to- many quantity SelectsCustomerShoppingCar t one-to-many IncludesShoppingC art Movie many-to- many quantity


Download ppt "Representing Information. Data Models A data model is a precise description of information content Types of data models Conceptual (high-level): in terms."

Similar presentations


Ads by Google