List of Commands ---------------- The numbered items below show the INPUT command format (one command per line in input file) The output format on screen should be as follows (if successful): SUCCESS [required output] (if failure): FAILURE reason "required output" is whatever is supposed to be the result of a command. For instance if the command is to get grades for a student, then the required output will contain lines containing the following information: curent semester, student name, id, list of courses with grade and instructor grouped by sem, etc. (see section 3.2.V.D) "reason" is a short description of the failure. There is no fixed format for the "reason" string, you may choose any short description depending on the type of errors that a command may cause. See the detailed description in 3.2.V for cases when the command may fail. A few sample errors will be listed below each command. For a more detailed list of failure conditions you should read the requirements for that command in the book. 1) AUTHENTICATE Id Password reason: invalid user reason: invalid password reason: system locked You may assume that only one user (a student or faculty) can be using the system at any given time, i.e., after authentication until end of session no other user can log on. Thus the third error above indicates that the system is locked by some other user who has not logged off yet. see 3.2.V.A 2) REGISTER CrsCode //i.e., register current user for crscode reason: user not a student reason: registration exceeds max reason: prereq not satisfied reason: prereq not finished with a C see 3.2.V.B 3) DEREGISTER CrsCode reason: not student reason: not registered see 3.2.V.C 4) GETGRADES [Id] //Id (for student) is required only if a faculty member issues this command //else Id is not specified directly; it can be obtained from the student table //by checking the username and password of the current sutdent user reason: no Id specified (if user is a faculty) reason: Id not valid (if user is a faculty) If successful output should contain information requested in section 3.2.V.D 5) GETREGISTERED [Id] Same comments about Id as for command 4) above if successful output should have the info asked in 3.2.V.E 6) GETENROLLED [Id] Same comments about Id as for command 4) above if successful output should have the info asked in 3.2.V.F 7) SETGRADE Id CrsCode Semester Grade reason: not faculty reason: not instructor // note only instrucotr for a course can set grade reason: cannot change to I //dynamic constraint see 3.2.V.G for details 8) USERINFO ADD/EDIT/DELETE Id [Name="n" Status=s Password=p] //There are three possible types of USERINFO commands // Name will be given in quoes as "Last, First" // ADD in this case Id, Name=n, Status=s, Password=p must all be given // EDIT Id // //e.g. USERINFO EDIT 111 Name="Pasternak, John" Password=xyzxyz // This keeps the old Status for 111 // DELETE Id //remove user specified by Id reason: not faculty //only faculty may issue this command etc. see 3.2.V.H 9) COURSEINFO ADD/EDIT/DISPLAY CrsCode [CurrentClassId=cci NextSemClassId=nsci CrsName=cn DeptId=d CreditHrs=ch SemesterOffered=sem TextBook="t" Prereq=p Enrolled=e Registered=r MaxEnrollment=me ClassTime=ct InstructorId=i] //Textbook will be in quotes, e.g., Textbook="Intro to DB, Date" There are three subcases for COURSEINFO relating to a) course info, b) current semester's class info and c) next semester's class info CASE I: //info about a course (independent of semester) ADD CrsCode [CrsName=cn, DeptId=d, CreditHrs=ch, SemesterOffered=sem Prereq=p] EDIT CrsCode [CrsName=cn, DeptId=d, CreditHrs=ch, SemesterOffered=sem Prereq=p] //for add/edit of a course, only the options mentioned above make sense. DISPLAY CrsCode //show all fields of a course //Assume that one can only add prereqs and not delete them for //simplicity. So if I have to add multipe prereqs I will specify then //via the first ADD and then via subsequent EDIT commands. //Example: COURSEINFO ADD CS6666 // COURSEINFO EDIT CS6666 Prereq=CS5555 // COURSEINFO EDIT CS6666 Prereq=CS4444 CASE II: //course info about current semester //if CurrentClassId field is present then you can automatically assume //that the query is about current semester EDIT CrsCode CurrentClassId=cci [TextBook=t ClassTime=ct InstructorId=i MaxEnrollment=me] DISPLAY CrsCode CurrentClassId=cci //show all info about current course ADD CrsCode CurrentClassId=cci //this is an error, one cannot add a course //to the current semester. ADD can only apply //to the next semester. CASE III: //course info about next semester //if NextSemClassId field is present then you can automatically assume //that the query is about next semester ADD CrsCode NextSemClassId=nsci [TextBook=t ClassTime=ct InstructorId=i MaxEnrollment=me] EDIT CrsCode NextSemClassId=nsci [TextBook=t ClassTime=ct InstructorId=i MaxEnrollment=me] DISPLAY CrsCode CurrentClassId=cci //show all info about current course Note that the different options specified are the ones that will be added or edited by setting the value specified. Not all of them have to be specified, some can be omitted. The types of errors will depend on which constraints or requirements are violated by a given ADD or EDIT command. In summary, if I just specify CrsCode in isolation the command refers to a course. If I also specify the CurrentClassId=cci then the information refers to current semester's course, and finally if I specify NextSemClassId then the command applies to next semester's course offering. If I have both CurrentClassId and NextSemClassId it is an error. It is also an error if I give the wrong class id (cci or nsci) in an edit command, etc. reason: attempt to ADD/EDIT invalid //(user is a student) see 3.2.V.I 10) ENDSEMESTER reason: not faculty see 3.2.V.J for details 11) CLASSROSTER ENROLLED/REGISTERED CrsCode //show who is ENROLLED for the course currently //show who is REGISTERED for the course next semester reason: not faculty reason: course not offered currently (for ENROLLED) reason: course not offered next semester (for REGISTERED) see 3.2.V.K 12) CLASSINFO ADD/DISPLAY ClassId [Size] //output: show the class Size if DISPLAY for a given ClassId //else ADD the classid with size given reason: not faculty reason: no such classroom see 3.2.V.L 13) OLAP "Any SELECT Query" //e.g. OLAP "SELECT * FROM student" reason: not faculty reason: not a SELECT reason: invalid or incorrect select query see 3.2.V.M 14) ENDSESSION //log off the current user see 3.2.V.N