SQL PLSQL Interview Questions
Questions Answers Views Company eMail

Its possible to add more than one primary key for the table

4 6406

Write a procedure to return the month and the number of developers joined in each month (cursor )

Tech Mahindra,

2 8464

select 10 from dual; y its showing all the rows with 10?

1 4937

how to create temparary sequence

TCS,

2 6759

i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

1 3177

What is the Difference between Procedure and Function.Can we call a Function in a DML?

TCS,

2 7018

A table was given with 3 columns like Manager id,Manager Name and Employee name. Question was to create hierarchy.

TCS,

2 7727

Practice 1: Changes to data will only be allowed on tables during normal office hours of 8.45 in the morning until 5.30 in the afternoon, MONDAY through FRIDAY. A. Create a procedure called SECURE_DML that prevents the DML statement from executing outside of normal office hours, returning the message: “you may only make changes during normal office hours” b. Create a statement trigger on the PRODUCT table which calls the above procedure. c. Test it by inserting a new record in the PRODUCT table.

Tech Mahindra,

1 10544

how to find the First and Last Observation from the table: Ex: OBS Name Sal Ans like: OBS Name Sal 105 E 5000--> 105 E 5000 102 B 2000 104 D 4000 103 C 3000 101 A 1000--> 104 D 4000

4 4812

I have the table like this S.No Name ID 01 Xyz 123 I want the result as 01Xyz123 How to write the query to retrieve the entire row data in a single column?

1 4039

How will you debug your procedure? If your procedure is around 2000 lines and the expected output is 10 and we get only output 5.So how will you debug it? Somebody pls give the correct answer?

Fidelity,

2 11450

Table1: Col1 col2 1 2 10 3 4 89 5 6 Table:2 Col1 col2 3 2 9 5 4 7 6 87 With the help of table1 and table2 write a query to simulate the fallowing results. Output1: Col1 col2 1 2 2 3 3 4 4 5 5 6 Output2: Col1 col2 2 3 10 4 5 89 6 7 1.Write query for single row to multiple row using sql statements. Eg:a,b,c,d,e,f Change to A B C D E F 2. Write query for multiple row to single row using sql statements. Eg2 A B C D E F Change to Eg:a,b,c,d,e,f Table1: Col1 col2 8 5 2 9 4 2 5 1.Write a query to select all the rows from a table1,if the value of A is null then corresponding B’s value should be printed in A’s value.if the value of A is null in that table then corresponding B’s value should be printed as 30. 2. write a query to find the sum of A and B .display the max among both. 3.write a query to find total number of rows from table 1. Note: if any column value is null in a row then that row should be considered as 2 rows. 4.write a query to display all the records of table1 except A containg 2 as well B containg 5. 5.rewrite the fallowing without using join and group by. Select b.title,max(bc.returneddate –bc.checkoutdate)” mostdaysout” From bookshelf_checkout bc, Book shelf B Where bc.title(+)=b.title Group by b.title. 6.rewrite fallowing query Select id_category from category_master X where exists (select 1 from sub_category Y where X.id_category=Y.id_category) Customer: Name phone1 phone2 phone3 bitwise A 23456 67890 12345 --- B 67459 89760 37689 --- Don’t_call Col1 67890 37689 1.q) update the customer table of bitwise with 1 or 0. Exists in don’t_call table menas show -1 Other wise -0. Output. Name bitwise A 010 B 010

Protech,

2001

what is an associative array with example?

1 3261

what is global temporary tables and how use that tables in pl/sql packages

Cap Gemini,

1 9528

What is Materialized View? In What Scenario we Use Materialized View?

Dinesh, Marlabs,

2 8488


Post New SQL PLSQL Questions

Un-Answered Questions { SQL PLSQL }

What is memory optimized table?

565


How many sql commands are there?

656


What is an implicit commit?

538


What are the three pl sql block types?

560


Which version of sql do I have?

549






Is there any restriction on the use of union in embedded sql?

659


how can we know the count/number of elements of an array? : Sql dba

564


Is primary key always clustered index?

525


Does google use sql?

500


What is the difference between a procedure and a function?

480


does sql support programming? : Sql dba

595


can a stored procedure call itself or recursive stored procedure? : Sql dba

568


Can sql developer connect to db2?

571


What is a string data type in sql?

505


Mention what pl/sql package consists of?

524