Write an sql statement to display breed and type of all pets

Assignment Help PL-SQL Programming
Reference no: EM131291693

Database Applications SQL Q&A and Hands-On

Part B: Use the Week 3 Assignment Pet_Database File for this section of the assignment. In the PET table, delete the PetDOB field and add a numeric PetCost field. Populate this field with appropriate values. Save the changes to the PET table. Create SQL queries to do the following:

• Display the last name and phone number of all dog owners. Use a subquery to do this.
• Display the first and last name of owners and the type of animal of all unknown breeds.
• Display the pet name and owner last name of all dogs.

Save all 3 queries.

Export the PET table to an Excel spreadsheet. Create a Pivot table. Have the cost display as currency. Take screen shots* of two different views without a report filter and paste the screen shots into a Word document. Then add a report filter and choose one value for it, take a screen shot, then choose a different value for the same filter and take another screen shot. Paste those into the Word document containing the first two screen shots. You should now have 4 screen shots in this Word document. Save the Word document as Screen shots. Save the pivot table as Pivot.

You will have 4 files submitted for this assignment: the Word document with your paper from Part A, the Microsoft Access Pet_Database file, the Screen shots Word file, and the Pivot file.

*To take a screen shot, have the proper information on your screen, hit the PrntScr button, and then paste into the Word document.

SQL Q&A and Hands-On

Please include the questions with your answers. Answer in complete sentences where applicable.

1. Does all standard SQL work in Microsoft Access? Explain.

2. List and describe the four basic SQL data types.

3. List and describe five SQL built-in functions. The best way to learn SQL is by actually using it. In the following problems, we will use SQL to create, populate, and query a small database. Use SQL in Microsoft Access to complete the problems. Save all queries as instructed in the problem. Submit the database file (save as Pet_Database.accdb and KEEP THIS FILE for use with a later assignment) with all your queries in addition to the Word document containing the questions and answers for numbers 1, 2, and 3.Use the following information for problems 4 - 10:Tables:PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail)PET (PetID, PetName, PetType, PetBreed, PetDOB, OwnerID)**Note: OwnerID is italicized to indicate the Foreign Key**Data:

4. Write an SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Save as CreatePetOwner.

5. Write a set of SQL INSERT statements to populate the PET_OWNER table with the data given above. Save as PopulatePetOwner.

6. Write an SQL CREATE TABLE statement to create the PET table, with PetID as a surrogate key. Save as CreatePet.

7. Write a set of SQL INSERT statements to populate the PET table with the data given above. Save as PopulatePet.

8. Write an SQL statement to display the breed and type of all pets. Save as AllBreeds.

9. Write an SQL statement to display the breed, and DOB of all pets having the type Cat. Save as Cats.

10. Write an SQL statement to display the first name, last name, and email of all owners, sorted in alphabetical order by last name. Save as AlphaOwners.

11. Write an SQL statement to display all the owners' names, with the first name in all lower case and the last name in all upper case. Save as UpperLower.

12. Write an SQL statement to display the total number of pets. Save as TotalPets.

13. Write an SQL statement to display the last name, first name and email of any owner who has a NULL value for OwnerPhone. (Note: there should be one owner who has a NULL value for OwnerPhone.) Save as PhoneNull.

14. Write an SQL statement to count the number of distinct breeds. Save as NumberOfBreeds.

15. Write an SQL statement to display the names of all the dogs. Save as Dogs.

Reference no: EM131291693

Questions Cloud

Discuss how the contents of a directory are impacted : Discuss how the contents of a directory are impacted (and when and/or if they are available for use) when a file system is mounted on that directory.
Demonstrate understanding and mastery of the course content : Demonstrate understanding and mastery of the course content through application to your personal leadership context and are evaluated on depth of insight, accuracy of application and integration of relevant course concepts.
What types of social studies objectives and goals : What types of social studies objectives/ goals could be met by this technology and how? Please relate to a NCSS main theme (or more than one if appropriate).
Discuss about the clinical and forensic evaluation : identify at least one difference between the two types of evaluations (forensic psychological and traditional clinical psychological) in each of the following areas:Interviewing,Discussion of informed consent,Testing and assessment,Writing reports.
Write an sql statement to display breed and type of all pets : Write an SQL statement to display the breed and type of all pets. Save as AllBreeds. Write an SQL statement to display the breed, and DOB of all pets having the type Cat. Save as Cats.
Which industries will be most negatively impacted : Which industries will be most negatively impacted by this action, and why?- Which industries (if any) might be positively impacted by this action, and why?
Estimating the modularizing code : Imagine you are a part of a team that is tasked with writing a mobile application (app) that will allow users to send pictures to their friends. The manager does not want to waste time creating code modules. Describe at least one (1) advantage of ..
Evaluate the forensic psychology and risk assessment : Evaluate the forensic psychology and risk assessment.Identify and describe the role and purpose of the report. Comment on whether the evaluation was or was not necessary. State the reasons for your opinion.
Development of applications in a clustered environment : What advantage does the aggregate data model offer for development of applications in a clustered environment? How does aggregate orientation (i.e., the aggregate data model compare to the relational model? How do NoSQL databases differ from the rela..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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