|
Home > Archive > Oracle certifications > February 2002 > 2 more 1z0-001 questions need answer?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
2 more 1z0-001 questions need answer?
|
|
| sid456 2002-02-08, 5:57 pm |
| 1. THE PATH TABLE CONTAINS THESE COLUMNS
ID NUMBER(7) PK
COST NUMBER(7,2)
PRODUCT_ID NUMBER(7)
EVALUATE THESE SQL STATEMENT
SELECT ROUND(MAX(COST),2),
ROUND(MIN(COST),2),
ROUND(SUM(COST),2),
ROUND(AVG(COST),2) FROM PART;
SELECT PRODUCT_ID,ROUND(MAX(COST),2),
ROUND(MIN(COST),2),
ROUND(SUM(COST),2),
ROUND(AVG(COST),2) FROM PART
GROUP BY PRODUCT_ID;
HOW WILL THE RESULT DIFFER?
A. STATEMENT 1 WILL ONLY DISPLAY ONE ROW OF RESULTS. STATEMENT 2 CAN DISPLAY MORE THAN ONE.
B. Statement 1 will display a result for each part; statement 2 will display a result for each product.
2. YOU NEED TO CREATE A PL/SQL PROGRAME TO INSERT RECORD INTO EMPLOYEE TABLE. WHICH BLCOK OF CODE SUCCESSFULLY USES THE INSERT COMMAND ?
a. DECLARE
V_HIREDAT DATE:= SYSDATE;
BEGIN
INSERT INTO EMP (EMPNO,ENAME,HIREDATE)
VALUES (EMPNO_SEQUENCE.NEXTVAL,'AND NAME',V_HIREDATE and divisionno);
END;
b. DECLARE
V_HIREDAT DATE:= SYSDATE;
BEGIN
INSERT INTO EMP (EMPNO,ENAME,HIREDATE,division
no)
VALUES (EMPNO_SEQUENCE.NEXTVAL,'AND NAME',V_HIREDATE,and divisionno);
Please help! | |
| siddharth_k 2002-02-09, 12:49 am |
| dear sid,
the answer to the first question would be
A as min, max avg etc are group functions they would rteturn result for the entire table ie select max(salary) from xyz would give you the maximum salary from table whereas select deptno,max(salary) from sal group by deptno would give you maximum salary of individual depts
the second question im not so sure but i think of the given choice it has to be a
as a feels more right than b well you know ... guess work | |
|
|
| metto666 2002-02-09, 8:45 am |
| Hello
1-'A'
2-'B'
Mohamed Metwally | |
| Oracle_de 2002-02-10, 8:31 am |
| hi guys
Metwally is right the answers is :-
1-'A'
2-'B' |
|
|
|
|