You have been tasked to turn these data into a relational database. You will need to build the database and write a report about what you did. You only need to submit the report. It should have the following sections:
a. Introduction – Introduce the business requirements and describe one business rule and one use case you can identify from the scenario given above.
b. ER Diagram – Identify the entities and relationships in the scenario given above and draw an ER diagram showing the entities, attributes, relationships, and cardinality. Do not decompose any of the relationships at this point.
10 marks
c. Database Schema – Decompose the design to create a schema to store the data in a suitable normal form (2NF or 3NF). Say which normal form the design is in and justify your choice. List the tables and show the fields, primary keys, and any foreign keys in your schema. Describe any assumptions you have made or any additional fields you have added to your design. Make sure all the primary keys are a sensible choice and introduce new fields if needed. Draw a schema diagram to illustrate your design.
d. Create Tables – Create a MySQL database to store the schema that you designed in part c. above. Create the tables using SQL statements and reproduce the code in your answer report. Define the keys and choose appropriate data types and any other restrictions you think are required.
20 marks
e. Insert the Data – Insert the data given above into the appropriate tables. Give a single example of an SQL statement that you used to insert one row of data into one of the tables.
10 marks
f. SQL Queries – Carry out the appropriate SQL queries of answering the following questions. For each query, give the SQL code and the result of running the query on the data in your database. Marks are given by each question.
i. Return a list of all dog names (2).
ii. Return a list of all dog breeds, showing each breed only once (3).
iii. Write a query to count how many dogs have the string “Labr” in their breed (2).
iv. Calculate the average age of all dogs in the kennel (2).
v. Calculate the average age of dogs by breed (3).
vi. Find the breed of dog that has an average age of more than 8 (4).
vii. List all the dog names along with their owners’ names (4).
viii. List all the dogs who have had a vet note recorded. Give the name of the dog and the date of the vet note (5).
ix. List all dogs, giving their name, and if a dog has had a vet visit, give the note for the visit, otherwise, if the dog has not visited the vet, return null in the vet note field (5).
>Assignment ONE
RELATIONAL DATABASE DESIGN
“It’s a Dog’s Life” is a kennel which operates just outside the village of Newtown. The kennel’s function is to look after dogs while their owners are out of town. To help with the running of the kennel, they maintain a spreadsheet of the name, breed, and age of each dog who is staying with them, as well as the name, address and phone number of each dog’s owners. The database also stores special instructions for the care of each dog, as well as which kennel room the dog is staying in, and a note of the unique microchip number which each dog has implanted in their neck. Every dog must have a chip number. Vet notes are added to the spreadsheet if a dog is seen by the vet and vet notes must be associated with a single dog.
The current way in which the data are stored is shown in the table below.
Note
that each person can own more than one dog and each dog can have more than one owner. The vet columns are empty unless the dog has been seen by the vet. A vet visit cannot exist without a dog, of course.
Dog Name |
DogBreed |
Dog Age |
Owner |
Owner Address |
Owner Phone |
DogChipNo |
Note |
Room |
Vet ID |
Vet Date |
Vet Note |
|||||||||||||
Fido |
Labrador |
1 0 |
Sarah Smith |
The Meadows Newtown FK40 7 LL |
0 12 3 4 5 6 78 9 0 |
545682 |
None |
1 | ||||||||||||||||
John Smith |
||||||||||||||||||||||||
Sheba |
9 |
356784 |
2 |
76 |
20.05.18 |
Worming tablets given |
||||||||||||||||||
Pat |
Labradoodle |
3 |
746587 |
Enjoys petting |
||||||||||||||||||||
Paddy |
Golden retriever |
7 |
Frank Jones |
14 Main Street Newtown FK40 6TT |
0376 458015 |
546875 |
Enjoys all |
6 | ||||||||||||||||
Rex |
Mongrel |
546888 |
Requires pills |
12 |
(
Page
1
of
3
)
You have been tasked to turn these data into a relational database. You will need to build the database and write a report about what you did. You only need to submit the report. It should have the following sections:
a. Introduction – Introduce the business requirements and describe one business rule and one use case you can identify from the scenario given above.
b. ER Diagram – Identify the entities and relationships in the scenario given above and draw an ER diagram showing the entities, attributes, relationships, and cardinality. Do not decompose any of the relationships at this point.
10 marks
c. Database Schema – Decompose the design to create a schema to store the data in a suitable normal form (2NF or 3NF). Say which normal form the design is in and justify your choice. List the tables and show the fields, primary keys, and any foreign keys in your schema. Describe any assumptions you have made or any additional fields you have added to your design. Make sure all the primary keys are a sensible choice and introduce new fields if needed. Draw a schema diagram to illustrate your design.
d. Create Tables – Create a MySQL database to store the schema that you designed in part c. above. Create the tables using SQL statements and reproduce the code in your answer report. Define the keys and choose appropriate data types and any other restrictions you think are required.
20 marks
e. Insert the Data – Insert the data given above into the appropriate tables. Give a single example of an SQL statement that you used to insert one row of data into one of the tables.
10 marks
f. SQL Queries – Carry out the appropriate SQL queries of answering the following questions. For each query, give the SQL code and the result of running the query on the data in your database. Marks are given by each question.
i. Return a list of all dog names (2).
ii. Return a list of all dog breeds, showing each breed only once (3).
iii. Write a query to count how many dogs have the string “Labr” in their breed (2).
iv. Calculate the average age of all dogs in the kennel (2).
v. Calculate the average age of dogs by breed (3).
vi. Find the breed of dog that has an average age of more than 8 (4).
vii. List all the dog names along with their owners’ names (4).
viii. List all the dogs who have had a vet note recorded. Give the name of the dog and the date of the vet note (5).
ix. List all dogs, giving their name, and if a dog has had a vet visit, give the note for the visit, otherwise, if the dog has not visited the vet, return null in the vet note field (5).
Please write your answers, save them to PDF and upload them in the assignment submission area on iStirling. Include your student number on the front page of the report, but DO NOT PUT YOUR NAME ANYWHERE on the report.
Late penalties of three marks per calendar day you are late in submitting will be applied, up to a maximum of seven calendar days, after which you will receive no grade for the assignment.
Plagiarism is presenting somebody else’s work as your own. Plagiarism is a form of academic misconduct and is taken very seriously by the University. Students found to have plagiarised work can have marks deducted and, in serious cases, even be expelled from the University. Do not submit any work that is not entirely your own.
We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.
Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.
Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.
Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.
Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.
Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.
We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.
Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.
You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.
Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.
Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.
You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.
You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.
Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.
We create perfect papers according to the guidelines.
We seamlessly edit out errors from your papers.
We thoroughly read your final draft to identify errors.
Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!
Dedication. Quality. Commitment. Punctuality
Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.
We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.
We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.
We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.
We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.