markingguide.pdf

Upload: christopher-miller

Post on 02-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 markingguide.pdf

    1/6

    ASSIGNMENT TWO 15 marksDue Friday 31/10/2014 at 5pm

    This assignment should be done in a group of no more than 2 students.

    This assignment needs to be completed in a group of no more than 2 student members. If such a group isformed, both members must come from the same campus, and also within the tutorial classes of thesametutorwhenever possible. While lecturers and tutors will help as much as they can, it is essentially eachstudent's own motivation and responsibility to form a group for this assignment. By default, each student isworking in a group containing a single member of himself.

    Students enrolled in 300941 - Database Design and Development (Advanced) must also complete theadvanced part 2by the same due date.

    For all database queries in this assignment, students need to construct their SQLstatements directly, not through the use of GUI.

    Database Design and SQL Queries

    In assignment 1, you have alreadystarted the process of designing adatabase for the Instant Recruitmentmini-case (enclosed again below),

    mainly in thephase of conceptualdatabase design, and a draft ERdiagram has been created for this

    purpose. Here you will further refineyour database design for the otherdesign phases.

    In this assignment, you will inparticular complete the logical designthrough the normalisation process,have it physically implemented,

    perform a few important queries in

    SQL, and evaluate or verify thedatabase integrity. Your design ofrelational model should be done insuch a way that business rules anddata integrity are ensured by the intrinsic designof the database as much as possible.

    Logical Database Design (5 marks)

    1. For the ER diagram you created in assignment 1, the artefact of the conceptual database design, mapthe ER model into the relational model according to how it was designed in the ER diagram. You mayhowever first refine or completely re-do your ER diagram if necessary, and you are allowed to make

    use of any part of our above displayed ER diagram skeleton to incorporate into your design in any wayyou like if you feel your original design is not in a state to be implementedlater. The actualassessment of this part is in the point 4 below. While there can be a variety of acceptable designs, wehere attach one simplistic rough sketch for the comparison purpose.

    2. Consider a greatly simplified core recruitment system whose ER diagram is shown on the right.

    https://staff.scem.uws.edu.au/~zhuhan/current/assignments/advanced/advanced2.htmlhttps://staff.scem.uws.edu.au/~zhuhan/current/assignments/advanced/advanced2.html
  • 8/10/2019 markingguide.pdf

    2/6

    Draw the correspondingGRD, exhibiting all the

    primary keys and foreignkeys. For simplicity, noother attributes normultiplicity constraintsare required.Are the tables in the GRDall in 3NF?

    For a particular casualjob, if none of the(registered) casual staffmeet the requirements onthe correspondingexpertise, will the primary key or foreign key constraints in your GRD prevent the databasesystem from assigning an unqualified casual to the job? Briefly explain why.

    (1 mark)3. For all the relations that arise from the ("first-cut") full ER diagram (which could be your original

    design, or a design modified from your original or from the above given "simplistic design"), list allthose (in schemas) that are already in 3NF. If there are some relations that are notin 3NF yet, list them

    as well. (1 mark)4. Draw the global relation diagram for your final, revised, and normalised database design, and keep allthe relevant details there. It should be in a form similar to Figure 17.9(page 516) of the textbook, butall the attributes should be kept there too. Include in the diagram all the primary keys, foreign keys,and the multiplicity constraints. Identify and discuss the potential data redundancies or anomalies thatmay still exist in your design, if any. (3 marks)

    Note:On the top right of this whole document is one possible simplistic ER diagram for the mini-casefor the implementation. If your original ER diagram has a very poor design, then you may simply takethis ER diagram on the top right as if it were your own ER diagram and then proceed from there.

    Physical Database Design and SQL Queries (7 marks)For the physical implementation of the database, students are allowed to implement the followingsimplifications in their table and data design.

    Availabilityfor thecasual staff doesn't haveto be considered. That is,you don't have to worryabout whether a casualstaff works only onMondays, or if he or sheis going away for a wholemonth, or anything likethese. Hence the casualstaff can be assumed to

    be available all the timeother than those timeslots already booked bythis same recruitmentsystem for another casualwork.The job offer/acceptancetracking, or the

    negotiationbetween the School and the casuals, doesn't have to be considered. In other words,the ERD given at the top of this document would reduce to "a more simplistic design", the oneon the right.

    5. Create the database tables in SQL (runnable onthe School's Microsoft SQL Server) for all the

    https://staff.scem.uws.edu.au/~zhuhan/current/pracs/images/GRD-DreamHome.png
  • 8/10/2019 markingguide.pdf

    3/6

    relations in your relation diagram, and enforcethere all the relevant constraints including

    primary keys and foreign keys. Fill the tableswith sufficient data - generally around 4 tuplesor more per table, but should be sufficient toillustrate meaningfully the working of thegeneral queries to be completed below. List thecontent of your tables with screenshots.Screenshots of active windows (under

    Microsoft Windows) can be obtained bypressing CTRL-ALT-PRTSCkeys together,see the example on the right. Your screenshotsmust be readable and contain your username asin the above example, and you may list severaltables on a single screenshot as is the exampleon the right. (2.5 marks)

    6. Write in SQL the commands to complete thefollowing queries, and show your results inscreenshots. (4.5 marks)

    (a) Write a drop tablestatement so that

    its execution will delete all the tables youhave created for this assignment. Nopartial mark will be given for this part, ifthe statement doesn't do the complete job.(0.5 marks)

    WARNING:Before you test this, youmust first make sure that you have savedall the statements for the table creationand the record insertion etc in a separateSQL file saved outside the SQL Server.This is to ensure that after the drop table

    statement deletes everything, you can re-create everything by running your savedSQL script. If you are not sure, don'tto this part.

    (b) For all the casual staff, list their names and the corresponding mobile phone numbers. (0.6marks)(c) For all the casual staff who hold one or more qualifications, list their names and thecorresponding qualifications. (0.6 marks)(d) List who supervise which casual staff. (0.6 marks)(e) For all casual staff, list their expertise (i.e. the subjects each staff is familiar with), thecorresponding years of experience, and their self-rating on their competetiveness. Order theoutput in terms of the staff name, self rating and experience. (0.6 marks)(f) For a given date, say 1 Oct 2014, list all the casual positions for that day that are stillavailable, i.e. still under recruitment. (0.6 marks)(g) For a given date, say 1 Oct 2014, list all the casual positions for that day, which of those

    positions is staffed by whom, which are yet to be staffed, the teaching timeslot and the venue.The output should be properly sorted. (0.5 marks)(h) For all casual staff who have been recruited for a casual duty (of regulartype), calculate thetotal number of hours worked or to be worked each week for each category of the positions, andthe total number of weeks. (0.5 marks)

    Sophisticated Queries (3 marks)7. For each casual job, list all those casual staff who are suitable for the job, ignoring their availability for

    the timeslots. In other words, the suitability will not be affected by whether a casual can only work oncertain days or he has already got a commitment for another casual job in the School. (1 mark)

    8. For your final designed database, find a scenario in which a relatively prominent business data

    https://staff.scem.uws.edu.au/~zhuhan/current/assignments/assignment2/tables.pnghttps://staff.scem.uws.edu.au/~zhuhan/current/pracs/prac3/lab3l.png
  • 8/10/2019 markingguide.pdf

    4/6

    integrity can not be ensured by your current primary keys and foreign keys, nor by adding directlymore of such keys or check clauses in the created tables. In other words, the data integrity ensured bythe keys within the database may not be enough to ensure all the data integrity within the businesscontext. Write SQL statement/s that will determine if such a problem exists or not for any given stateof the database. (2 marks)

    9. A single plain-text file containing SQL statements for creating all the tables and making all the

    queries. The script should be executable on the School's Microsoft SQL Server, otherwise thecorresponding marks in the above listed items will be deducted accordingly. Marks will bedeductedfor the corresponding questions if this SQL script in plain-text file is not submitted.

    10. Each student must state explicitly who he or she once teamed up with if that person is not currently thegroup member for the submission, unless no shared work is involved. Students are not permitted tohave shared work for this assignment with more than one person (the team member) including

    potential former team member, unless approved by the unit coordinator in writing.

    Mini Case: Instant Recruitment

    Instant Recruitmentis a system to be designed to recruit casual staff under a very short notice, as well ason a more regular basis. For simplicity, this system will be limited to serving a large school at a universitywhere casual staff need to be recruited for lecturing, tutoring, and marking etc.

    Casual staff:Within the school's recruitment database, each candidate forcasual staff must provide their contact details in terms of home address,email address and mobile phone number, and must provide an estimatedtravel time to reach the school from home. These will be utilized or takeninto consideration when theInstant Recruitmentsystem suggests who to sendfirst the request to stand in for a regular staff who can't make it due to forinstance a sudden sickness. Each candidate has to specify a list of subjectsthey can teach, their relevant years of experience there, and their self-rated

    competitiveness or preference with the subject in the range of 0 to 10. Each candidate also needs to enlisttheir qualifications and the positions they are interested for the casual work.

    Positions:There can be different type of positions made available to the casuals, according to whether aposition is for lecturing, tutoring or marking etc. The casuals are paid on hourly basis according to theirpositions.

    Staff Request:When a casual staff is being requested or sought, it will be associated with a particularposition for the payment rate, and will specify certain expertise or subjects the casual staff should be familiarwith.

    Recruitment:Each casual staff is recruited to a specific academic position for a period of time to conduct

    the teaching activity at a given venue, and will be assigned to a relevant academic supervisor for theacademic liaison. For example, a casual staff may be urgently recruited to conduct a 2 hour lecture at acertain time on the day under a very short notice (hence an expressrecruitment), or may be employed to do 4hours at class tutoring each week during the semester (hence a regularrecruitment). For a regularrecruitment, a casual staff will be assigned a specific class venue and the number of hours to work therestarting from an allocated beginning time. The recruitment will also specify the number of weeks theappointed casual is to conduct the same activity at the same weekly time and venue. For an expressrecruitment, the system will first search the available casual staff and rank them according to their pastresponse time and their estimated travel time to reach the school. A school's administrative staff will usuallyselect one of the top recommendations to contact via phone or SMS or email. A staff request (i.e. a job offer)sent via an email or SMS to a casual staff will expire after a pre-selected amount of response time associated

    with this particular job, so that the admin can select the next candidate to contact for the casual position. Forany express recruitment, all the relevant communications between the school and the casual staff will berecorded and will be later analysed to calculate his or her average response time. In other words, therecruitment system needs to be able to track when a casual job is sent to whom, whether it is accepted orrejected, and at what time etc.

  • 8/10/2019 markingguide.pdf

    5/6

    Availability:Each casual staff may be available only on certain days of the week, and may also beunavailable for certain specific periods of days.

    Note on Submission

    This assignment must be submitted electronically via vUWS before the due date. No emailsubmissions will be accepted.

    It is the students' responsibility to retrieve and keep all their submission receipts. If in doubt, consultyour tutors well before the submission due date.Submitted files may be zipped together as a single zipfile (but not as a zipxfile), if a student wishesto do so. However, no other file compression or file archiving formats will be accepted for thesubmission.The electronic submission should contain the paper work in Microsoft Word, and the pertinent SQLsource code (say, named IR.sql) should be in a separate file and should be in theplain textformat.Otherwise 1 markmay be deducted for the missing separate SQL source file even if the code isalready contained in the main Word document.Please note that if your SQL source code gets rejected by the SQL Server at the School, youautomatically lose 50% of the marks allocated to that coding part.Each group must submit exactly one copy of their assignment solution electronically by one of the

    team members. If the other group member really wants to submit it as well due to whatever reasons,then the name of the submitted files must start with "please_ignore_" (such files will not be treatedas regular submissions and will be ignored during the marking). Otherwise 1 markmay be deductedfor the duplicated electronic submission.Each submission must be accompanied by a declaration of the ownership of the submitted work asdescribed in the unit outline and learning guide. No signature is however required for the electronicsubmissions. Please note that an examiner or lecturer/tutor has the right not to mark this assignment ifa pertinent declaration is not present in your submission.Late submissionswill attract a daily incremented late penalty of 10% per day.Electronic submission on thedue date after 5pm before 12 midnight will still be accepted without

    penalty. However, any submission failure in that period due to either the student faults or the fault or

    malfunction of the School's or UWS' servers will not be accepted as the legitimate reasons for a latesubmission. Beware that School's servers often need to be shut down for maintenance from lateFridays or just before public holidays.

    A statement on the work distribution in percentage (e.g. 50% for David and 50% for Louise) agreedamong all the group members. If this statement is absent, then it will be assumed that all groupmembers have made equal amount of contribution to the assignment solution. Achieving a 50%/50%work distribution is also the goal of this team work; the person who contributes less than 50% mayresult in having less mark than the other team member.Assignment group members should each maintain a constant, effective, and productive communicationwith their respective assignment partner, and should always have a contingency plan, the Plan B, forthe potential failure of the partnership no matter how impossible it may appear at the time. While

    partners will typically all do their best to contribute to the better understanding of the assignment,there can be unforseeable circumstances or misadventures that could result in an abortive terminationof the partnership. Hence it is each student's own responsibility to ensure that his or her partnership isworking, and he or she has a plan B for any potential partnership breakdown. This is a trade-off for allthe advantages of having an assignment partner. Hence please always keep a copy of everything aboutyour assignmentyourself. Failure of a partnership at any time will not be accepted as an execuse forthe failure to submit the assignment in time.Students are welcome to leave a hardcopy of their assignment 2 with their marking tutors directly, onany agreed terms between the students and the tutors, prior to their work being already marked, so thaton top of the regular feedback in the form of marking sheets additional and more concrete commentsor suggestions may be written back to the assignment work on the relevant spots. However, please

    bear in mind that the electronic submission is theofficial submission, submitting a hardcopy withoutsubmitting the electronic copy within the due date will be deemed NOT having submitted theassignment.

    Any student submitting the assignment on his own must state explicitly whether he was once in agroup with another student, and what part of the submitted work actually inherited from a previous

    http://policies.uws.edu.au/view.current.php?id=00227#min13
  • 8/10/2019 markingguide.pdf

    6/6

    joint team work. Failure to make this statement may result in this submission not being marked or aplagiarism case lodged if the work is similar to another student's, and a late addition of such astatement may lead to the assignment being considered as a late submission.The main purpose of having an assignment team is to enable students to discuss the database designwith another student so as to better understand everything there, rather than splitting the actual work.Hence, regardless of whether a team member contributed 100% or just 50%, the mark remains thesame. However, a team member may receive less marks if he contributes less than 50%.Students are expected to continue with their existing assignment group or form a new group if theyhaven't formed a group for Assignment 1. If any student is making a new assignment group, thus

    leaving a previous assignment group, he must first obtain a written approval from his tutor or the unitcoordinator, unless he will not make use of any work jointly done in the previous team work.