Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE HELP ME. SHOW ALL WORK!! PLEASE PLEASE. Use the following tables and samp

ID: 3735641 • Letter: P

Question

PLEASE HELP ME. SHOW ALL WORK!! PLEASE PLEASE.

Use the following tables and sample data for your answers to the questions in this assignment. (Please note that the tables have already been normalized.) Use MS SQL Server Management Studio to write and test your SQL statements. When you are finished, put all of your SQL statements into a single.sql script file. You may use comments to mark "Question 1", etc.. PET OWNER (OwnerlD, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) PET (PetID, PetName, PetType, PetBreed, PetDOB, OwnerlD) FIGURE 3-1 PET OWNER Data OwnerID OwnerLastName OwnerFirstName OwnerPhone OwnerEmail 555-537-8765 Marsha Downs@somewhere.com 555-537-7654 Richard James@somewhere.com 555-537-6543 Liz Frier@somewhere.com Frier Trent Liz Miles.Trent@somewhere.com FIGURE 3-19 PET Data PetBreed Std. Poodle PetType PetDOB 27-Feb-11 01-Feb-12 17-Jul-10 05-May-11 06-Jun-09 PetID PetName OwnerID Teddy AJ Cedro Wooley Buster Std. Poodle Collie Mix Unknown Unknown Border Collie 6 11-Dec-08

Explanation / Answer

Solution:

1 and 2 is done, please repost others.

1)

CREATE TABLE PER_OWNER(
    OwnerID int NOT NULL,
OwnerLastName varchar(20);

OwnerFirstName varchar(20);

OwnerPhone int(20);

OwnerEmail varchar(20);
    PRIMARY KEY (OwnerID)
);

Explanation:

Create table command is used to create the table in the database in which it's columns are assigned with the appropriate data type and OwnerID being assigned as the surrogate key.

2)

CREATE TABLE PET(
    PetID int NOT NULL,
    PetName varchar(20),
    PetType varchar(20),

PetBreed varchar(20),

PetDOB date,

OwnerID int(20),
    PRIMARY KEY (PetID),
    CONSTRAINT FK_OwnerID FOREIGN KEY (OwnerID)
    REFERENCES PET_OWNER(OwnerID)
);

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote