Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The question Oracle SQL Database currently using Oracle SQL Developer Write a script with three commands. An INSERT statement inserting a new record in car

The question Oracle SQL Database currently using Oracle SQL Developer Write a script with three commands. An INSERT statement inserting a new record in car table. You will have to deal with referential integrity constraints caused by purchinvno, custname etc. Insert values for all columns in the car table and make sure that the value for carlistprice is between 1 and 249999.99. Write an UPDATE statement and update the carlistprice to a value that is either negative or greater than 250000. Follow by a COMMIT. Execute the script and show the response from the server.

I am not sure how to do this? Does it just want a simple insert statement? do I do a if statement?

Just focus on the car table this is the best schema I have

car (carserial, custname, carmake, carmodel, caryear, extcolor, cartrim, enginetype, purchinvno, purchcost, freightcost, carlistprice)

  • carserial - primary key
  • custname - This is the owner of the car.
    • If a car is unsold (available for sale), the custname will be NULL i.e. empty. This is our means of determining if a car is available for sale.
    • Cars brought in for service will always have an owner's name.
  • purchinvno - foreign key to purchinv table. It is usually found in the bill of sale that Specialty Imports receives together with the car from the factory or the business the car was bought from. The same purchinvno may be in multiple cars, as one purchase invoice may comtain multiple cars and it will be null if the car is in the table solely for the purpose of service. If the car is a trade-in, Specialty Imports prepares a bill of sale that would have a purchase invoice no. and that number will be placed here.
  • carmake, carmodel and caryear are self-explanatory.
  • extcolor - the exterior color of the car
  • cartrim - the interior color
  • purchcost - what specialty imports paid to acquire the car for sale purposes. This column is placed in car table as opposed to purchinv table, due to the fact that a purchinv (purchinvno) may contain multiple cars. Again this column will be null if the car is in the table solely for the purpose of service.
  • freightcost - what was paid to bring the car over from wherever the car was purchased. This is passed on to the customer.
  • carlistprice - This goes on the windshield. Specialty Imports is happy if the car can be sold for this much but it is usually sold for less. The actual sale price is the 'net' field in the 'saleinv' table.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

Students also viewed these Databases questions

Question

What is the meaning and definition of E-Business?

Answered: 1 week ago