


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Figure 1 Original ER Diagram, January 30, 2006
Let me take off my “client” hat and put on an “instructor” type hat for a few minutes. I’ve gone through the ER diagram you sent to me following Tuesday’s meeting and think that this may be the source of some problems down the road. I have some suggestions as to what a good ER diagram for this project would be, but first I want to note some generic issues with this diagram:
Even though I’m telling you what I think about this diagram, please don’t just take my word for it. I’m not an expert database designer, though I have designed enough to know what has worked for me in the past and what has not. There are some structural issues with this diagram and some stylistic ones. Please consult with whomever in the CS department you know is knowledgeable concerning such design. Frankly, I’d appreciate a critique from an expert of what I’m proposing as well.
The thing which first captured my attention about this ER diagram was its complicated mesh of links. Personally, I prefer to see simple structures which map transparently onto the real entities with which the system should be dealing. I admit that I was concerned even before I tried to dig into its structure.
First off, naming conventions. All data in relational databases appears as tables, so there’s no benefit to naming your tables starting with “tbl.” Besides, it should make no difference to any user (program or programmer) as to whether they are dealing with a base table or a view built upon several related tables. Similarly, variables don’t benefit from having their structure or type
exposed in their names, since that precludes changing the structure later in response to changed requirements or performance tradeoffs. (This presumes that no one will go through the entire system, database and associated programs, and change every appearance of a variable’s name to a new one with updated structure information properly encoded. I doubt anyone will ever in practice do such a thing for any database of more than two tables or program of more than 20 lines. ;)
Naming also reflects how one thinks about the thing named, and if a table is to represent an entity, its name should reflect that entity. Instead, several names of “things” sound like actions. Examples: tblAssignQuiz and tblAddPerson. Good examples of naming include tblStudentProfile, though personally I wouldn’t have included the term “Profile” so that I would have named that table simply student.
Second, data in a database should reflect the actual entities and their relationships, not how the data will flow into and around the program. This comes up in the naming of such tables as tblCreateSchedule. This table is used to create the set of quizzes by storing the normal days of the week for lectures, but after the lectures are created, this table is no longer necessary. (In fact, it’s probably counterproductive to refer to it since not all “normal” lectures are used – witness Mondays two times each semester.) Another example of a table I wouldn’t use is tblReviewAnswersAndGrade which includes references to student photos for every question answered. (Even if it were useful to have different pictures of the same student in different places in the site, I wouldn’t want the effort of having to specify that picture every time a student answers a question.)
But that’s more than enough of what I wouldn’t do. If I haven’t completely alienated you with these observations, you’re probably wondering what I would do. Here’s how I worked my way through to an alternative, though tentative, ER diagram.
The core entity of the entire system is a class, which I’ll call a course from now on in deference to the normal use of the term “class” in a computer science context. Without a course there is nothing to couple the people involved to each other or to the work which instructors (and their cohorts) generate and which students use. A course is, for present purposes, composed of a set of lectures (or reading assignments) which in turn are composed of a set of questions which may or may not be answered by students, and subsequently graded. The nouns in this description should amp onto tables in a final ER diagram.
Consider first the “people” side of the course. Both types of people, instructors and students, have many common features, such as names, USCIDs, and email addresses. However, the two groups are distinct in that instructors and only instructors create content. Just to complicate things, a single physical person could conceivably be an instructor of one course, but a student in another.
My first version of an ER diagram of these entities looks like this:
That’s my first cut at people in the course. You might note that among these tables, all of the information is “properly” normalized (I forget which normal form’s requirements it satisfies) and I don’t think there’s any benefit to denormalizing these tables in any way. This is probably not the case, however, for the quiz/question/grading portion of the database. My view of that portion is that a single course is simply defined by the set of lectures (or here, readings) included in it. Each reading (I hesitate to call it “lecture,” but that’s subject to debate) corresponds to a single lecture with a title and physical delivery date by which it ought to be labeled, has an assignment (usually a reading) which is exposed only after a certain date and time, and has questions which are due by a certain date and time. There are zero or more questions for each reading, and these can be graded by an instructor.
Figure 3 Draft of most of the ER diagram
You’ll notice that the mesh of relationship lines is quite reduced now, yet no actual connection has been dropped. The only place where lines cross in this diagram could, if I wanted to be cute, be drawn around a different path, but that is just being cute. I could avoid crossings, even with emailedComments included in the relationships if I put the reading/question/response set of tables between the student and instructor rows, but that would defeat the purpose of showing all people on a common footing. I’m sure you’ll find things that are wrong about some details of this diagram (after all, it’s a first cut) but I believe it is closer to what the ideal is than what is shown on the first page.