Question
4. (Use Sallys Pet Store)Sally has a very fickle customer that would like to see if the store has ever carried certain types of animals.
4. (Use Sallys Pet Store)Sally has a very fickle customer that would like to see if the store has ever carried certain types of animals. Write one query to answer this question: List the parrots or parakeets or lovebirds that have blue or red but not gold as part of their color, and also list the female registered cats with a price from 130 to 300 born in June, July or August of the year 2004, but not black cats. Return all columns in the animal table, and sort the result set by listprice with the largest value first.
5. Write the code to create 3 tables: SALESAGENT, AGENTAUTO, and AUTOMOBILE. The SaleAgent table should have a surrogate key named SID with automatic sequential numbering, and these fields (SFN variable text max of 30 and required, SLN with an appropriate data type, SPhone with an appropriate data type). AUTOMOBILE should have field named VIN which is a unique number that comes on every car and should be used as the primary key. The table AGENTAUTO table should have the fields startdate and enddate with appropriate data types, a primary key of your choosing, and the necessary two foreign keys with referential integrity constraints enforced.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started