Question: Introduction For this assignment, you must write an SQL script. An SQL script is a text file that contains a sequence of SQL commands to
Introduction
For this assignment, you must write an SQL script. An SQL script is a text file that contains a sequence of SQL commands to be run. Yours should
include commands for each of the following, in order:
Run one or more statements that will remove all of the tables that will be created below. This will allow the script to be run again without any errors
caused by existing tables.
Create a table called Dog with a dog id a breed, a name, and a weight. The id of the dog should be the primary key, and should be automatically
assigned the next available value when inserting a new row into the table.
Put six rows into the Dog table with example data. Make up the data yourself. Having fun with this is recommended but not required.
Run the command DESCRIBE Dog;
Run the command SELECT FROM Dog;
Create a table called Visit that contains a visit id as primary key this should take the next available key value whenever a new row is added It
should also have a foreign key that references a row in the dog table, and attributes to hold the date that the visit took place and how long it lasted.
Put exactly ten new rows into the Visit table. Since there are only six dogs, this means that some dogs will have multiple visits.
Run the command DESCRIBE Visit;
Run the command SELECT FROM Visit;
Add a column to the Visit table to hold how much the veterinarian is billing for the visit. This is not an integer, nor a floating point number. Use
the other data type mentioned in class for numbers with fractional portions.
Change the value for the newlyadded attribute in several of the existing rows. There are several datetime functions available in SQL and you can
choose to use any that are appropriate.
Run the command SELECT FROM Visit; again.
If a data type is not specified in this document, anything reasonable should be fine. Use your discretion.
You should include comments in the script that identify which commands match which of the requirements. Comments in SQL are written with a
before them.
give me right answers
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
