Using sql, i need to make Lineno and orderline into a composite key how can i do this this, so far i’ve got
CREATE TABLE ORDERLINE (
ORDERNO INTEGER NOT NULL,
LINENO VARCHAR(4) NOT NULL,
NUMBERORDERED NUMERIC DEFAULT '1',
QUOTEDPRICE NUMERIC DEFAULT '0.00',
CONSTRAINT ORDERLINE_ORDERNO_PK PRIMARY KEY (ORDERNO),
CONSTRAINT ORDERLINE_ORDERNO_CC CHECK (ORDERNO BETWEEN 10000 AND 99999),
CONSTRAINT ORDERLINE_NUMBERORDERED CHECK (NUMBERORDERED BETWEEN 1 AND 100)
);
You’re very close. Note the addition of the column name above.
Identify which field is more likely to be a leading column in any query and put it first. For example; if you often access by OrderNO, LineNo that would be the best order, if however you access by LineNo, OrderNO go with that order.