CS145 - Spring 2003
Introduction to Databases
Online (OTC) Homework-Account Information
Logins for OTC homework have been assigned to students who filled
out the course registration form, or requested an auditor account,
by the Tue 9 Apr 2003 deadline.
Email describing these assigned logins were sent by 1:45am PDT Wed 9 Apr 2003.
Please email course staff at
cs145@cs.stanford.edu for
further assistance setting up your OTC account.
Homework 1 Questions and Answers
- When asking a question about OTC problem text or answer choices, please
quote the relevant portions of the assignment.
- After you complete a submission, please keep a copy of the entire Web page
with your score and submission certificate. In case of data loss, you may
be asked to present the page for your highest-scoring submission in order to
restore your high score.
- On the question with <!DOCTYPE dinner>, there were errors in the
three proposed XML documents. The question was corrected around 2:30pm
Thu 10 Apr 2003. Depending on which answer choices you received, these
errors may have affected your choice of answer. Sorry about the errors
in the question, and thank you to
Jenny Rose Finkel,
Peter Solderitsch, and
Tyrone Yu
for reporting them.
- One of the questions, beginning with <!doctype A> (in lowercase), has
its DTD corrected for syntax now (as of 3:30pm Mon 14 Apr 2003). Fortunately,
the answer choices compelled you to assume the DTD was valid, so your
choice of answer was probably unaffected. Corrections were delayed
by bureaucracy, and thank you to
Vellachi
for providing the final nudge to get it fixed.
Is an ID attribute value unique per attribute, per element,
or per document?
In a valid XML document, each value of an ID attribute is unique for the
entire XML document.
Can IDREF[S] point to an ID that does not exist?
In a valid XML document, no; IDREF[S] point to any ID that exists
within the XML document, without limitation.
Why? (Is there some intuition for ID and IDREF?)
An ID attribute only uniquely identifies an XML element,
one of those <tag>...</tag> productions. An IDREF attribute only
uniquely identifies another element in the XML document, so that one
element can be connected to another element not its container (parent
or ancestor). This is also why no more than one attribute of an element
may be of type ID in a valid XML document.
CS145 Web pages -
email the staff