Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

Write an SQL statement to display the OwnerLastName, OwnerFirstName, and OwnerEmail of any owners of cats. Use a subquery with PET_OWNER and PET_3.

The following table schema is for the BREED table.

BREED(BreedName, MinWeight, MaxWeight, AverageLifeExpectancy)

*MinWeight and MaxWeight should store 1 decimal place.

PetBreed in PET_3 will be a foreign key to the BreedName in BREED.

PET_3(PetID, PetName, PetBreed, PetType, PetDOB, PetWeight, OwnerID)

Write an SQL statement to create the BREED table. Don't forget the foreign key constraint; updates should cascade but deletes should not.

Write an SQL statement to display the OwnerLastName, OwnerFirstName, and OwnerEmail of any owner of a pet that has an AverageLifeExpectancy value greater than 15 using a subquery. The PET_OWNER, PET_3, and BREED tables are below.

Write an SQL statement to display the OwnerLastName, OwnerFirstName, and OwnerEmail of any owners of cats. Use a JOIN. The PET_OWNER and PET_3 tables are below. Do not show duplicates.

Write an SQL statement to display the OwnerLastName, OwnerFirstName, and OwnerEmail of any owner of a pet that has an AverageLifeExpectancy value greater than 15 using a JOIN. The PET_OWNER, PET_3, and BREED tables are below. Do not show duplicates.

Write an SQL statement to display the OwnerLastName, OwnerFirstName, PetName, PetType, PetBreed, and AverageLifeExpectancy for pets with a known PetBreed. Use PET_3. The PET_OWNER, PET_3, and BREED tables are below.

Write SQL statements to add these 3 new rows to the PET_OWNER table. Assume that OwnerID is a surrogate key and the DBMS will provide a value for it.

OwnerID

OwnerLastName

OwnerFirstName

OwnerPhone

OwnerEmail

5

Rogers

Jim

555-232-3456

Jim.Rogers@somewhere.com

6

Keenan

Mary

555-232-4567

Mary.Keenan@somewhere.com

7

Melnik

Nigel

555-232-5678

Nigel.Melnik@somewhere.com

Write SQL statements to add these 3 new rose to the PET_OWNER table. Assume that OwnerID is a surrogate key and the DBMS will provide a value for it. However, you do not have a value for OwnerEmail.

Write an SQL statement to change the value of Std. Poodle in BreedName of BREED to Poodle, Std. Assume cascading updates in the PET_3 table. (Try it first without a WHERE clause.)

Write an SQL statement to delete all rows of pets of PetType Cat in the PET_3 table. NOTE, do not use Anteater, as in the book. (Try it first without a WHERE clause.)

Write an SQL statement to add a PetWeight column to the PET table, given that this column allows NULLs. Assume a type of Numeric(4,1)

Write SQL statements to insert the following data into the PetWeight column of the PET table.

PetID

PetName

PetType

PetBreed

PetDOB

PetWeight

OwnerID

1

King

Dog

Std. Poodle

2009-02-27

25.5

1

2

Teddy

Cat

Cashmere

2010-02-01

10.5

2

3

Fido

Dog

Std. Poodle

2008-07-17

28.5

1

4

AJ

Dog

Collie Mix

2009-05-05

20.0

3

5

Cedro

Cat

Unknown

2007-06-06

9.5

2

6

Wooley

Cat

Unknown

NULL

9.5

2

7

Buster

Dog

Border Collie

2006-12-11

25.0

4

Write an SQL statement to change the PetWeight column of the PET table so it does not allow NULLs. Assume the column exists, and that it currently allows NULLs

Write an SQL statement to drop the PetWeight column in the PET table.

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M91426125
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in PL-SQL

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As