Physical database design and sql queries, Data Structure & Algorithms

In this part, students are allowed to implement the following simplifications in their table and data design.

o Availability for the beauty therapists don't have to be considered. That is, you don't have to worry about whether a therapist works only on Mondays, or if she is going away for a whole month, or anything like these. Hence the therapists can be assumed to be available all the time other than those time slots already booked by someone.

o ActivityVenue for all the beauty therapists can be assumed to be limited to the same beauty parlour alone; hence the activity venue essentially doesn't have to be considered.

o Every customer is assumed to have a client profile created or set up with the beauty parlour before any bookings can be made or any services can be provided to the customer.

5. Create the database tables in SQL (runnable on the School's Microsoft SQL Server) for all the relations in your relation diagram, and enforce there all the relevant constraints including primary keys and foreign keys. Fill the tables with sufficient data - generally around 4 tuples or more per table, but should be sufficient to illustrate meaningfully the working of the general queries to be completed below. (3 marks)

6. Write in SQL the commands to complete the following queries, and show your results in screenshots. Screenshots of active windows (under Microsoft Windows) can be obtained by pressing CTRL-ALT-PRTSC keys together. (4 marks)

o (a) Write a drop table statement so that its execution will delete all the tables you have created for this assignment. No partial mark will be given for this part, if the statement doesn't do the complete job.
WARNING: Before you test this, you must first make sure that you have saved all the statements for the table creation and the record insertion etc in a separate SQL 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 saved SQL script. If you are not sure, don't to this part.

o (b) List all the client names and their corresponding telephone numbers.

o (c) For all the beauty therapists who hold one or more qualifications, list the therapist names and their corresponding qualifications.

o (d) For a given day, say, 2011-11-11, list all the names of the therapists who have/had at least one booking/appointment on that day. Don't repeat the names in the list.

o (e) For a given therapist name, list all bookings she has for the clients this year of 2011. The list should contain the client names, the corresponding start and finish time of the appointments, and the status of the appointments (e.g. if an appointment is pending, cancelled, or completed).

o (f) List all the itemed services along with the therapists who can provide such services. The list should be sorted alphabetically in the service names.

o (g) (Advanced Features) List all the bookingNo, the corresponding client, and the total cost of the itemed services made in the booking. The total cost must be recalculated from all the relevant itemed services.

o (h) (Advanced Features) List all the bookingNo, the corresponding client, and the total cost of all the services associated with the booking. The total cost must be recalculated from all the relevant itemed and timed services.

Posted Date: 3/26/2013 1:45:39 AM | Location : United States







Related Discussions:- Physical database design and sql queries, Assignment Help, Ask Question on Physical database design and sql queries, Get Answer, Expert's Help, Physical database design and sql queries Discussions

Write discussion on Physical database design and sql queries
Your posts are moderated
Related Questions
What is quick sort? Quick sort is a sorting algorithm that uses the idea if split and conquer. This algorithm chooses an element called as pivot element; search its position in

Q. Let a binary tree 'T' be in memory. Write a procedure to delete all terminal nodes of the tree.       A n s . fun ction to Delete Terminal Nodes from Binary Tree

Q. Define a method for keeping two stacks within a single linear array S in such a way that neither stack overflows until entire array is used and a whole stack is never shifted to

Question 1 Explain the use of algorithms in computing Question 2 Explain time complexity and space complexity of an algorithm Question 3 Explain how you can analyz

Comparison Techniques There are several techniques for determining the relevancy and relative position of two polygons. Not all tests may be used with all hidden-surface algori

Implementations of Kruskal's algorithm for Minimum Spanning Tree. You are implementing Kruskal's algorithm here. Please implement the array-based Union-Find data structure.

What is Algorithm A finite sequence of steps for accomplishing some computational task. An algorithm should Have steps which are simple and definite enough to be done

what are the disadvantages of sparse matrix?

Warnock's Algorithm A divide and conquer algorithm Warnock (PolyList PL, ViewPort VP) If (PL simple in VP) then Draw PL in VP, else Split VP vertically and horiz

Write an algorithm to print all even numbers in descending order and draw the flowchart