Total Pageviews

February 14, 2015

2/14/2015 03:23:00 AM
1)created table atest2 as select * from dual
what is the output for
select sysdate from atest2;

2)Can I create a trigger on atest2;
  Justify your statement?

3) Created view on two tables,
if one of the table structure changed what will happen to the view?

4) What is AUTHID? what is the user of that?

5) Create table atest3 as select * from emp, dept
 is it right statement?

6) Suppose I have permanent address, temporary address in same table, how you will get both address?

7) What is the returning statement in pl/sql, what is the use of that statement?

8) What is the use of "where current of" in dml statements


9) Is it possible to create a cursor without defining a cursor (other than implicit cursor)?

New Questions
1) You encounter the following statements:
SELECT e1.ename|| 'works for '||e2.ename "Employees and their Managers"
FROM emp e1, emp e2 WHERE e1.mgr=e2.empno;
What kind of join is this ?
A. Cartesian
B. Self
C. Outer
D. Equi

2) You have the statement "SELECT BirthDate, TO_CHAR(BirthDate, 'Month, ddth
"in, YyyY') Formatted". If the data is 11-NOV-46, what will Oracle return as the formatted date ?
A. November ,11th in 1946
B. Nov 11, 1946
C. November 11, 1946
D. November , 01TH in 1946
E. 11-11-46
F. 11/11/46

3) ABC company is about to give each staff a $500 increase in monthly salary. You want to "preview"
the result from your database table without making any modification. How do you do that?
A. You cannot do this. Actual update will take place.
B. Give the arithmetic expression to invoke salary increment in the select clause
C. Give the arithmetic expression to invoke salary increment in the where clause
D. Give the arithmetic expression to invoke salary increment in the from clause
E. Give the arithmetic expression to invoke salary increment with an update clause

4)Create table student
(Student_id number(4) primary key,
Student_name varchar2(15),
Course varchar2(10) not null,
Age number(2) check (age between 18 and 65));
For which column(s) will an index be created automatically?

A. Student_id  B. Student_name  C. Course D. Age

4) What kind of join condition am I creating between the EMP and DEPT table in the following query?
Select a.ename, b.job
From emp a, dept d;
A. Equijoin B. Outer Join C. Castesian product D. Self Join E. Non-Equijoin

5) What kind of join condition am I creating in the following query?
Select a.ename "Employee", a.job, b.ename, b.job
From emp a, emp b
where a.empno = b.empno;
A. Equijoin B. Outer Join C. Castesian product D. Self Join E. Non-Equijoin

6) Which type of PL/SQL statement would you use to increase the price values by 10 percent for items
with more than 2,000 in stock and by 20 percent for items with fewer than 500 in stock?
A. An IF...THEN...ELSE statement B. A simple INSERT loop C. A simple UPDATE statement
D. A WHILE loop

7) For which of the following would you use the ALTER TABLE...MODIFY option?
A. Add a column to the table.B. Disable a table constraint.C. Drop a table column.

8) What is a characteristic of only PL/SQL?
A. Accepts input of variables. B. Allows shutdown of the database. C. Allows use of exception handling routines based on error numbers. D. None of the above.

9) You query the database with this command: SELECT atomic_weight FROM chart_n WHERE
(atomic_weight BETWEEN 1 AND 50 OR atomic_weight IN (25, 70, 95)) AND atomic_weight
BETWEEN (25 AND 75) Which of the following values could the statement retrieve ?
A. 51 B. 95 C. 30 D. 75

10) You query the database with this command: SELECT isotope, group_id,mass_no,
DISTINCT(atomic_weight) FROM chart_n; What values are displayed?

A) Distinct combinations of isotope, group_id, mass_no, and atomic_weight.
B) isotope and distinct combinations of group_id, mass_no, and atomic_weight.
C) isotope, group_id, mass_no, and distinct values of atomic_weight.
D) No values will be displayed because the statement will fail.



11) Evaluate this procedure: CREATE OR REPLACE FUNCTION found_isotope (v_energy_line IN
BOOLEAN, v_proper_ratio IN BOOLEAN) RETURN NUMBER IS Ret_val NUMBER; BEGIN IF
(v_energy_line AND v_proper_ratio) THEN ret_val:=1; ELSIF NOT (v_energy_line AND
v_proper_ratio) THEN ret_val:=2; ELSIF (v_energy_line AND v_proper_ratio) IS NULL THEN
ret_val:=-1; END IF; RETURN ret_val; END; If v_energy_line equals TRUE, and v_proper_ratio
equals NULL, which value is assigned to ret_val?
A) 1 B) 2 C) -1 D) None of the above

12) Evaluate this command: SELECT i.isotope, g.calibration FROM chart_n i, gamma_calibrations g
WHERE i.energy = g.energy; What type of join is the command?
A. Equijoin B. Nonequijoin C. Self-join D. The statement is not a join query

13) Evaluate this command: ALTER TABLE customer DISABLE CONSTRAINT pk_customer
CASCADE; Which task would this command accomplish?
A. Delete only the primary key values.
B. Disable all dependent integrity constraints.
C. Disable only the primary key constraint.
D. Alter all dependent integrity constraint values.

14) Which of the following is a purpose of the user-defined constraint?
A. To enforce not-null restrictions B. To enforce referential integrity
C. To enforce business rules
D. To take action based on insertions, updates, or deletions in the base table

15) The PL/SQL executable section contains which type of statements ?
A. PL/SQL and SQL statements to manipulate data in the database
B. The procedure or function name and input/output variable definitions
C. The definition of program variables, constants, exceptions, and cursors

D. Statements to deal with error handling

11) Evaluate this procedure:
 CREATE OR REPLACE FUNCTION found_isotope (v_energy_line    IN BOOLEAN,
                                          v_proper_ratio   IN BOOLEAN)
   RETURN NUMBER
IS
   Ret_val   NUMBER;
BEGIN
   IF (v_energy_line AND v_proper_ratio)
   THEN
      ret_val := 1;
   ELSIF NOT (v_energy_line AND v_proper_ratio)
   THEN
      ret_val := 2;
   ELSIF (v_energy_line AND v_proper_ratio) IS NULL
   THEN
      ret_val := -1;
   END IF;

   RETURN ret_val;
END; 

If v_energy_line equals TRUE, and v_proper_ratio
equals NULL, which value is assigned to ret_val?
A) 1 B) 2 C) -1 D) None of the above
12) Evaluate this command:SELECT   i.isotope, g.calibration
  FROM   chart_n i, gamma_calibrations g
 WHERE   i.energy = g.energy;

 What type of join is the command?
A. Equijoin B. Nonequijoin C. Self-join D. The statement is not a join query

13) Evaluate this command: ALTER TABLE customer DISABLE CONSTRAINT pk_customer
CASCADE; Which task would this command accomplish?
A. Delete only the primary key values.
B. Disable all dependent integrity constraints.
C. Disable only the primary key constraint.
D. Alter all dependent integrity constraint values.

14) Which of the following is a purpose of the user-defined constraint?
A. To enforce not-null restrictions B. To enforce referential integrity
C. To enforce business rules
D. To take action based on insertions, updates, or deletions in the base table

15) The PL/SQL executable section contains which type of statements ?
A. PL/SQL and SQL statements to manipulate data in the database
B. The procedure or function name and input/output variable definitions
C. The definition of program variables, constants, exceptions, and cursors

D. Statements to deal with error handling






 
Related Posts Plugin for WordPress, Blogger...