SQL assignment question
SQL Scripts to Create Production Table:
CREATE Table Production
(
SerialNo varchar(20) NOT NULL,
BatchNo varchar(25),
ProductCode varchar(25),
MachineTime decimal(2,2),
AssemblyTime decimal(2,2),
FinishTime decimal(2,2),
Cost varchar(20)
);
SELECT
PRODUCTCODE, AVG(MACHINETIME) AS MACHINETIMEAverage, AVG(ASSEMBLYTIME) AS ASSEMBLYTIMEAverage, AVG(FINISHTIME) AS FINISHTIMEAverage ,to_char(AVG(to_NUMBER(SUBSTR(COST,2, LENGTH(COST)-1))), 'L000D000000') AS COSTAverage
FROM PRODUCTION
GROUP BY PRODUCTCODE;
SOLVE SQL PROBLEMS (TASK # 3 – 6)