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

Algorithm to count number of nodes, Write an algorithm to count number of n...

Write an algorithm to count number of nodes in the circular linked list.                            Ans. Counting No of Nodes in Circular List Let list be a circular h

Define the term - array, Define the term - Array A fixed length, ord...

Define the term - Array A fixed length, ordered collection of values of same type stored in contiguous memory locations; collection may be ordered in several dimensions.

Develop a material requirements plan, The below figure illustrates the BOM ...

The below figure illustrates the BOM (Bill of Materials) for product A. The MPS (Material requirements Planning) start row in the master production schedule for product A calls for

Find error for curious number, #include #include int sumFact(int numb);...

#include #include int sumFact(int numb); int calculateFactorial(int digit); main() { int numb, sumfact; do{ printf ("Enter a number 1 to 9999\n"); scanf("%

Sequential files, In this section, we will discuss about Sequential file or...

In this section, we will discuss about Sequential file organization. Sequential files have data records stored in a particular sequence. A sequentially organized file might be stor

Advantages of dry running a flowchart, Advantages of dry running a flowchar...

Advantages of dry running a flowchart When dry running a flowchart it's advisable to draw up a trace table illustrating how variables change their values at every stage in the

Two-dimensional array, Two-dimensional array is shown in memory in followin...

Two-dimensional array is shown in memory in following two ways:  1.  Row major representation: To achieve this linear representation, the first row of the array is stored in th

Steps of pre-order traversal, Pre-order Traversal The method of doing a...

Pre-order Traversal The method of doing a pre-order traversal iteratively then has the several steps(suppose that a stack is available to hold pointers to the appropriate nodes

Homework, Write a recursive function the computes the number of digits in a...

Write a recursive function the computes the number of digits in a positive integer n. For example if n = 6598, the function should return 4. Find a variant expression and a thresho

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