Write SQL code to complete the following (create and insert data into the following tables) and
run the code in MS SQL SERVER to get practice using the command line and getting syntax
errors. You can submit your sql files or you can send a screen shot that your code ran. If you
send a screenshot, be sure I can see your id in the SQL window so I know it is your work. I can
check in your account that the tables are created. 1. Write SQL CREATE table statement to
create the following table with OwnerID as surrogate key. OwnerID is a surrogate key (starts at 1
and increments by 1). hint: IDENTITY ( 1 , 1 ) is syntax for surrogate key PET_OWNER
(OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) 2. Write SQL
CREATE table statement to create the following table with PetID. PetID is 5 characters
combination of letters and numbers [not system generated]. PET (PetID, PetName, PetType,
PetBreed, PetDOB, OwnerID), you don't need to create referential integrity constraint on
OwnerlD in PET table yet. 3. Using the ALTER table command, add referential integrity
constraint on OwnerID in the PET table. Hint: (OwneriD) REFERENCES PET_OWNER
(OwnerID). You will need to figure out the syntax to alter PET table and it references
PET_OWNER. 4. Add the following records to PET_OWNER table. You can make up your own
data. 5. Add the following records to PET Table, note you will need to have valid Owner_IDs if
you set up the referential integrity constraint or SQL will not allow you to enter records that don't
have a corresponding OwnerID in the Pet_Owner table. You can make up your own data.

Write SQL code to complete the following (create and insert data into.pdf

  • 1.
    Write SQL codeto complete the following (create and insert data into the following tables) and run the code in MS SQL SERVER to get practice using the command line and getting syntax errors. You can submit your sql files or you can send a screen shot that your code ran. If you send a screenshot, be sure I can see your id in the SQL window so I know it is your work. I can check in your account that the tables are created. 1. Write SQL CREATE table statement to create the following table with OwnerID as surrogate key. OwnerID is a surrogate key (starts at 1 and increments by 1). hint: IDENTITY ( 1 , 1 ) is syntax for surrogate key PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) 2. Write SQL CREATE table statement to create the following table with PetID. PetID is 5 characters combination of letters and numbers [not system generated]. PET (PetID, PetName, PetType, PetBreed, PetDOB, OwnerID), you don't need to create referential integrity constraint on OwnerlD in PET table yet. 3. Using the ALTER table command, add referential integrity constraint on OwnerID in the PET table. Hint: (OwneriD) REFERENCES PET_OWNER (OwnerID). You will need to figure out the syntax to alter PET table and it references PET_OWNER. 4. Add the following records to PET_OWNER table. You can make up your own data. 5. Add the following records to PET Table, note you will need to have valid Owner_IDs if you set up the referential integrity constraint or SQL will not allow you to enter records that don't have a corresponding OwnerID in the Pet_Owner table. You can make up your own data.