Database design and sql queries

Assignment Help Database Management System
Reference no: EM131110127

Database Design and SQL Queries
In assignment 1, you have already started the process of designing a database for the Beauty Salon mini-case (enclosed again below), mainly in the phase of conceptual database design, and a draft ER diagram has been created for this purpose. Here you will further refine your database design for the other design phases.
In this assignment, you will in particular complete the logical design through the normalisation process, have it physically implemented, perform a few important queries in SQL, and establish certain stored procedures or functions in Transact SQL (T-SQL) to process data or verify database integrity. Your design of relational model should be done in such a way that business rules and data integrity are ensured by the intrinsic design of the database as much as possible.
Logical Database Design
1. For the ER diagram you created in assignment 1, the artefact of the conceptual database design, map the ER model into the relational model according to how it was designed in the ER diagram. You may however first refine your ER diagram if necessary. The actual assessment of this part is in the point 3 below.
2. For all the relations that arise from this ("first-cut") ER diagram, list all those that are already in 3NF. If there are some relations that are not in 3NF yet, then convert them into 3NF with proper procedure and explanations. (2 marks)
3. Draw the global relation diagram for your final, revised, and normalised database design, and keep all the relevant details there. It should be in a similar form to Figure 17.9 (page 516) of the textbook, but all 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 that may still exist in your design, if any. (3 mark)
Physical Database Design and SQL Queries
In this part (consisting of points 4 and 5 below), 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.
Advanced Features
6. For this question, we assume that all thereapists are available at any time unless the timeslot has already been booked out by some other clients. For a given period, say, 2011-11-11 2pm-6pm, list which therapists are available for what services, sorted in terms of the services. Your database should contain sufficiently many relevant records to nontrivially illustrate your solution.
7. List the potential problems, in the order of perceived severity, on the data/record consistency and constraints that can not be automatically ensured by your final database design. For those can, they should be done so via such as entity integrity and referential integrity. Write SQL statements or T-SQL procedures that will determine if such problems exist or not for any given state of the database. We note that the overall design quality of the database will also be taken into consideration here. 

8. A single plain-text file containing SQL statements for creating all the tables and making all the queries, and (if any) the stored procedures and their execution. The script should be executable on the School's Microsoft SQL Server, otherwise the corresponding marks in the above listed items will be deducted accordingly.
9. A statement on the work distribution in percentage (e.g. 50% for David and 50% for Louise) agreed among all the group members. If this statement is absent, then it will be assumed that all group members 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% may result in having less mark than the other team member.
10. A hardcopy of your electronic submission is also due at the same time as the electronic submission, and needs to be delivered on your own campus. More precise locations will be announced at vUWS in the due course. However, a student may choose to deliver the hardcopy on the Monday immediately following the deadline date regardless whether this is a mid-semester break. The hardcopy must be the same as the submitted softcopy. The electronic submission is the official submission, submitting a hardcopy without submitting the electronic copy within the due date will be deemed NOT having submitted the assignment.
NOTE: If a hardcopy is not received by the above specified date for a student, then the student will eventually receive only the mark for the assignment derived from a marking sheet, and will not be able to get the more detailed feedback that could be otherwise written to your submitted hardcopy.

Mini Case: Beauty Salon
Beauty Salon is a system to be designed to manage the booking and the payment of a single beauty parlour.
Beauty Therapists: A beauty parlour has a number of staff members most of which are beauty therapists. Some beauty therapists are well-established professionals while others may just be the trainees. Different thereapists may also have different availability for work. For instance, some may not work on Saturdays while others might be on leave for a few weeks.
Beauty Care and Treatments: There are a number of beauty treatments or services a therapist can undertake, including manicure, pedicure, waxing, threading, facials and massages, to name a few. Different therapists may be able to provide different ranges of specific services, depending on the actual individuals. Some (item-based) services such as waxing will be charged per item while others (time-based) such as massage will be charged per half an hour or per hour. The fees for item-based services are fixed across all the therapists. But the fees for time-based services may vary among the therapists due to their different level of expertise.
Treatment Venues: When a booking is being made, it is possible to agree on a specific venue to conduct the services. Such venues could be other similar parlours or shops at which a particular beauty therapist also works.
Clients: Each regular client or patron will typically have her own client record set up on the system, and this will allow her to easily make a booking or make a payment. However, a non-regular customer will also be able to turn up in the beauty parlour and request a service to be done to her. Such customers don't have to create their client profiles and can still receive the services when they just turn up in the parlour, provided there are suitable therapists available at the parlour at the time.
Payments: The payment for the services of each booking or appointment will also be recorded. The payment can be made in cash, or via a credit card. The payment details will be recorded accordingly.
Business Activities: For the typical business activities, the Beauty Salon system will allow one to view which appointments have been made on any given day for any particular therapist, list all the available therapists for a given period of time, browse all the payments for a given day, and many more.

Reference no: EM131110127

Questions Cloud

What defense might be raised in this case explain : In your initial post, address the following: What defense might be raised in this case? Explain. Should that defense be successful? Explain. See Nalwa v. Cedar Fair, 55 Cal. 4Th 1148
How many shares of stock and how many warrants : How many shares of stock and how many warrants can Ms. Michaels purchase? Suppose Ms. Michaels purchased the stock, held it 1 year, and then sold it for $60 per share. What total gain would she realize, ignoring brokerage fees and taxes?
What is the theoretical basis for requiring lessees : How should Perriman account for the gain on the sale portion of the sale-leaseback transaction during the first year of the lease? Why?(AICPA adapted)
Calculate the theoretical warrant value : For each of the common stock prices given, calculate the theoretical warrant value. Graph the theoretical and market values of the warrant on a set of axes with per share common stock price on the x axis and warrant value on the y axis.
Database design and sql queries : In assignment 1, you have already started the process of designing a database for the Beauty Salon mini-case (enclosed again below), mainly in the phase of conceptual database design, and a draft ER diagram has been created for this purpose. Here you..
What ethical issue is at stake : Should the controller's argument be accepted if she does not really know much about copier technology? Would it make a difference if the controller were knowledgeable about the pace of change in copier technology?
What is the appropriate amount that albertson corporation : What is the appropriate amount that Albertson Corporation should recognize for the leased aircraft on its balance sheet after the lease is signed?
The diffie hellman algorithm for key exchange : 1. In the Diffie-Hellman algorithm for key exchange, suppose Alice sends Bob (19, 3, 5) corresponding to (p, g, ga). Bob responds with (12). Determine the session key.2. Consider RSA encryption with P = 7, q = 11.
Comparison different types of accounting by lessee and lesor : Describe how a capital lease would be accounted for by the lessee both at the inception of the lease and during the first year of the lease, assuming the lease transfers ownership of the property to the lessee by the end of the lease.

Reviews

Write a Review

Database Management System Questions & Answers

  Create ascreenshot of each query and output data

Create 3 rows of data for each table ensuring that the referential integrity is valid and add the 30 rows of data to the appropriate table in your database (using any appropriate method available).

  Determine the appropriate constraints for each table

Based on the description of the Clearwater Traders database, determine the appropriate constraints for each table

  Give an example of a view on emp that would be impossible to

Give an example of a view on Emp that would be impossible to update (auto- atically) and explain why your example presents theupdate problem that it does.

  Create the physical data model

Using anyRDBMS preferably (MySQL), create the physical data model for the logical data model provided in the attachment. This should include all of the data definition language SQL.This should be based upon the previous ERD created (see figure bel..

  Who knows how to make an erd for database

Who knows how to make an ERD for database

  Database and programming design

Database and Programming Design

  Create local variable that inherits structure of car table

Using an explicit cursor, retrieve each row from the i_car table. Create a local variable that inherits the structure of the i_car table (using %ROWTYPE attribute). Place each row returned into this variable

  Develop a database in ms access and support business

Customers can be friends of other customers, and view comments on wish list of their friends.

  An art museum that needs to track the artwork artists and

write a 750- to 1050-word paper in which you complete the followingmiddot choose a database environment from the

  Relational and logical operators to evaluate logical

Boolean w6 using Relational and Logical Operators to Evaluate Logical (Boolean) Expression Evaluate the logical (Boolean) expressions in the following exercises and circle the correct answer after you evaluation

  Determining the actual size of these database constructs

Discuss your thoughts on the effects of indexes, data types, filegroups, and transaction logs on space considerations.

  Implement the data modelling for a database

Implement the data modelling for a database that is based on the given application scenario - design and implement The Best Home business database

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