Category: SQL

Data Management

Task 1:
The EERD contain all necessary entities, relationships, attributes so that all the queries can be answered.
Correct entity/relationship types (strong or weak) are used.
Each strong entity has a PK
Each relationship has the two types of constraints
Correct class-subclass relationships are identified
There are no redundant entities, relationships or attributes (In particular, no foreign key attributes are present in the entities
Please do not confuse ER diagram with schema diagram, and confuse entities with tables.
Task 2:
You have mapped your EERD to tables correctly using the appropriate rules.
You have marked/listed all primary key and foreign key constraints.
Please do not just copy your entities as the tablesusually you need more tables than entities because you may need to map some relationships into tables, and multi-valued attributes into tables. Please do not combined this task with task 3.
Task 3:
All your tables are in 3NF (and otherwise convincing reasons are provided to justify the use of non-3NF tables).
An appropriate data type and length for each attribute.
Other constraints such as null value constraints and domain constraints are present, and important business rules are also identified.
Task 4:
The SQL commands are logically correct against your final tables in Task 3.

Creating stored procedure in sql

I need help with following questions:
Design the stored procedure to answer the following question:  What is the utilization of the room for a one week period. The procedure will return a list of the rooms showing how many of each service (procedure or consultation) with the total time used for each plus a grand total for the room starting at the specified search_start_date for 7 days.
Be sure to handle errors gracefully.  Errors may include invalid room or date range.

Specification for the stored procedure:

Room_utilization (search_start_date)

Submit the solution that you have designed and discuss its merits as part of the submission. This means that there will be two files, the sql code and a document discussing it.

I will attach the sql file

Thank you