[Thursday, April 20, 17:40] > in the example for final exam, translation ER to relational > model; > since webpage is subclass of evaluated, would it be correct to read it as > "webpage is an evaluated webpage"?(in the direction of the arrow) my > instincts want me to read it as "an > evaluated webpage is a subclass of webpage" or "evaluated webpage 'is a' > webpage" which is correct? Yes, you are right. The triangle is in the wrong direction. I earlier used a triangle in that direction, but I changed it for this course, in order to conform with UML. So I forgot to update the diagram (the triangle was in the right direction for the Summer 1999 course). ------------------------------------------------------------------------------- [Saturday, April 22, 16:30] > in the example database, under the table Orders, you have a column > named "Date". This would be illegal if it were entered into Oracle > because this is a reserved word. Yes, you are right. It should be called OrdDate or something similar. > In the Solution to the example final exam, Excersise 2, you listed > as the solution > > CONSTRAINT..... REFERENCED ORDERS > CONSTRAINT..... REFERENCED COMPONENTS > > REFERENCED is not a keyword, when I entered it in this way, Oracle > returned an error. I then used REFERENCES, and it worked fine. Is > REFERENCED a keyword with other DBMS? I must have been sleeping. Yes, REFERENCES is the correct keyword. ------------------------------------------------------------------------------- [Saturday, April 22, 18:00] In 4c) it must be DELETE FROM Orders and not DELETE FROM Pgh_Orders. The task is to translate the update from the view to the base table. In 3e), a DISTINCT is missing. If the same customer has more than one order about a computer with 5 or more components, he/she would be printed more than once. ------------------------------------------------------------------------------- [Saturday, April 22, 18:30] > in your solution for excersise 3, part f, > WHERE M.ORDNO = O.ORDNO...... > > should this not be? > WHERE M.MNO = O.MNO > > Also, when I ran this query, I got an error on line 1, saying > that M.PRICE is not a group by expression. When I changed line > 4 to > > GROUP BY O.ORDNO, M.PRICE > > it seemed to work. I am correct in this? Yes, you are right with both points. I shouldn't have done it in such a haste when I was tired. ------------------------------------------------------------------------------- [Monday, April 24, 16:40] > I am having some confusion to exercises one and two of the sample final you > gave out in class. > > 1) My answer for this excercise was correct except for " child_of-->Topic" ! > Would you explain this please? This translates the relationship "Hierarchy". Since this relationship is one-to-many, you put the key of the "one" side into the "many" side. In this case, both sides are the same entity, but once in the role of a parent topic, and once in the role of a child topic. One parent can have many childs, but each child only one parent. So you put the topic number of the parent into the record (row) of the child. Formally, you see the maximum cardinality 1, so you put the key of the other side into this side. If there is a role name defined, you use this role name as attribute name. But you have some freedom in the attribute names, so if you document what you mean, you can also use another attribute name. This is similar to the column MGR in the EMP table in the Oracle example DB. It contains the employee number of the manager of the employee represented in this row. Do not forget the foreign key whenever you use a column to identify another row. > 2) My answer for the second excercise is good except for a foreign key > constraint. Your answer sheet states the following : > CONSTRAINT Cno_exists FORIEGN KEY (OrdNo)REFERENCES Components > > I am confused should not OrdNo be replaced with CNo? I think this may be an > error on the answer sheet. Yes, you have found an error! There were many errors in the example solution (I wouldn't have got an A grade for my solution ...), please check the Q&A page for other errors.