Specify an appropriate set of classes for the Student Registration System. Do this using ?rst UDTs of SQL:2003 and then the ODL language of ODMG.
What will be an ideal response?
We modify the tables de?ned in Section 4.8 in two ways: Using references to types instead of foreign key constraints and by making use of set-valued attributes.
CREATE TYPE Course AS (
CrsCode CHAR(6),
DeptId CHAR(4) NOT NULL,
CrsName CHAR(20) NOT NULL,
creditHours INTEGER NOT NULL,
SemestersOffered CHAR(6) MULTISET,
Requires REF(Course) MULTISET,
PRIMARY KEY (CrsCode)
)
CREATE TYPE Class UNDER Course AS (
CrsCode CHAR(6),
SectionNo INTEGER,
Semester CHAR(6),
Year INTEGER,
ClassTime CHAR(6),
Enrollment INTEGER,
MaxEnrollment INTEGER,
Textbook CHAR(50),
TaughtIn REF(Room),
Instructor REF(Facu lty ),
PRIMARY KEY (CrsCode, SectionNo, Semester, Year)
)
CREATE TYPE Room AS (
ClassroomId INTEGER,
Seats INTEGER,
PRIMARY KEY(ClassroomId)
)
CREATE TYPE Student AS (
Id CHAR(9),
Address CHAR(50),
Name CHAR(20),
Password CHAR(10),
Transcript REF(TranscriptRecord) MULTISET,
PRIMARY KEY(Id)
)
CREATE TYPE TranscriptRecord AS (
Grade CHAR(1),
Class REF(Class)
)
CREATE TYPE Facu lty AS (
Id CHAR(9),
Name CHAR(20),
Address CHAR(50),
DeptId CHAR(4),
Password CHAR(10),
PRIMARY KEY(Id)
)
The ODMG version of the Student Registration Schema is as follows:
class Course
(extent CourseExt
keys CrsCode)
{
attribute String CrsCode;
attribute String DeptId;
attribute String CrsName;
attribute Integer creditHours;
attribute SetSemestersOffered;
relationship SetRequires;
}
class Class extends Course
(extent ClassExt
keys (CrsCode, SectionNo, Semester, Year))
{
attribute String CrsCode;
attribute Integer SectionNo;
attribute String Semester;
attribute Integer Year;
attribute String ClassTime;
attribute Integer Enrollment;
attribute Integer MaxEnrollment;
attribute String Textbook;
relationship Room TaughtIn;
relationship Facu lty Instructor;
}
class Room
(extent RoomExt
keys ClassroomId)
{
attribute Integer ClassroomId;
attribute Integer Seats;
}
class Student
(extent StudentExt
keys Id)
{
attribute String Id;
attribute String Address;
attribute String Name;
attribute String Password;
relationship SetTranscript;
}
class TranscriptRecord
(extent TranscriptRecordExt)
{
attribute String Grade;
relationship Class Class;
}
class Faculty
(extent ProfessorExt
keys Id)
{
attribute String Id;
attribute String Name;
attribute String Address;
attribute String DeptId;
attribute String Password;
}
You might also like to view...
Text boxes can also be referred to as word frames.
Answer the following statement true (T) or false (F)
Write the pseudocode for the method named computeSum. The method should return a numeric value: result. The method should have two numeric parameters: amount1 and amount2. result is equal to the sum of amount1 and amount2.
What will be an ideal response?
Which of the following is NOT true when defining multiple properties on the same field?
A) The Format property affects how the data is both displayed and stored. B) If you save an input mask, the input mask is ignored when you define a format in the field's Format property. C) The data in the table does not change, regardless of how you define the Format property. D) When defining an input mask that differs from the Format property, the Format property takes precedence when the data is displayed.
A URL without a full Web address, such as index.htm, creates a(n) ____ reference, which is a link to a page within the same site.
a. relative b. internal c. absolute . d. external