Question
2) Farmer Jones would like to use a relational database to keep track of his herd of cows. For each cow, we must keep track
2) Farmer Jones would like to use a relational database to keep track of his herd of cows. For each cow, we must keep track of her age, weight, and breed. He no longer names his cows (there are too many), so each cow gets a number to keep track of each cow.
a. Draw a data model for the cow table.
b. Write the SQL necessary to create the table.
CREATE TABLE COW (
notag VARCHAR(20),
age int (2),
weight int (3)
breed VARCHAR(20),
PRIMARY KEY (notag));
3) On the Jones farm, each farmhand is assigned to take care of certain cows. For each farmhand, we must keep track of the basic biographical data (name, age, etc.) as well as the date that he or she last passed their cow care test.
a. Modify the data model created in #2 to accommodate the farmhand requirements.
b. Write SQL to create the farmhand table and modify the SQL used to create the cow
table, if necessary.
c. Write a query to determine how many cows each farmhand is responsible for.
d. Write a query to list the cows whose breed does not contain the letter m.
Cow *tagno Age Weight breedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started