SQL Plus Interview Questions And Answers

Download SQL Plus Interview Questions and Answers PDF

Sharpen your SQL Plus interview expertise with our handpicked 20 questions. These questions are specifically selected to challenge and enhance your knowledge in SQL Plus. Perfect for all proficiency levels, they are key to your interview success. Access the free PDF to get all 20 questions and give yourself the best chance of acing your SQL Plus interview. This resource is perfect for thorough preparation and confidence building.

20 SQL Plus Questions and Answers:

SQL Plus Job Interview Questions Table of Contents:

SQL Plus Job Interview Questions and Answers
SQL Plus Job Interview Questions and Answers

1 :: Please Explain Connect by Prior?

Retrieves rows in hierarchical order.e.g. select empno, ename from emp where.

"connect by prior" is clause which is used in hierarchical queries.Example
select ename,empno,mgr,job
from emp
start with job='PRESIDENT'
connect by prior empno=mgr;
Read More

2 :: Explain ROWID?

ROWID is a pseudo column generated at the run time(during inserting value). Its a hexadecimal value which is unique identification for each record
Read More

3 :: Explain Explicit Cursor attributes?

%IS OPEN,%FOUND,%NOT FOUND,%ROW COUNT
Read More
Database Link is a named path through which a remote database can be accessed
Read More

5 :: Explain What is a corelated subquery?

Correlated subquery is the subquery, where the subquery has been executed for the every row processed by the parent statement.
Read More

6 :: Explain How to drop the index?

Drop Index Indexname
Read More

7 :: What is a join in Oracle? Explain the different types of joins?

Join is a query which retrieves related columns or rows from multiple tables.Self Join - Joining the table with itself.Equi Join - Joining two tables by equating two common columns.Non-Equi Join - Joining two tables by equating two common columns.Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.

JOIN: Return rows when there is at least one match in both tables
LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table
RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table
FULL JOIN: Return rows when there is a match in one of the tables
Read More

8 :: Explain What are the data types allowed in a table?

CHAR,
VARCHAR2,
NUMBER,
DATE,
RAW,
LONG and
LONG RAW.
Read More

9 :: Explain How do we replace a comma (,) with a blank in a select statement?

select empno||' '||ename from emp;

select replace (column name,',','') from table name.
Read More

10 :: Explain Can a view be updated/inserted/deleted?

if a view is update, deleted , or inserted wil the changes be refelected on the base table
Read More

11 :: Explain What are the different types of SQL?

There are 5 types

1.data definition type

2.data manipulation

3.data control

4.transaction control

5.data query

SQL is Structured Query Language is a database computer language designed for managing data in relational database management systems (RDBMS).

PostgreSQL is an object-relational database management system (ORDBMS).It is released under a BSD-style license and is thus free software. As with many other open-source programs, PostgreSQL is not controlled by any single company, but has a global community of developers and companies to develop it.

SQLite is an ACID-compliant embedded relational database management system contained in a relatively small (~225 KB) C programming library. The source code for SQLite is in the public domain.

MySQL is a relational database management system (RDBMS) which has more than 6 million installations. MySQL stands for "My Structured Query Language". The program runs as a server providing multi-user access to a number of databases.
Read More

12 :: Explain some PL/SQL Exceptions?

TOO_MANY_ROWS

NO_DATA_FOUND

INVALID_CURSORS

CURSOR_ALREADY_OPEN

DUP_VAL_ON_INDEX
Read More

13 :: Explain What is a Cartesian product?

A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join.
Read More

14 :: Explain What is an Integrity Constraint?

Integrity constraint is a rule that restricts values to a column in a table.
Read More

15 :: Explain How do we eliminate the duplicate rows?

Use the DISTINCT keyword right after SELECT...

i.e. SELECT DISTINCT customername FROM customer

select * from emp e where rownum=
(select max(rownum) from emp ee
where e.empno=ee.empno)
Read More

16 :: Explain What is meant by SORTING and GROUPING?

For sorting we use order by clause in select statement. This is used to sort data in ascending order or descending order.
To group data based on perticulr column we use groupby clause.
Both are used to get distinct values.
Read More

17 :: Explain What is the maximum number of triggers, can apply to a single table?

Insert/Update/Delete :- 3
Before/After:- 2
Row Level/Statement Level:-2

Hence 3*2*2
Read More

18 :: How to use SQL to build SQL, what is this called and give an example?

This is called dynamic SQL. An example would be:
set lines 90 pages 0 termout off feedback off verify off
spool drop_all.sql
select ?drop user ?||username||? cascade;? from dba_users
where username not in ("SYS?,?SYSTEM?);
spool off
Essentially you are looking to see that they know to include a command (in this case DROP USER...CASCADE;) and that you need to concatenate using the ?||? the values selected from the database.
Read More

19 :: Explain What is the output of SIGN function?

SIGN (a): Returns 1 if a is positive or if a is 0, and -1 if a is less than 0.
Read More

20 :: Explain What is meant by Scrollable cursor?

A scrollable cursor, however, can move forward and backward, and can seek any desired record in the cursor. Such operations are common in applications that present results sets in scrolling windows. With a scrollable cursor, application developers do not need to create and manage their own buffer for the records.
Read More