Question: 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;: '. -_ ..

 i. Create the database tables in SQL (runnable on the W

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Economics Questions!