Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

i. Create the database tables in SQL (runnable on the W School's Microsoft SQL Server) for all the relations in tun; iii-31.11;: '. -_ ..

image text in transcribed
i. Create the database tables in SQL (runnable on the W School's Microsoft SQL Server) for all the relations in tun\"; iii-31.11;": '. -_ .. . . .4... ., . :' your relation diagram, and enforce there all the relevant "i "' " " "m ' "' " " constraints including primary keys and foreign keys. Fill the tables with sufficient data generally around 3 tuples or more per table, but should be sufcient to illustrate meaningfully the working of the general queries to be completed below. List the content of your tables with screenshots. Screenshots of active window's (under Microsoft Windows) can be obtained by pressing CTRL ALT PRTSC keys together, see the example on the right. Your screenshots must contain your username as in the above example, and you may list several tables on a migle screenshot if you wish. (2 marks) ii. Write in SQL the commands to complete the following queries, and show your results in screenshots. Where parameters for the queries below are not completely specified, the parameters should be chosen so as to generate nontrivial (nonempty) results for the queries. if 2 marks) 0 (a) List all the timed services along with the therapists who can provide such services. The list should be sorted alphabetically in the service names. (0.5 marks) 0 (b) For a given day, say, 213181111, list all the names of the therapists who havelhad at least one bookingfappointtnent on that day. Don't repeat the names in the list. (0.5 marks) a (c) List the names of all the clients along with the corresponding total number of bookings. (0.5 marks) on (d) Find the name of the therapists whose hourly rate for the timed service is the cheapest, along with their actual hourly rate. (0.5 marks) iii. For your final designed database, find a scenario in which a relatively prominent business data integrity can not be ensured by your current primary keys and foreign keys, nor by adding directly more of such keys or check clauses in the created tables. In other words, the data integrity ensured by the keys within the database may not be enough to ensure all the data integrity within the business context. Write a SQL statement that will determine if such a problem exists or not, and where, for any given state of the database. (1 mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Economics A Problem Solving Approach

Authors: Luke M. Froeb, Brian T. McCann, Mikhael Shor, Michael R. War

3rd edition

978-1133951483

Students also viewed these Economics questions