A7Ans - University of Waterloo School of Computer Science...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Waterloo School of Computer Science CS348 Spring 2009 Assignment 7 Due: July 21, 2009 1. Consider the following relational schema. Student(Id :Integer, Name:String, Address;String, Status:String) Course(DeptId:String, CourseCode :String, CourseName: String, Desc:String) Transcript(StudId :Integer, CourseCode :String, Semester :Stype, Year :Integer, Grade:Integer) The underlined attributes are the primary keys of the corresponding relation schemes. Stype consist of Term which assume values “Fall”, “Spring” or “Winter”. Grade is in the range of 0-100 CourseCode is a string of 6 characters, the first 3 are alphabetical string while the last 3 are number. For instance, CSC348. StudId and CourseCode in Transcript are foreign key referencing Student and Course relation, respectively. Suppose a database defined by the above schema is stored as a document. 30% (a) Give a DTD schema definition for the documents defined in the above database. Each document contains data on a database defined on the above schema. State constraints, if any, that cannot be captured with your design. Your design should be as simple as possible. <! DOCTYPE Everything [ <! ELEMENT Everything ( Students | Courses | Transcripts )* > <! ELEMENT Students ( Student *) > <! ELEMENT Transcripts ( Transcript *) > <! ELEMENT Courses ( Course *) > <! ELEMENT Student ( Name , Address , Status ) > <! ELEMENT Name ( #PCDATA ) > <! ELEMENT Address ( #PCDATA ) > <! ELEMENT Status ( #PCDATA ) > <! ELEMENT Course ( DeptId , CourseName , Desc ) > <! ELEMENT DeptId ( #PCDATA
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/23/2009 for the course CS 348 taught by Professor Woody during the Spring '09 term at Waterloo.

Page1 / 4

A7Ans - University of Waterloo School of Computer Science...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online