Grantham University Week 3 SQL Q&A and Hands On Assigment

User Generated

zbafgre15

Writing

Grantham University

Description

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:

  1. Write an SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Save as CreatePetOwner.
  2. Write a set of SQL INSERT statements to populate the PET_OWNER table with the data given above. Save as PopulatePetOwner.
  3. Write an SQL CREATE TABLE statement to create the PET table, with PetID as a surrogate key. Save as CreatePet.
  4. Write a set of SQL INSERT statements to populate the PET table with the data given above. Save as PopulatePet.
  5. Write an SQL statement to display the breed and type of all pets. Save as AllBreeds.
  6. Write an SQL statement to display the breed, and DOB of all pets having the type Cat. Save as Cats.
  7. 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.
  8. 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.
  9. Write an SQL statement to display the total number of pets. Save as TotalPets.
  10. 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.
  11. Write an SQL statement to count the number of distinct breeds. Save as NumberOfBreeds.
  12. Write an SQL statement to display the names of all the dogs. Save as Dogs.

Unformatted Attachment Preview

Week 3 Assignment: SQL Q&A and Hands-On Database Applications 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.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Please check the final answers

Running head: SQL Q&A and Hands-On

1

SQL Q&A and Hands-On
Name
Institutional Affiliations
Date

SQL Q&A and Hands-On

2

Does all standard SQL work in Microsoft Access? Explain.
List and describe the four basic SQL data types.
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
comple...


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4