Physical database design and sql queries, Data Structure & Algorithms

Assignment Help:

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.


Related Discussions:- Physical database design and sql queries

Explain what is stack. describe ways to execute stack. , ST AC K is ...

ST AC K is explained as follows : A stack is one of the most usually used data structure. A stack is also called a Last-In-First-Out (LIFO) system, is a linear list in

Explain stacks, What are stacks? A stack is a data structure that organ...

What are stacks? A stack is a data structure that organizes data similar to how one organizes a pile of coins. The new coin is always placed on the top and the oldest is on the

Explain depth-first traversal, Depth-first traversal A depth-first t...

Depth-first traversal A depth-first traversal of a tree visit a node and then recursively visits the subtrees of that node. Likewise, depth-first traversal of a graph visits

Algorithm, what algorithms can i use for the above title in my project desi...

what algorithms can i use for the above title in my project desing and implmentation of road transport booking system

Lilz, I need to know about data structure and algorithms. can you help me?

I need to know about data structure and algorithms. can you help me?

Circular linklist, write an algorithm to insert an element at the beginning...

write an algorithm to insert an element at the beginning of a circular linked list?

State about the simple types - built-in types, State about the Simple types...

State about the Simple types - Built-In Types Values of the carrier set are atomic, that is, they can't be divided into parts. Common illustrations of simple types are inte

Explain th term input and output- pseudocode, Explain th term input and ou...

Explain th term input and output-  Pseudocode Input and output indicated by the use of terms input number, print total, output total, print "result is" x and so on.

All pairs shortest paths, N = number of rows of the graph D[i[j] = C[i][...

N = number of rows of the graph D[i[j] = C[i][j] For k from 1 to n Do for i = 1 to n Do for j = 1 to n D[i[j]= minimum( d ij (k-1) ,d ik (k-1) +d kj (k-1)

Compute the shortest paths to all network nodes, (i)  Consider a system usi...

(i)  Consider a system using flooding with hop counter. Suppose that the hop counter is originally set to the "diameter" (number of hops in the longest path without traversing any

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd