Need Help With The SQL Server Database

  

1. Using the attached ERD file (animal hospital.pdf), the Normalization Table excel file (Normalization Table Animal Hospital.xlsx) create tables and insert the data form the normalization table. i.e.:

Ensure every table has a primary key, create a new database for this exercise, this way if you need to you can delete the database and start over. i.e.:

CREATE DATABASE animal_hospital;

GO

USE animal_hospital;

GO

DDLs/DMLs goes here

Screen shot goes here

2. Using the ERD add foreign keys to the tables that require them (should be five foreign keys). 

DDLs goes here

Screen shot goes here

3. Alter or update the tables in the animal_hospital database as follows:

a. Change the size of the street column in the customer table to char(250).

DDL goes here

Screen shot goes here

b. Add a constraint to the customer table so only the two digit abbreviation for the stat can be used. (only do New York, New Jersey, Connecticut)

DDL goes here

Screen shot goes here

i. Try inserting the following DML command into the customer table. What error did you get?
INSERT INTO dbo.Customer values( 204,’Ms.’,’Helen’,’Smith’, ‘750 King Street’,’Springfiele’,’MO’,’52145′);

Answer goes here

Screen shot goes here

4. Using the SELECT INTO Statement copy the pet name from dbo.pet, the type of pet from dbo.pet_type, and the whole name of its owner including salutation in one column. See example of solution for column names.

DML goes here

Screen shot goes here

  

5. Using the INSERT SELECT Statement create a table of 3 columns that will hold the copied data of the pet id from dbo.pet, the name of the pet from dbo.pet, and the type of animal 

DML goes here

Screen shot goes here

Tags: No tags