Starting from:
$35

$29

Assignment 7 (DDL) Solution

Write a script that will do the following:
    1. drop/delete all of the tables/views you will be creating below
    2. create a table owner with an owner id, a first name, and a last name. Owner id should be an auto-increment primary key.
    3. put at least 5 records in this table
    4. do a select * on this table to show all the records
    5. create a table called pet with a pet id (auto-increment primary key), pet name, pet dob (as character), and owner-id (which is a foreign key into the owner table)
    6. put at least 5 records in this table, with at least two pets owned by the same owner
    7. do a select * on this table to show all the records
    8. add a column to the pet table for type of pet (for example: dog, cat, or fish)
    9. update several rows to add the pet type
    10. change the pet dob column to a date type (from character)
    11. do a select * on this table to show all the records
    12. define a view that will list each owner with their pet, just the names (first and last of owner) and the pet name
    13. do a select * on this view to show all the records

Once you have debugged and corrected the above sql statements, put them in the script (with comments), run the script using the \T command to put the results in a text file. Turn in both the script and the output file

Note: For 10. if you cannot change the column data type, delete the column and add a new one. Put a note in your script that you did, including the error message you got.

More products