lecture 7 of advanced databases er model - an example instructor: mr.eyad almassri

7
Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Upload: rosalyn-king

Post on 03-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Lecture 7 of Advanced Databases

ER Model - An Example

Instructor: Mr.Eyad Almassri

Page 2: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Page 2

A Bioinformatics ApplicationA Bioinformatics Application

Patient: has a unique MSP number, a Patient name, a Date of Birth, a Tissue Type ( االنسجة .and an indicator denoting whether the tissue is cancerous or normal(نوع

A patient library associates a patient with multiple tags

Each tag has a unique tag number and a unique nucleotide sequence.

For each tag in the patient library, a count is given to record the number of times the tag occurs in the library. In general, the same tag can be associated with any number of patients.

A tag may be mapped to a gene. Each gene has a unique gene name and a type.

In general, multiple tags may be mapped to the same gene. However, two different genes cannot be mapped to the same tag.

Finally, an article is identified by a unique article number and a journal name. An article may analyze multiple genes and a gene may be analyzed by multiple articles.

Problem 1Problem 1

Page 3: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

WARM UPWARM UP

Entity Sets:Entity Sets:Patients - Attibutes are MSP Number, Name, DOB, Tissue Type and Indicator

Tags - Attributes are Tag Number and Nucleotide Sequence

Genes - Attributes are Gene Name and Type

Articles - Attributes are Article Number and Journal Name

Relationship Sets:Relationship Sets: Patient Library - Many to Many, Has an attribute Count

Map - Many to 1 from Tags to Genes

Analyzes - Many to Many

Page 3

Page 4: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

ER DiagramER Diagram

Page 4

Page 5: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Problem 2Problem 2

Page 5

(Taken from Exercise 5.15)

Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course:

STUDENT(SSN, Name, Major, Bdate)

COURSE(Course#, Cname, Dept)

ENROLL(SSN, Course#, Quarter, Grade)

BOOK_ADOPTION(Course#, Quarter, Book_ISBN)

TEXT(Book_ISBN, Book_Title, Publisher, Author)

Draw a relational schema diagram specifying the foreign keys for this schema.1-Draw a entity-relationship diagram. 2-Draw a relational schema diagram specifying the foreign keys for this schema

Page 6: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Solution ERSolution ER

Page 6

Page 7: Lecture 7 of Advanced Databases ER Model - An Example Instructor: Mr.Eyad Almassri

Solution relational schema diagram Solution relational schema diagram

Page 7