Question

In: Computer Science

A new veterinary clinic will like to set up their database. The clinic will like to...

A new veterinary clinic will like to set up their database. The clinic will like to keep record of their customers such as: pet name, pet type, pet age, pet weight, owner name, owner address, owner contact. Also the clinic will like to keep track of the veterinarian name, specialty and schedule. They will like to keep track of the customer appointment date, what the appointment is for, and how much it will cost.

List all of the data that needs to be kept track of for the scenario above in a 1NF (Flat File) table

Use the normalization technique and form the 3NF tables

Write out the Create Table command in SQL for creating the database you have designed, make sure to use the right DATATYPES, CONSTRAINTS, and COSTRAINT REFERENCES.

Write one SQL Insert into Values ( ); command for each table in your database

Solutions

Expert Solution

1).ANSWER:

GIVEN BELOW:

Solution 1:

Table T(pet_id, petname, pettype, petage, petweight, owner_id, ownername, address, contact, vet_id, vet_name, speciality, schedule_st, schedule_end, apt_date, apt_reason, apt_cost)

Solution 2:

The functional dependencies formed are pet_id -> petname, pettype, petage, petweight

owner_id -> ownername, address, contact

vet_id -> vet_name, speciality, schedule_st, schedule_end (schedule start and schedule end)

pet_id, vet_id, apt_date -> apt_reason, apt_cost

Thus the primary key = (pet_id + owner_id + vet_id +apt_date). Thus all functional dependencies stated above are partial dependencies. Thus table T is not in 2NF. Ths tables are divided and primary keys are underlined.

Table Pet(pet_id, petname, pettype, petage, petweight, owner_id) [owner_id is foreign key used to connect Pet and Owner tables]

Owner(owner_id, ownername, address, contact)

Veterinarian(vet_id, vet_name, speciality, schedule_st, schedule_end)

Appointment(pet_id, vet_id, apt_date, apt_reason, apt_cost)

Since no transitive dependency exists, these tables are in 3NF.

Solution 3:

CREATE TABLE PET(pet_id int PRIMARY KEY, petname varchar(50), pettype varchar, petweight float, owner_id int, FOREIGN KEY (owner_id) REFERENCES Owner(owner_id));

CREATE TABLE OWNER(owner_id int PRIMARY KEY, ownername varchar(50), adress varchar(100), contact int);

CREATE TABLE Veterinarian(vet_id int PRIMARY KEY, vet_name varchar(50), spceiality varchar(100), schedule_st date, schedule_end date);

CREATE TABLE Appointment(pet_id int , vet_id int, apt_date date, apt_reason varchar(50), apt_cost int, PRIMARY KEY (pet_id, vet_id, apt_date) );

Solution 4:

INSERT INTO PET VALUES(1,'Tom', 'xyz',10,1);

INSERT INTO OWNER VALUES(1,'Adam', 'address',123455678);

INSERT INTO Veterinarian VALUES(1, 'Robert', 'dogs', 09:00:00, 11:00:00);

INSERT INTO Appointment VALUES(1,1, 01-01-2020, 'abc', 100 );


Related Solutions

You are going to set up a new veterinary medical centre. The new veterinary medical centre...
You are going to set up a new veterinary medical centre. The new veterinary medical centre will provide 24-hour consultation services and have ward to provide non-stop intensive care to animals. How could you design the veterinary medical centre and assign the duty roster for your staff in order to enhance the work efficiency? Concrete examples should be needed to explain your knowledge application. You are required to apply the knowledge you learned from social psychology---- "M3-2 Mind and Machine"...
Schatzie’s is a veterinary clinic. At the beginning of July, the clinic had $720 of veterinary...
Schatzie’s is a veterinary clinic. At the beginning of July, the clinic had $720 of veterinary supplies on hand. The following information is available for July 2009. Salaries for veterinary staff.............................................. $32,000 Salaries for veterinary assistants....................................... 12,000 Salary for receptionist..................................................... 2,500 Wages for office workers.............................................. 6,000 Veterinary supplies purchased in July............................ 9,600 Veterinary supplies on hand on July 31............................. 1,150 Depreciation on hospital and lab equipment........................ 8,600 Depreciation on office equipment...................................... 3,000 Building rent (60% related to treatment) .............................. 3,600...
What are the functions or applications of bandages in a veterinary clinic?
What are the functions or applications of bandages in a veterinary clinic?
appy Pets is veterinary clinic operating in Auckland. RecentlyJohn Tilley, the manager of the clinic, has...
appy Pets is veterinary clinic operating in Auckland. RecentlyJohn Tilley, the manager of the clinic, has been concerned about cash flow shortages, which arose quite unexpectedly in the last three months of the past year. the clinic ban account went into overdraft and incurred interest charges. Tilley believes that the main source of cash flow difficulties is a lack of attention to outstanding client accounts and the practice of purchasing expensive veterinary supplies in large quantities at irregular intervals. Tilley...
Dr. Knights, DVM, opened a veterinary clinic on May 1, current year. The business transactions for...
Dr. Knights, DVM, opened a veterinary clinic on May 1, current year. The business transactions for May are shown as follows. May 1 Dr. Knights invested $480,000 cash in the business in exchange for 6,000 shares of capital stock. May 4 Land and a building were purchased for $300,000. Of this amount, $84,000 applied to the land, and $216,000 to the building. A cash payment of $120,000 was made at the time of the purchase, and a note payable was...
During October 2016, Paws Veterinary Clinic completed the following transactions: Prepare the trial balance of Paws,...
During October 2016, Paws Veterinary Clinic completed the following transactions: Prepare the trial balance of Paws, at October 31, 2016. Oct. 1 Paws received $30,000 cash and issued common shares to shareholders 4 Purchased supplies, $1,000, and equipment, $2,600 on account 5 Performed checkup services, and received cash, $1,500 7 Paid cash to acquire land for an office site, $22,000 11 Performed a surgery on a sick cat, and billed the customer $500 16 Paid for the equipment, purchased Oct...
Practice Problem 1 On August 31, the balance sheet of La Brava Veterinary Clinic showed Cash...
Practice Problem 1 On August 31, the balance sheet of La Brava Veterinary Clinic showed Cash $11,000, Accounts Receivable $3,700, Supplies $600, Equipment $6,000, Accounts Payable $5,600, Common Stock $14,850, and Retained Earnings $850. During September, the following transactions occurred. 1. Paid $2,350 cash for accounts payable due. 2. Collected $2,000 of accounts receivable. 3. Purchased additional equipment for $3,050, paying $900 in cash and the balance on account. 4. Recognized revenue of $8,100, of which $3,500 is collected in...
The Clearwater National Bank is planning to set up a new branch.This new branch is...
The Clearwater National Bank is planning to set up a new branch. This new branch is anticipated to generate 5 percent of the total business of the bank after it is opened. The bank also expects the return for this branch to be 15 percent with a standard deviation of 5 percent. Currently the bank has a 10 percent rate of return with a standard deviation of 5 percent. The correlation between the bank's current return and returns on the...
Simone Cherniak has just completed the second year of operating her veterinary clinic. You have been...
Simone Cherniak has just completed the second year of operating her veterinary clinic. You have been retained by Cherniak for tax assistance and advice. At a recent meeting, you gathered information on her practice, which is presented below. For the year ended December 31, 2019, the clinic showed a profit of $149,700, as follows: Professional service $388,400 Gross profit from surgical instrument sales 33,900 $422,300 Administration and other expenses (276,200) 146,100 Interest income 3,600 Net income $149,700 Included in the...
Ava Miller has just completed the second year of operating her veterinary clinic. You have been...
Ava Miller has just completed the second year of operating her veterinary clinic. You have been retained by Ava for tax assistance and advice. At a recent meeting, you gathered information on her practice, which is presented below. For the year ended December 31, 2020, the clinic showed a profit of $123,700, as follows: Professional service $321,000 Gross profit from surgical instrument sales 28,000 $349,000 Administration and other expenses (228,300) 120,700 Interest income 3,000 Net income $123,700 Included in the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT