Write an sql statement to change the petweight column

Assignment Help PL-SQL Programming
Reference no: EM13856386

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

[email protected]

6

Keenan

Mary

555-232-4567

[email protected]

7

Melnik

Nigel

555-232-5678

[email protected]

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.

Reference no: EM13856386

Questions Cloud

Analyze the recidivism rates for sex crimes : Analyze the recidivism rates for sex crimes
Explain and clarify items shown on the financial statements : The purpose of footnotes is to explain and clarify items shown on the financial statements. Please list the number and name of each of the footnotes, as well as the page the footnote appears.
Analyze techniques for requirements determination : The specific course learning outcomes associated with this assignment are. Analyze techniques for requirements determination, collection, and organization
Discuss how it may be applied to child rearing : Choose one of these conditioning/learning styles and discuss how it may be applied to child rearing. In essay format, create a plan to help get a young child to clean his/her room.
Write an sql statement to change the petweight column : 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
Prepare a detailed scope statement that defines the scope : Prepare a detailed scope statement that defines the scope of the SCID4 project. Each project manager shall use the scope statement template in Appendix A.
Write a memo answering this question : Which, if any, of the above expenses are allowable as non-taxable? Please write a memo answering this question, citing appropriate authority. An IRAC-style essay is appropriate for this assignment
Using data collection techniques and tools to amass war : Businesses across the globe are using data collection techniques and tools to amass war chests of information to leverage to create/maintain advantage. But, is this activity being deployed by companies like Google, Amazon, and thousands of others tru..
What are the two basic categories of torts : What are the two basic categories of torts? What makes them different? Please give examples of each? What are the elements of negligence? Be sure to discuss the reasonable person standard and the two kinds of causation.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Describe theways to backup an oracle database

Describe three ways to backup an Oracle database

  Write sql to correction create the beach table

Write SQL to correction create the BEACH table, Write SQL to inset the data into the BEACH table

  Create tables with appropriate primary keys and foreign keys

Return the names of all employees whose company is in Baltimore - Return the names of employees of Verizon who are managers.

  Write a script that declares a variable

Write a script that declares a variable and sets it to the count of all products in the Products table. If the count is greater than or equal to 7, the script should display a message that says,

  What is the expected profit for one month

Investigate the profitability that would result if instead of baking 30 batches each morning, they bake 25, 30, 35, or 40 batches. Which would you recommend and why? (You should use Decision Table with Crystal Ball, or Scenario Manager if plain Ex..

  Sql script-creating the database and inserting data

Understanding the SQL script, creating the database and inserting data and display all product information for products that contain the string ‘saw' in their description.

  Write sql statements for the ten queries

Write SQL statements for the ten queries - find the names of all Tracks that are more than 10 minutes (600,000 ms) long. Result: (name: varchar(255))

  Who are the opposition leaders

Write SQL SELECT statements to retrieve the following information from the prime_minister database.

  Data processing of an international based organization

Imagine that you have been hired as a consultant to assist in streamlining the data processing of an international based organization that sells high-end electronics. The organization has various departments such as payroll, human resources, finan..

  Strategies for improving the performance of sql queries

Discuss some possible solutions and strategies for improving the performance of SQL queries and their ability to provide data to users and identify the performance or usability issues that need to be addressed.

  Display all the lastnames from the customers

Display all the LastNames from the Customers table and any associated OrdersIDs from the Orders Table. Show the LastName even if they do not have any associated orders. Order the results by LastName in ascending order.

  Write an sql statement to list lastname

Write an SQL statement to list LastName, FirstName, and Phone of the customers who made the purchase with SaleIDs 1, 2, and 3. Use a subquery.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd