1 / 5

6.830 / 6.814 Lecture 2 Data Models

6.830 / 6.814 Lecture 2 Data Models. “Those who cannot remember the past are doomed to repeat it”. Study break #1. Consider a course schema with students, classes, rooms (each has a number of attributes) Classes in exactly one room Students in zero or more classes

mura
Download Presentation

6.830 / 6.814 Lecture 2 Data Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 6.830 / 6.814 Lecture 2Data Models “Those who cannot remember the past are doomed to repeat it”

  2. Study break #1 • Consider a course schema with students, classes, rooms (each has a number of attributes) Classes in exactly one room Students in zero or more classes Classes taken by zero or more students Rooms host zero or more classes Classes isin takenby Students Rooms

  3. Questions • Describe one possible hierarchical schema for this data • Is there a hierarchical representation that is free of redundancy? • What problems might this redundancy lead to? Classes isin takenby Students Rooms

  4. Study Break # 2 Schema: classes: (cid, c_name, c_rid, …) rooms: (rid, bldg, …) students: (sid, s_name, …) takes: (t_sid, t_cid) SELECT s_name FROM student,takes,classes WHERE t_sid=sid AND t_cid=cid AND c_name=‘6.830’

  5. Questions • Write an equivalent relational algebra expression for this query • Are there other possible expressions? • Do you think one would be more “efficient” to execute? Why? SELECT s_name FROM student,takes,classes WHERE t_sid=sid AND t_cid=cid AND c_name=‘6.830’

More Related