Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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 breed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago