Spotify Technology Oracle Interview Questions Answers

What Is The Output Of Sign Function?

1 for positive value,
0 for Zero,
-1 for Negative value.

What Are The More Common Pseudo-columns?

SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM

What Are Pl/sql Cursor Exceptions?
Cursor_Already_Open, Invalid_Cursor

Any Three Pl/sql Exceptions?
Too_many_rows,
No_Data_Found,
Value_Error,
Zero_Error,
Others

To See Current User Name

Sql> show user;

If A View On A Single Base Table Is Manipulated Will The Changes Be Reflected On The Base Table?

If changes are made to the tables and these tables are the base tables of a view, then the changes will be reference on the view.
Spotify Technology Most Frequently Asked Latest Oracle Interview Questions Answers
Spotify Technology Most Frequently Asked Latest Oracle Interview Questions Answers

Can A View Be Updated/inserted/deleted? If Yes - Under What Conditions?

A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or more tables then insert, update and delete is not possible.

What Are The Advantages Of View?

- To protect some of the columns of a table from other users.
- To hide complexity of a query.
- To hide complexity of calculations.

What Is Cycle/no Cycle In A Sequence?

CYCLE specifies that the sequence continue to generate values after reaching either maximum or minimum value. After pan-ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum.

NO CYCLE specifies that the sequence cannot generate more values after reaching its maximum or minimum value.

Which Date Function Returns Number Value?

months_between

Display Odd/ Even Number Of Records

Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
1
3
5

Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2
4
6

To View Installed Oracle Version Information

SQL> select banner from v$version;

Find Out Nth Highest Salary From Emp Table

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);

Enter value for n: 2
SAL
---------------
3700

Explicit Cursor Attributes

There are four cursor attributes used in Oracle

cursor_name%Found,
cursor_name%NOTFOUND,
cursor_name%ROWCOUNT,
cursor_name%ISOPEN

How Do I Display Row Number With Records?

To achive this use rownum pseudocolumn with query, like
SQL> select rownum, ename from emp;

Output:
-----------------
1 Scott
2 Millor
3 Jiyo
4 Smith.

Post a Comment

Previous Post Next Post