A
A
NAME NULL TYPE
STUD_ID NOT NULL NUMBER(
NAME NOT NULL VARCHAR
ADDRESS VARCHAR
GRADUATION DATE
WHICH STATEMENT INSERT A NEW ROW INTO THE STUDENT TABLE ?
A
GRADUATION COLUMN IS A FORIGN KEY COLUMN TO THE GRADUATE TABLE EXAMINE THE DATA IN THE GRAD_DATE_TABLE
GRADUATION
WHICH UPDATE STATEMENT PRODUCES THE FOLLOWING ERROR
ORA
KEY NOT FOUND
A
WHERE STUD
CREATE OF REPLACE VIEW EMP_VIEW AS
SELECT DEPTNO
GROUP BY DEPTNO;
WHAT HAPPENS WHEN THIS COMMAND IS USED ?
UPDATE EMP_VIEW SET TOT_SAL =
ANS THE BASE TABLE CANNOT BE UPDATED THROUGH THIS VIEW
NAME NULL TYPE
EMPNO NOTNULL NUMBER(
YEARLY_SAL NUMBER(
MONTHL_SAL NUMBER(
WHICH STATEMENT RETRIVES ALL DATA FROM ANN_SAL VIEW ?
ANS
IF V_VALUE >
V_NEW_VALUE :=
ELSEIF V_VALUE >
V_NEW_VALUE :=
ELSEIF V_VALUE >
V_NEW_VALUE :=
ELSE
V_NEW_VALUE :=
ENDIF;
WHAT VALUE BE ASSIGNED TO V_NEW_VALUE IF V_VALUE =
ANS:
ID NUMBER(
NAME VARCHAR(
MANAGERID NUMBER(
IN THIS INSTANCE MANAGER ARE PLAYER AND YOU NEED TO DISPLAY A LIST OF PLAYERS EVALUATE THESE SQL STATEMENT
SELECT P
WHERE M
SELECT P
WHERE M
HOW WOULD THE RESULT DIFFER
ANS: THE RESULT WILL BE SAME BUT DISPLAY WILL BE DIFFERENT
DECLARE
TYPE EMP_TABLE IS TABLE OF EMP%ROWTYPE
INDEX BY BINARY INTEGER E
EMP_TABLE EMP_TABLE_TYPE;
YOU WANT TO CREATE A CURSOR THAT CAN BE USED SEVERAL TIMES IN A BLOCK
ANS: A CURSOR THAT USE PARAMETERS
ANS: YOU DO NOT EXPLICITY OPEN
NAME NULL TYPE
DEPTNO NOTNULL NUMBER(
DNAME VARCHAR
LOC VARCHAR
EXAMINE THE CODE
DECLARE
DEPT_REC DEPT%ROWTYPE
BEGIN
SELECT * INTO DEPT_REC FROM DEPT WHERE DEPTNO =
END
WHICH PL/SQL STATEMENT DISPLAYS THE LOCATION OF SELECTED DEPARTMENT
ANS: DBMS_OUTPUT
IMPLICT CURSORT ARE DECLARED IMPLICITY FOR ALL THE DML AND SELECT STATEMENTS
DECLARE
V_RESULT NUMBER(
BEGIN
DELETE FROM EMPLOYEE WHERE DEP_ID IN(
V_RESULT:= SQL%ROWCOUNT;
COMMIT
END;
WHAT WILL BE THE VALUE OF V_RESULT IF NO ROWS ARE DELETED;
ANS: ZERO
ANS: SELECT STATEMENT DOES NOT RETURN A ROW
SELECT STATEMENT RETURNS MORE THAN ONE ROW
ANS:
DECLARE
V_HIREDAT DATE:= SYSDATE;
BEGIN
INSERT INTO EMP (EMPNO
VALUES (EMPNO_SEQUENCE
END;
EVALUATE THIS PL/SQL BLOCK
BEGIN
FOR I IN
IF I=
ELSE
INSERT INTO TEST(RESULT) VALUES(
END;
COMMIT;
END LOOP;
ROLL BACK;
END;
HOW MANY VALUES WILL BE INSERTED INTO THE TEST TABLE ?
ANS:
CREATE PUBLIC SYNONYM EMP FOR ED_EMPLOYEE
WHICH TASK HAS BEEN ACCOMPLISHED?
ANS: THE NEED TO QUALIFY THE OBJECT VALUE WITH ITS SCHEME IS ELIMINATED FOR ALL USERS
WHERE
SELELECT DEPT_NO
FROM EMPLOYEE
WHERE AVG(MONTHS_BETWEENS(SYSDATE
GROUP BY DEPT_NO
ORDER BY AVG(MONTHS_BETWEEN(SYSDATE
WHY DOES THIS STATEMENT CAUSE AN ERROR ?
ANS: A WHERE CLAUSE CAN NOT BE USED TO RESTRICT GRUPS
ID NUMBER(
COST NUMBER(
PRODUCT_ID NUMBER(
EVALUATE THESE SQL STATEMENT
SELECT ROUND(MAX(COST)
ROUND(MIN(COST)
ROUND(SUM(COST)
ROUND(AVG(COST)
SELECT PRODUCT_ID
ROUND(MIN(COST)
ROUND(SUM(COST)
ROUND(AVG(COST)
GROUP BY PRODUCT_ID;
HOW WILL THE RESULT DIFFER
ANS: STATEMENT
STATEMENT CAN DISPLAY MORE THAN ONE
EXECUTABLE
SET SERVER OUTPUT ON
DECLARE
V_CHAR_VAL VARCHAR
BEGIN
V_CHAR_VAL := 慔ELLO WORLD?
DBMS_OUTPUT
END
SET SERVER OUTPUT OFF
THIS CODE IS STORED IN A SCRIPT TITLE NAME 慚YPROC
From:http://tw.wingwit.com/Article/program/Oracle/201311/17157.html