Prologue to Database Frameworks.

Uploaded on:
Prologue to Database Frameworks. CS363/607* Address #2. Last class. What is a database? What is a DBMS? Database history DBMS segments Wording Information model, composition, information, DDL, DML, DBA Social database framework. Substance Relationship Model.
Slide 1

Prologue to Database Systems CS363/607* Lecture #2

Slide 2

Last class What is a database? What is a DBMS? Database history DBMS segments Terminology Data model, pattern, information, DDL, DML, DBA Relational database framework

Slide 3

Entity-Relationship Model The E/R model permits us to outline the configuration of a database casually. Plans are pictures called element relationship outlines . Genuinely mechanical procedure to change over E/R graphs to genuine executions like social databases exist.

Slide 4

Database displaying procedure

Slide 5

Entity Sets Entity = “thing”, a theoretical object or some likeness thereof. Like an article in item arranged dialects. Substance set = a gathering of comparable elements. Like a class in item situated dialects. Samples: understudies, films, stars

Slide 6

Attributes = properties of the substances in an element set. By and large, all elements in a set have the same properties. Traits are basic qualities, e.g. whole numbers or character strings. Illustrations: studentNo, accountNo

Slide 7

Relationships are associations among two or more element sets. Case: Entity: Star, motion picture Relation: Star-in A film substance m is identified with a star element s by the relationship star-in if s shows up in motion picture m

Slide 8

E/R Diagrams In an element relationship chart: Each element set is spoken to by a rectangle. Every quality of an element set is spoken to by an oval, Relationships are spoken to by jewels Edges are utilized to interface a substance to its properties furthermore join a connection boat to its element sets.

Slide 9

Example Entity set Beers has two properties, name and producer. Every Beer substance has values for these two characteristics, e.g. (Budweiser, Anheuser-Busch) name maker Beers

Slide 10

name addr name manf Bars Beers Sells Bars offer a few brews. permit Drinkers like a few lagers . Frequents Likes Note: permit = lager, full, none Drinkers visit a few bars . Consumers name addr Example

Slide 11

Entity Set and Relationship Set The current “value” of a substance set is the arrangement of elements that have a place with it. Case: the arrangement of all bars The “value” of a relationship is an arrangement of arrangements of at present related elements, one from each of the related element sets.

Slide 12

Example Bar Beer Joe’s Bar Budweiser Joe’s Bar Miller Sue’s Bar Budweiser Sue’s Bar Pete’s Ale Sue’s Bar Bud Lite

Slide 13

Example name telephone ID Students stature Each understudy has four characteristics: ID, name, telephone, tallness

Slide 14

Example Students Courses Sally C131 Sally C363 Joe M130 … … Taking Students Courses

Slide 15


Slide 16

Example: An occurrence The individuals from the relationship set are the table\'s lines. For Instance, (Basic Instinct, Sharon Stone) Is a tuple in the relationship set for the present example of relationship Star-in

Slide 17

Binary Relationship A paired relationship can interface any individual from one of its element sets to any individuals from the other substance set. It is the least complex relationship which just interfaces two substance sets. Illustration Student Class

Slide 18

Many-Many Relationships In a numerous relationship, a substance of either set can be joined with numerous elements of the other set. Case: Think of a relationship between two element sets, for example, Sells in the middle of Bars and Beers . A bar offers numerous brews; a lager is sold by numerous bars.

Slide 19

Many-One Relationships Some double connections are numerous - one starting with one substance set then onto the next. Every element of the first set is associated with at most one element of the second set. Be that as it may, a substance of the second set can be joined with zero, one, or numerous elements of the first set.

Slide 20

Example Favorite , from Drinkers to Beers is numerous one. A consumer has at most one most loved lager. Be that as it may, a brew can be the most loved of any number of consumers, including zero.

Slide 21

One-One Relationships In an one-one relationship, every element of either substance set is identified with at most one element of the other set. Case: Relationship Best-merchant between substance sets Manufacturers and Beers . A brew can\'t be made by more than one producer, and no maker can have more than one hit( (accept no ties).

Slide 22

Example Runs Studios Presidents

Slide 23

Representing “Multiplicity” Show a numerous one relationship by a bolt entering the “one” side. Demonstrate an one-one relationship by bolts entering both substance sets. In a few circumstances, we can likewise declare “exactly one,” i.e., every element of one set must be identified with precisely one element of the other set. To do as such, we utilize an adjusted bolt.

Slide 24

numerous many numerous one one-one In Picture Representation of Many-One E/R: bolt indicating “one.” Rounded bolt = “exactly one.”

Slide 25

Example Likes Drinkers Beers Favorite

Slide 26

Example Consider Best-vender in the middle of Manufacturers and Beers . A few brews are not the smash hit of any producer so an adjusted bolt to Manufacturers would be unseemly. However, a maker needs to have a blockbuster( (we expect they are lager producers).

Slide 27

In the E/R Diagram Best-vender Manufacturers Beers

Slide 28

Roles Sometimes a substance set seems more than once in a relationship. Mark the edges between the relationship and the element set with names called parts .

Slide 29

Relationship Set Husband Wife Bob Ann Joe Sue … … Married spouse wife Drinkers Example

Slide 30

Attributes on Relationships Sometimes it is valuable to connect an ascribe to a relationship. Think about this characteristic as a property of tuples in the relationship set.

Slide 31

value Sells Bars Beers value Prices Sells Bars Beers

Slide 32

Multiway Relationships Sometimes, we require a relationship that interfaces more than two element sets. Assume that consumers will just drink certain lagers at specific bars. Our three twofold connections Likes, Sells, and Frequents don\'t permit us to make this qualification. Yet, a 3-way relationship would.

Slide 33

name addr name manf Bars Beers permit Preferences Drinkers name addr Example

Slide 34

Bar Drinker Beer Joe’s Bar Ann Miller Sue’s Bar Ann Budweiser Sue’s Bar Ann Pete’s Ale Joe’s Bar Bob Budweiser Joe’s Bar Bob Miller Joe’s Bar Cal Miller Sue’s Bar Cal Bud Lite A Typical Relationship Set

Slide 35

Example Contract Stars Movies Studios (Studio, Star, Movie)

Slide 36


Slide 38

BBP The-Bar The-Beer The-Price Bars Beers Price Converting Multiway to 2-Way Many-one connections from the uniting E.S. to the others.

Slide 39

A four-way relationship

Slide 40


Slide 41

Subclasses A substance set contains certain elements that have extraordinary properties not connected with all individuals from the set. Subclass = extraordinary case = less substances = more properties. Case: Ales are a sort of lager. Not every lager is a beer, but rather some are. Give us a chance to assume that notwithstanding every one of the properties (qualities and connections) of lagers, lagers likewise have the characteristic shading .

Slide 42

Subclasses in E/R Diagrams Assume subclasses frame a tree. I.e., no various legacy. Isa triangles demonstrate the subclass relationship. Point to the superclass.

Slide 43

Example Beers name producer isa Ales shading

Slide 44


Slide 45

E/R Vs. Article Oriented Subclasses In the item arranged world, items are in one class just. Subclasses acquire properties from superclasses. Conversely, E/R substances have parts in all subclasses to which they have a place. Matters when we change over to relations.

Slide 46

Pete’s Ale Example Beers name manf isa Ales shading

Slide 47

Exercise 1 Let us plan a database for a bank, including data about clients and their records. Data around a client incorporates their name, address, telephone, and SSN. Records have numbers, sorts and equalizations. We likewise need to record the clients who own a record. Draw the E/R outline for this database. Make sure to incorporate bolts where suitable, to showing the variety of a relationship.

Slide 48


Slide 49

Summary E/R model Elements of E/R model Entity sets Attributes Relationships Entity-Relationship graph Binary and multiway connections Roles Converting multiway to twofold subclass

Slide 50

Design guideline Faithfulness Avoiding excess Simplicity checks Choosing the right connections Picking up the right sort of components

Slide 51

Faithfulness The configuration must be steadfast to the particulars, which is, substance sets and their traits ought to mirror the truth Examples: Stars in the middle of stars and motion pictures Teaches in the middle of courses and educators Stars-in Stars Movies Teaching Courses educators

Slide 52

Avoiding repetition Not illicit, yet unsafe in light of the fact that: Take more space to store Increase unpredictability, may bring about irregularity Example: studioname claims Studios Movies name address

Slide 53

Simplicity Less components is great Example: Represents possesses Movies Holdings Studios claims Movies Studios

Slide 54

Choosing the right connections Entity sets can be associated with different connections, including more in the outline is bad on the grounds that: Redundancy More space utilization Modifying turns out to be more perplexing

Slide 55

Example Stars-in Movies Stars Contracts possesses Studios

Slide 56

Another case Stars-in Movies Stars Works-for claims Studios

Slide 57

Picking the right sort of components by and large, an ascribe is less difficult to execute that an element set or a relationship, on the other hand, yo

View more...