$PH/06f522/asgnt3/metaschemaCK_ns061014.txt From nitin.sonawane@gmail.com Sat Oct 14 10:00:48 2006 From: "Nitin Sonawane" To: "Bob Lechner" Subject: Fwd: [UML_CS522_f2006_OOA] Thoughts on the test driver Prof. Lechner, Not sure if you've signed up to the YahooGroup that Keith setup. Here is an email I sent earlier today w.r.t the test driver. Thanks, Nitin. ---------- Forwarded message ---------- From: nitinsonawane Date: Oct 14, 2006 8:52 AM Subject: [UML_CS522_f2006_OOA] Thoughts on the test driver To: UML_CS522_f2006_OOA@yahoogroups.com Hello, Please find attached the .sch file (essentially a concatenated version of student.sch and metaschemaCK.sch) that we can use for this assignment. Here is an attempt at the various candidate keys for the tables in this schema. I have also added some assumptions (that help simplify things but may not be true in the real world). Feedback is greatly appreciated Deptarment DE (DeptNumber) (DeptName) (DeptHeadName) ASSUMPTION: There is one department a person can head. Student AA (StudentIdNumber) Term TM (TMName) Faculty FY (DeptId, FacyName) Course CO (DeptId, CourseNo) StudentAddress AD (StudentID) StudentTerm RT (StudentId, TermId) CourseTermSection CT (FacultyId, TermId, CourseId) ASSUMPTION: A faculty member will teach one course in only one section in any given term?. If this assumption is not acceptable, then we can add sectionNo to the candidate key Prerequisite PQ (CourseID, PQCourseId) CourseSchedule CS (SDbldg, SDroom, SDtime, SDdays) - Building+Room+Time+Days ASSUMPTION: Multiple courses may have not have some common classes i.e., we cannot have students from Software Engineering course gate crashing a few OOdesign classes :) Enrollment EN (StudentTermId, CourseTermSectionId) For the test driver application, I am hoping to do it in two stages Stage 1: Hardcoded values inside the test program to - add new records for students, faculty, enrollment, ... after making sure the candidate keys dont already exist (I will hardcode some data here also until the ckeyValueListExists() imlpementations get ready) - search records given various key attributes Stage 2: Attempt to use a command file that can specify simple cmomands such as 'SEARCH', 'ADD', etc. to perform similar functions as above. Prof. Lechner - Please let me know what you think of this approach. Thanks, Nitin. ----Schema file "assign3.sch"---- /* $CASE/gen/ver_13/chgen/test/metaschema/metaschema.sch - RJL060903 */ /* Re-chedked out from $GENROOT by SchemaVersion SV /* sv_type - schema version, data, path, applications? */ { SVid SV000000 c8 1 /* primary key field */ PVid PJ000000 c8 0 /* Project Ref - non-key field for now */ svname NA t30 0 /* schema name [and version?] */ sformat TBD c6 0 /* schema format: CHGEN or GENDB[?] */ sversion 0.0 t12 0 /* schema tag or version (rev# i.j...? */ lastMod 000000 i4 0 /* date of last mod: yymmdd */ svpath NA t80 0 /* full path prefix or $DEFINED-SYMBOL */ descr NA t80 0 /* e.g., list of schema applications? */ } TableType TT /* tt_type - table description and child-set of attributes*/ { TTid TT000000 c8 1 /* primary key field */ SVid SV000000 c8 1 /* SVid is foreign key */ ttabb NA c5 0 /* 2 or 4 UCLetters */ ttname NA t30 0 /* table name */ descr NA t80 0 /* descriptive comment (tablepurpose) */ } TableAttribute TA /* ta_type - scalar or ref attribute of parent table */ { TAid TA000000 c8 1 /* primary key field */ TTid TT000000 c8 1 /* TTid is foreign key */ fname NA c30 0 /* field name (column header) */ dfltVal NA t30 0 /* default value (was altName) */ ftype I4 c10 0 /* field type (I4/F4/c##,t###/k8/k12) */ iskey 0 c4 0 /* 0:nonkey; 1/-1:pfkey; s:superClassRef */ comment // t132 0 /* descriptive comment (units/range?) */ } ViewVersion VV /* vv_type - subset of tables in this view */ { VVid VV000000 c8 1 /* primary key field */ SVid SV000000 c8 1 /* SV foreign key field */ vname schema t30 0 /* view name (schema = all tables) */ mode r c2 0 /* mode (r/w/u) */ num_tables 0 i2 0 /* number of tables in View */ } TableStatistics TS /* ts_type - statistics about this Table in View */ { TSid TS000000 c8 1 /* primary key field */ VVid VV000000 c8 1 /* fkey to ViewVersion for this TSrow */ TTid TT000000 c8 1 /* fkey to TTrow for this TSrow */ verno 0 i2 0 /* version number of TT in VV */ maxrow 0 i2 0 /* max row# in this table and VV */ vvrowcnt 0 i2 0 /* row-count of this TT in parent VV only*/ } CandidateKeys CK /* ck_type - candidate keys on parent table */ { CKid CK000000 c8 1 /* primary key field */ TAid TA000000 c8 1 /* fkey to table for this CKrow */ descr NA t30 0 /* description of the candidate key */ } CandidateKeyAttributes CA /* ca_type - various attributes of a candidate key */ { CAid CA00000 c8 1 /* primary key field */ CKid CK00000 c8 1 /* fkey to the candidate key for this set of attributes */ TAid TA00000 c8 1 /* fkey to the table attribute that forms this candidate key */ } /* SISrev061011.sch in $CASE/02f522/SISProj/rjl_test - RJL061011 */ /* adapted from $CASE/02f522/SISProj/rjl_test/SIS.sch - RJL061011 */ /* (CourseTermSection was StudTermSe=ST, ENrollment=EN was ET, CS-->EN was CT-->EN)) */ /* added fields: CO.CourseNo, DE.deptNo, CS.sectionNo, AA.studentId */ /* topologically sorted into 5 levels */ /* Candidate Keys for Department */ /* (DeptNumber) */ /* (DeptName) */ /* Perhaps also (DeptHeadName) */ Department DE /* Department Table */ { DEid NodeID c8 1 /* dEPARtment ID Primary Key */ deptNo DeptNumber i2 0 /* Uinversity-aqsssigned Number(e.g. 91) DEhead DeptHeadName c30 0 /* Name of Dept Head ()*/ DEname DeptName t60 0 /* Department Name (e.g. CompuerScience */ } /* Candidate Keys for Student * /* studentId */ Student AA /* Student Attribute Table */ { AAid NodeID c8 1 /* Student ID Primary Key */ DEid DeptNumber c8 1 /* Created via linked parent */ AAgpa AAgpa f4 0 /* Cumulative GPA, was f5 */ studentId studentIdNumber i4 0 /* assigned by University */ AAsnm AAstudname c32 0 /* Student Name () */ } /* (TMName) */ Term TM /* Term or Semester Table */ { TMid semesterId c8 1 /* Semester ID Primary Key */ TMname TMName c15 0 /* Sem. Name, e.g. 06f */ } Faculty FY /* Faculty Table */ { FYid facultyId c8 1 /* Faculty ID Primary Key */ DEid DeptId c8 1 /*Created via linked parent*/ FYnm facyName c32 0 /* Faculty Name () */ } /* Candidate Key Course */ /* (DeptId, courseNo) */ Course CO /* Course Table, independent of Term */ { COid NodeID c8 1 /* Course ID Primary Key */ DEid DeptId c8 1 /*Created via linked parent*/ courseNo courseNo i2 0 /* cousre number (Dept.-assigned) COtitle COtitle t24 0 /* Course Title */ } /* Candidate Key address */ /* (StudentID) */ Address AD /* Student Addresse Table, was AA-AD */ { ADid NodeID c8 1 /* Address ID Primary Key */ AAid StudentID c8 1 /*Created via linked parent*/ ADcity ADcity c13 0 /* City */ ADstat ADstate c2 0 /* State */ ADzip ADzip c9 0 /* Zip Code */ ADctry ADcountry c2 0 /* Country */ ADstree ADstreet t60 0 /* StreetAddress (blanks OK; was c30 )*/ } /* Candidate Key StudentTerm */ /* (StudentID, TermId) */ StudentTerm RT /* Student- Term Table */ { RTid RegisteredTermId c8 1 /* Student-term ID Primary Key*/ AAid StudentId c8 1 /*Created via linked parent */ TMid TermId c8 1 /*Created via linked parent */ RTattem RTattempted i2 0 /* credits attempted*/ RTearne RTearned i2 0 /* credits earned */ RTgpa RTCumGPA f4 0 /* Current GPA */ } /* Candidate Key CourseTermSection */ /* (FacultyID, TermId, CourseID) */ CourseTermSection CT /* Course-Term-Section Table*/ { CTid CTid c8 1 /* StudTermSe ID Primary Key*/ TMid TermID c8 1 /*Created via linked parent */ FYid FacultyID c8 1 /*Created via linked parent */ COid CourseID c8 1 /*Created via linked parent*/ CTmax CTmax i4 0 /* Maximum Enrollment */ CTmin CTmin i4 0 /* Minimum Enrollment */ CTcur CTcurrent i4 0 /* Current Enrollment */ CTstatu CTstatus c1 0 /* section status */ sectionNo sectionNo i2 0 /* section number (univ.-assigned) */ } /* (CourseID, PQcourseID) */ PreReqLinK PQ /* Prerequisite Table */ { PQid PQid c8 1 /* PreReqlink ID Primary Key*/ COid1 CourseID c8 1 /*Created via linked parent*/ COid2 PQcourseID c8 1 /* pre-requisite course ID */ } /* (Building, Room, Time, Days) */ CourseSchedule CS /* CourseScheduleTerm, was STSD*/ { CSid CSid c8 1 /*Course- Sched ID Primary Key*/ CTid CTid c8 1 /* Created via linked parent */ SDdays SDdays c3 0 /* Lecture Day like MWF */ SDtime SDtime c6 0 /* Lecture Time like 430PM */ SDbldg SDbldg c3 0 /* Building */ SDroom SDroom c3 0 /* Room */ } /* (StudentTermId, CourseTermSectionId) */ Enrollment EN /* Enrollment Table (was EN, was RTSP, was before CS) */ { ETid ETid c8 1 /* Enrollment ID Primary Key*/ RTid StudentTermId c8 1 /*Created via linked parent */ CSid CourseTermSectionId c8 1 /*Created via linked parent */ SPcred SPcredits i4 0 /* Credits */ SPgrad SPgrade c3 0 /* Grade*/ sectionNo sectionNo i2 0 /* sectionNumber (univ.-assigned)*/ } __._,_.___ Messages in this topic ( 1) Reply (via web post) | Start a new topic Messages| Files| Photos| Links| Database| Polls| Members| Calendar [image: Yahoo! Groups] Change settings via the Web(Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest| Switch format to Traditional Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe Recent Activity - 5 New Members Visit Your Group SPONSORED LINKS - Education - College education - Business education - Distance education - Education degree Yahoo! Mail Drag & drop With the all-new Yahoo! Mail Beta Y! Messenger Instant hello Chat over IM with group members. New business? Get new customers. List your web site in Yahoo! Search. . __,_._,___ ------=_Part_35031_8474324.1160834573911 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Prof. Lechner,

Not sure if you've signed up to the YahooGroup that Keith setup. Here is an email I sent earlier today w.r.t the test driver.

Thanks,
Nitin.

---------- Forwarded message ----------
From: nitinsonawane <nitin.sonawane@verizon.net>
Date: Oct 14, 2006 8:52 AM
Subject: [UML_CS522_f2006_OOA] Thoughts on the test driver
To: UML_CS522_f2006_OOA@yahoogroups.com

Hello,

Please find attached the .sch file (essentially a concatenated version
of student.sch and metaschemaCK.sch) that we can use for this assignment.

Here is an attempt at the various candidate keys for the tables in this
schema. I have also added some assumptions (that help simplify things but
may not be true in the real world).

Feedback is greatly appreciated

Deptarment DE
(DeptNumber)
(DeptName)
(DeptHeadName)
ASSUMPTION: There is one department a person can head.

Student AA
(StudentIdNumber)

Term TM
(TMName)

Faculty FY
(DeptId, FacyName)

Course CO
(DeptId, CourseNo)

StudentAddress AD
(StudentID)

StudentTerm RT
(StudentId, TermId)

CourseTermSection CT
(FacultyId, TermId, CourseId)
ASSUMPTION: A faculty member will teach one course in only one
section
in any given term?.
If this assumption is not acceptable, then we can add
sectionNo to the candidate key

Prerequisite PQ
(CourseID, PQCourseId)

CourseSchedule CS
(SDbldg, SDroom, SDtime, SDdays) - Building+Room+Time+Days
ASSUMPTION: Multiple courses may have not have some common classes
i.e., we cannot have students from Software Engineering course
gate
crashing a few OOdesign classes :)

Enrollment EN
(StudentTermId, CourseTermSectionId)

For the test driver application, I am hoping to do it in two stages

Stage 1: Hardcoded values inside the test program to
- add new records for students, faculty, enrollment, ... after making
sure the candidate keys dont already exist (I will hardcode some
data here also until the ckeyValueListExists() imlpementations get
ready)
- search records given various key attributes

Stage 2: Attempt to use a command file that can specify simple cmomands
such as 'SEARCH', 'ADD', etc. to perform similar functions as above.

Prof. Lechner - Please let me know what you think of this approach.

Thanks,
Nitin.

----Schema file "assign3.sch"----

/* $CASE/gen/ver_13/chgen/test/metaschema/metaschema.sch - RJL060903 */
/* Re-chedked out from $GENROOT by
SchemaVersion SV /* sv_type - schema version, data, path, applications? */
{
SVid SV000000 c8 1 /* primary key field */
PVid PJ000000 c8 0 /* Project Ref - non-key field
for now */
svname NA t30 0 /* schema name [and version?]
*/
sformat TBD c6 0 /* schema format: CHGEN or
GENDB[?] */
sversion 0.0 t12 0 /* schema tag or version (rev#
i.j...? */
lastMod 000000 i4 0 /* date of last mod: yymmdd */
svpath NA t80 0 /* full path prefix or
$DEFINED-SYMBOL */
descr NA t80 0 /* e.g., list of schema
applications? */
}
TableType TT /* tt_type - table description and child-set of
attributes*/
{
TTid TT000000 c8 1 /* primary key field */
SVid SV000000 c8 1 /* SVid is foreign key */
ttabb NA c5 0 /* 2 or 4 UCLetters */
ttname NA t30 0 /* table name */
descr NA t80 0 /* descriptive comment (table
purpose) */
}
TableAttribute TA /* ta_type - scalar or ref attribute of parent table */
{
TAid TA000000 c8 1 /* primary key field */
TTid TT000000 c8 1 /* TTid is foreign key */
fname NA c30 0 /* field name (column header)
*/
dfltVal NA t30 0 /* default value (was altName) */
ftype I4 c10 0 /* field type
(I4/F4/c##,t###/k8/k12) */
iskey 0 c4 0 /* 0:nonkey; 1/-1:pfkey;
s:superClassRef */
comment // t132 0 /* descriptive comment
(units/range?) */
}

ViewVersion VV /* vv_type - subset of tables in this view */
{
VVid VV000000 c8 1 /* primary key field */
SVid SV000000 c8 1 /* SV foreign key field */
vname schema t30 0 /* view name (schema = all tables) */
mode r c2 0 /* mode (r/w/u) */
num_tables 0 i2 0 /* number of tables in View */
}
TableStatistics TS /* ts_type - statistics about this Table in View */
{
TSid TS000000 c8 1 /* primary key field */
VVid VV000000 c8 1 /* fkey to ViewVersion for this
TSrow */
TTid TT000000 c8 1 /* fkey to TTrow for this TSrow
*/
verno 0 i2 0 /* version number of TT in VV
*/
maxrow 0 i2 0 /* max row# in this table and VV
*/
vvrowcnt 0 i2 0 /* row-count of this TT in parent
VV only*/
}
CandidateKeys CK /* ck_type - candidate keys on parent table */
{
CKid CK000000 c8 1 /* primary key field */
TAid TA000000 c8 1 /* fkey to table for this CKrow */
descr NA t30 0 /* description of the candidate
key */
}
CandidateKeyAttributes CA /* ca_type - various attributes of a
candidate key */
{
CAid CA00000 c8 1 /* primary key field */
CKid CK00000 c8 1 /* fkey to the candidate key for
this set of attributes */
TAid TA00000 c8 1 /* fkey to the table attribute
that forms this candidate key */
}

/* SISrev061011.sch in $CASE/02f522/SISProj/rjl_test - RJL061011 */
/* adapted from $CASE/02f522/SISProj/rjl_test/SIS.sch - RJL061011 */
/* (CourseTermSection was StudTermSe=ST, ENrollment=EN was ET, CS-->EN
was CT-->EN)) */
/* added fields: CO.CourseNo, DE.deptNo, CS.sectionNo, AA.studentId */
/* topologically sorted into 5 levels */

/* Candidate Keys for Department */
/* (DeptNumber) */
/* (DeptName) */
/* Perhaps also (DeptHeadName) */
Department DE /* Department Table */
{
DEid NodeID c8 1 /* dEPARtment ID
Primary Key */
deptNo DeptNumber i2 0 /*
Uinversity-aqsssigned Number(e.g. 91)
DEhead DeptHeadName c30 0 /* Name of Dept Head
(<last,first>)*/
DEname DeptName t60 0 /* Department Name
(e.g. CompuerScience */
}

/* Candidate Keys for Student *
/* studentId */

Student AA /* Student Attribute Table */
{
AAid NodeID c8 1 /* Student ID Primary Key */
DEid DeptNumber c8 1 /* Created via linked
parent */
AAgpa AAgpa f4 0 /* Cumulative GPA, was f5 */
studentId studentIdNumber i4 0 /* assigned by University */
AAsnm AAstudname c32 0 /* Student Name
(<last,first>) */
}

/* (TMName) */
Term TM /* Term or Semester Table */
{
TMid semesterId c8 1 /* Semester ID
Primary Key */
TMname TMName c15 0 /* Sem. Name, e.g. 06f */
}

Faculty FY /* Faculty Table */
{
FYid facultyId c8 1 /* Faculty ID
Primary Key */
DEid DeptId c8 1 /*Created via
linked parent*/
FYnm facyName c32 0 /* Faculty Name
(<last,first>) */
}

/* Candidate Key Course */
/* (DeptId, courseNo) */
Course CO /* Course Table, independent of Term */
{
COid NodeID c8 1 /* Course ID
Primary Key */
DEid DeptId c8 1 /*Created via
linked parent*/
courseNo courseNo i2 0 /* cousre number
(Dept.-assigned)
COtitle COtitle t24 0 /* Course Title */
}

/* Candidate Key address */
/* (StudentID) */

Address AD /* Student Addresse Table, was AA-AD */
{
ADid NodeID c8 1 /* Address ID Primary Key */
AAid StudentID c8 1 /*Created via linked parent*/
ADcity ADcity c13 0 /* City */
ADstat ADstate c2 0 /* State */
ADzip ADzip c9 0 /* Zip Code */
ADctry ADcountry c2 0 /* Country */
ADstree ADstreet t60 0 /* StreetAddress (blanks
OK; was c30 )*/
}

/* Candidate Key StudentTerm */
/* (StudentID, TermId) */

StudentTerm RT /* Student- Term Table */
{
RTid RegisteredTermId c8 1 /* Student-term ID
Primary Key*/
AAid StudentId c8 1 /*Created via linked
parent */
TMid TermId c8 1 /*Created via linked
parent */
RTattem RTattempted i2 0 /* credits attempted*/
RTearne RTearned i2 0 /* credits earned */
RTgpa RTCumGPA f4 0 /* Current GPA */
}

/* Candidate Key CourseTermSection */
/* (FacultyID, TermId, CourseID) */

CourseTermSection CT /* Course-Term-Section Table*/
{
CTid CTid c8 1 /* StudTermSe ID
Primary Key*/
TMid TermID c8 1 /*Created via
linked parent */
FYid FacultyID c8 1 /*Created via
linked parent */
COid CourseID c8 1 /*Created via
linked parent*/
CTmax CTmax i4 0 /* Maximum
Enrollment */
CTmin CTmin i4 0 /* Minimum
Enrollment */
CTcur CTcurrent i4 0 /* Current
Enrollment */
CTstatu CTstatus c1 0 /* section
status */
sectionNo sectionNo i2 0 /* section
number (univ.-assigned) */
}

/* (CourseID, PQcourseID) */
PreReqLinK PQ /* Prerequisite Table */
{
PQid PQid c8 1 /* PreReqlink ID
Primary Key*/
COid1 CourseID c8 1 /*Created via linked
parent*/
COid2 PQcourseID c8 1 /* pre-requisite
course ID */
}

/* (Building, Room, Time, Days) */
CourseSchedule CS /* CourseScheduleTerm, was STSD*/
{
CSid CSid c8 1 /*Course- Sched ID
Primary Key*/
CTid CTid c8 1 /* Created via linked
parent */
SDdays SDdays c3 0 /* Lecture Day like
MWF */
SDtime SDtime c6 0 /* Lecture Time like
430PM */
SDbldg SDbldg c3 0 /* Building */
SDroom SDroom c3 0 /* Room */
}

/* (StudentTermId, CourseTermSectionId) */
Enrollment EN /* Enrollment Table (was EN, was RTSP, was
before CS) */
{
ETid ETid c8 1 /* Enrollment ID Primary
Key*/
RTid StudentTermId c8 1 /*Created via linked
parent */
CSid CourseTermSectionId c8 1 /*Created via linked
parent */
SPcred SPcredits i4 0 /* Credits */
SPgrad SPgrade c3 0 /* Grade*/
sectionNo sectionNo i2 0 /* sectionNumber
(univ.-assigned)*/
}

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Mail

Drag & drop

With the all-new

Yahoo! Mail Beta

Y! Messenger

Instant hello

Chat over IM with

group members.

New business?

Get new customers.

List your web site

in Yahoo! Search.

.

__,_._,___
------=_Part_35031_8474324.1160834573911--