You are on page 1of 11

2005

Section A
1) Choose the correct answer :
1. a) An oracle database consist of
1) Physical Structure ii) Logical Structure
iii) Both iv) None of these
(b) SQL statements can contain
i) Data Definition Language (DDL)
ii) Data Manipulation Language (DML)
iv) Transaction Control Language (TCL)
v) All of these
vi) None of the above
(c) A relational data model organizes the data into tables known as
i) Relations ii) Functions iii) File iv) None of these
(d) Which is the process of building the database structure to store data?
i) Concurrency management ii) Compilation
iii) Normalization iv) None of the above
(e) A join is a query that combines rows from
i) first & last table ii) two or more table
iii) same table iv) none of these
(f) The function that removes some characteristics of the given string is
i) LTRIM ii) RTRIM iii) INSTR iv) None of these
(g) Which of the following is not a DML statement
i) COMMIT ii) UPDATE iii) DELETE iv) INSERT v) None of these
(h) The operators are used to connect search conditions in the WHERE
clause are
i) Logical Operators ii) Relational Operators iii) Arithmetic Operators
iv) None of these
(i) From the results of two or more queries, the INTERSECT operator
returns
i) One row ii) common rows iii) All rows iv) None of these
(j) DUAL table is generally used for
i) Insert Clause ii) Update Clause iii) Select Clause iv) None of these
2) Fill in the blanks
a) AVG() is group function.
b) The MINUS is a set operator.
c) IN operator compares a value to every value of a list returned by a
sub query.
d) _____________ function finds out the number of months used
between given two dates.
e) A view is created or defined using the ___________ statement.
f) _________ function converts n string to lower case.

3) State True or False


a) ROUND is an arithmetic function. T
b) The unary operators operate in two operands. F
c) Schema refers to the collection of logical structure of data. T
d) Oracle database systems consist of an oracle server instance and oracle
database. T
e) A sequence is created with CREATE command. T
f) The variables are created in PL/SQL block. F
g) MOD is a string function.
h) DML stands for Data Management Language.

SECTION –B
4). Differentiate any two of the following:
a) for loop and while loop
b) DML & DCL
c) sub queries & nested sub queries

5).STUDENT_TBL

Column Name Data Type Size Constraint

Student id Number 6 Primary key, Not Null


Name varchar2 25 Not Null
Address varchar2 30 Not Null
City varchar2 15 Not Null
State varchar2 10 Not Null

STUDENTS_MARKS_TBL

Student id Number 6 Primary key, Not Null


Phy_marks Number 3 Not Null
Chem_marks Number 3 Not Null
Bio_marks Number 3 Not Null

Write SQL statements for any four of the following:


a) List all students who have scored more than 60 in phy_marks.
b) List all students who have scored more than 60 in all three subjects.
c) List all students who have scored more than 60 in Physics but more than 50
in Chemistry & Mathematics.
d) List all students who have scored less than 40 in all the three subjects.
e) List the name of all students who scored more than 60 in chemistry and
having the city address Patna.

6). Write the output of any six of the following SQL queries.
a. select LENGTH(“Rakesh Kumar”) from dual;
b. select MOD(35,6) from dual;
c. select POWER(6,4) from dual;
d. select ROUND(15,193,1) from dual;
e. select SQRT(625) from dual;
f. select INITCAP("good day”) from dual;
g. select UPPER(“Large”) from dual;
h. select TRUNC(15,79,1) from dual;

7). Answer any three of the following:

a) What is Relational Database Management System (RDBMS)? Explain


it with its main characteristics.
b) Describe in brief the use & importance of database triggers.
c) Explain PL/SQL Also discuss about the rules to be followed while
explaining it. In a database.
d) Explain about object Navigator with example.
2004

SECTION – A
1) Select the fittest answer from among the given set of possible answers:-
i) who develop the Normalization process ?
a) C.B. Dale b) Collin White
c) E.F. Codd d) Donald Chamserlin
ii) Which is the process of building database structure to store data?
a) Concurrency Management b) Compilation
c) Normalization d) None of the above
iii) Which of the following is an integrity constraint?
a) Domain constraint b) Entity Integrity
c) Referential Integrity d) All of the above
iv) Which of the following is not a DML statement?
a) COMMIT b) UPDATE
c) DELETE d) INSERT
v) What is the process that is done to SQL before exception, to check the proper
syntax and to optimize the request called?
a) Syntax checking b) Performance Training
c) passing d) Optimizing
vi) SQL % FOUND is TRUE if
a) at least one row was processed b) entire row was processed
c) no row was processed d) none of above
vii) if the variable is prefixed with a double ampersand (&&) SQL *Plus will
a) only prompt the value once b) prompt the value twice
c) not prompt the value d) none of the above
viii) DUAL table is generally used for
a) insert clause b) update clause
c) Alter clause d) select clause
ix) Which of the following database object does not physically exist
a) Base Table b) Index
c)View d)select clause
x) Avg() is
a) single row function b) group function
c) string function d) none of the above
2). Fill in the blanks with suitable words.
i) UNION, INSERT and MINUS are set operators.
ii) Grant is DCL command.
iii) To set a line ___________ command is used.
iv) A table can have only one primary key.
v) There are two types of operators logical and Relational (unary, binary).
vi) A view is created or defined using the create view statement.

State True or False

i) By default spool is off.


ii) AND, OR and NOT are logical operators.
iii) The unary operator operates on two operands.
iv) SQL is coded with embedded data navigational instructions.
v) For developing applications, oracle provides its own tool called Developer
2000.
vi) Bind variables are created in PL/SQL.

SECTION - B

6) Answer any two of the following:

i) Write PL/SQL code to accept your name in uppercase and convert in lower
case.
ii) Write PL/SQL code to insert row in emp_table.
iii) Write PL/SQL code 16 update emp table where name is SHYAM. Exception
should be raised if error is found.
SECTION – C
7. Explain the following:

i) Explain form level triggers and item level triggers.


ii) Explain special characteristics of RDBMS.
iii) Explain PL/SQL. Which rule should be followed while explaining it to a
database?
iv) Is there any provision of exception handling in oracle? If yes, explain.
2003

The table structure for emp and dept I given below:

Structure of emp table:-

Empno not null number(4)


Ename varchar2(15)
Sal number(5,2)
Comm. number(5,2)
Job varchar2(10)
Mgr number(4)
Deptno number(2)
Hiredate date

Structure of dept table

Deptno not null number(2)


Dname varchar2(14)
Loc varchar2(15)

(Dept is parent table and emp is child table)

This table may be referred for answering the questions.

SECTION - A
1. Tick the most correct choice:
i) DDL commands are
a) Allowed in PL/SQL
b) Not allowed in PL/SQL
c) None of the above
ii) Select correct one from the following:
a) SQL statements are case sensitive.
b) Keywords can be splitted across lines.
c) SQL statements can be entered on one or many lines.
d) Keywords must be in uppercase.
iii) Round(44,926,2), produce the result.
a) 44.92
b) 44.93
c) 15
d) None of the above
iv) DUAL table is generally used for
a) Insert clause
b) Update clause
c) Alter clause
d) Select clause
v) Identify the single row function
a) AVG
b) MIN
c) LOWER
d) VARIENCE
vi) How to change the name of a table from “dept” to department?
a) RENAME dept to departments
b) ALTER dept to departments
c) MODIFY dept to departments
d) SET dept to departments

vii) Use of VIEW is to


a) Restrict data access.
b) Make complex queries easy
c) To present different views of the same data
d) All of the above
viii) SQL% FOUND is TRUE if
a) at least one row was processed
b) entire row was processed
c) no row was processed
d) None of the above
2. Fill in the blanks.
a. An LOV can be used as a validation tool by setting display property.
b. A display item is similar to a text item except that it can be ___________ at
c. run time.
d. CREATE is DDL argument.
e. NO_DATA FOUND is a predefined exception .
f. COMMIT command makes transaction permanent.
g. To see the table structure, we use DESCRIBE command.
h. Triggers are PL/SQL blocks that fire when an insert, update or delete is
performed on the table.

3. State True or False


a) The pre-form trigger fires before the when new form instance triggers.
b) By default, the type of canvas is ‘content’.
c) Only one primary key per table is allowed.
d) Exceptions are raised implicitly only.
e) Null values are displayed first for ascending order.
f) Group functions can be used in order by clause.

SECTION – B

1. Differentiate any two of the following.


a) DROP and TRUNCATE command.
b) DDL & DCL
c) Procedure & function
d) Single row function and group function

2. (b) Write SQL statements for any four


i) Find the maximum and average salaries of each job type.
ii) Display the name of an employee where the third letter of their name is
an ‘A’.
iii) For each employee display the employees name and calculate the
number of months between today and the date the employee was hired.
Label the column months worked.
iv) Write a query to display the employee name, department name and
location of all employees who earn a commission.
v) Write a query to display the employee name and hire date for all
employees in the same department as Blake. Execute Blake.
vi) List all employees by name and mgr number along with manager’s
name.

3. Create a report in SQL*PLUS that displays the job title, name and salary for all
employees where salary is less than 53000. Add a centered, two-line header that
reads Employee Report and a centered footer that reads Confidential. Rename the
salary column to read salary and format it as:

Format is

Employee
Report

Job Employee Salary


Category
_______ ________ ______
_______ ________ ______

Confidential

4. Write PL/SQL code for any two:


i) Write a PL/SQL code to delete the record for an employee number.
Exception should be raised if found error.
ii) Write a PL/SQL code to raise the salary of each employee by 10 for
department number is 10.
iii) Write PL/SSQL code to accept your city name in lower case and change it
into uppercase.

SECTION – C
1. Answer any four questions.
a) Describe the use of Exceptions in oracle? Explain different types of
exceptions with examples.
b) Explain form level triggers. Describe different types of it.
c) What are the basic steps to be followed while using Explicit cursors?
d) Compare SQL statements versus SQL*Plus commands.
e) What is a join? Explain different types of join.

You might also like