Click to See Complete Forum and Search --> : A little help with sql query.


Luna_Etoile
October 25th, 2004, 05:34 AM
I just don't get it. Please can someone help.

Write an SQL statement which will produce an Oracle table called PRINTERS. The table will hold basic information about computer printers on sale in a high street store and should contain the following fields:
• Make
• Model
• Serial number
• Price
• Quantity in stock
You should note the following points:
• The serial number field contains alphanumeric data and can be up to 40 characters long.
• The price field must be able to store values uo to £999.99
• The quantity in stock is expressed as an integer value

Gabriel Fleseriu
October 26th, 2004, 07:01 AM
CREATE TABLE PRINTERS
(
MAKE VARCHAR2(80),
MODEL VARCHAR2(80),
SERIAL_NUMBER VARCHAR2(40),
PRICE NUMBER(3,2),
QUANTITY NUMBER(4)
)
/


This will create the table in the default tablespace. Note that the columns MAKE and MODEL have 'common sense' sizes and types. Also note that QUANTITY is layed out for a stock of maximum 9999 Pcs.