Class Notes (836,562)
Canada (509,854)
Prof (9)
Lecture

Feb 26&28.docx

14 Pages
125 Views
Unlock Document

Department
Computer Science
Course
Computer Science 1032A/B
Professor
Prof
Semester
Winter

Description
Database Design Database  Keep track of data  Spreadsheet vs. database  Keeping track of more than one theme  Database Management System (DBMS) Database Design  Database stores data  Design reflects the organization that exists within the data  Data Model o Captures org of the data o Logical representation of the data Reality and Models  What is a model? o Representation of reality that retains only selected details  Models o Powerful tool for validating necessary details and eliminating irrelevant details o Associate or map, elements in reality to elements in the model Database model (description of both the data and relationships among the data, like a blueprint)  Database design  database The easiest time to change the database structure is during the data modeling stage  Users’ review of a data model is crucial How do I build a database?  How do you build a house…first, you create a blueprint, a plan, a model  How do you build a database…first you make a model, an Entity Relationship Model (E-R Diagram): o Visualization (diagram) of the data o Describes the logical database o Graphical method of mapping the real world  Once the E-R model is built it is used as a blueprint for the real database o Model is mapped to an actual relational database Models  Entity-Relationship (E-R) Model o Most popular for data modeling o Introduced in 1976 by Peter Chen  Many variants o Diagrams Used  To document a model  To describe structured data Entity Relationship Model  A E-R model will consist of: o Entities  Attributes o Relationships  Attributes  Cardinality  Participation Entity  Represents a discrete object: o A person, place, thing, or event  Examples: o At Western: Student, Course, Program o In Business: Order, Customer, Salesperson Attributes  Entities have attribuets  Describe properties of the entity  Example: o Student attributes: Student Number, Name, Address, Phone Number, Date of Birth o Order attributes: Order number, Date, Amount Instances  Database contains instances of the entities  Attributes describe the entity  An instance of the entity is a set of data items that exist  Example: an instance of the student entity o 250078563 o Rhonda Odanski o 65-927 Richmond Street o 519-555-4562 o 05/11/1989 Key Attributes  Necessary to uniquely identify the instance of each entity  Key Attribute vs. Identifier  Examples: o SIN o Student numbers o Employee numbers Relationships  A relationship: o Association btwn two or more entities o Captures how the entities are related to one another  Example: o PERSON works for COMPANY o STUDENT takes COURSE o ARTIST performs a SONG  Relationships can have attributes  Example: o PERSON works for COMPANY  Hire date for the person is a detail that describes the relationship  Hire date does not describe the person or the company Cardinality  Indicates the number of instances of the entities that are involved in the relationship  Three categories o 1:1 relationships  Single entity to single entity o 1:N (N:1) relationships  One to many  Single entity to many entities o N:M relationships  Many to many 1:1 Relationship  Relationship exists: o Faculty member is the chair of a Department  Relationship is: o A FACULTY MEMBER can be chair of only one DEPARTMENT o Each DEPARTMENT can have only one chair  Relationship is 1:1 1:N Relationship  Relationship exists: o Student registered in a Faculty  Relationship is: o STUDENT is only registered in one FACULTY o FACULTY can have many STUDENTS registered  The many students is indicated by N  Therefore his is a 1:N relationship N:M Relationship  Relationship exists: o Students taking cours
More Less

Related notes for Computer Science 1032A/B

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit