SQL PLSQL Interview Questions
Questions Answers Views Company eMail

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

4 6418

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

Tech Mahindra,

2 8470

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

1 4944

how to create temparary sequence

TCS,

2 6762

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 3183

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

TCS,

2 7024

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

TCS,

2 7736

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 10549

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 4044

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 11458

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,

2005

what is an associative array with example?

1 3265

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

Cap Gemini,

1 9541

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

Dinesh, Marlabs,

2 8497


Post New SQL PLSQL Questions

Un-Answered Questions { SQL PLSQL }

Can we rollback after truncate?

557


What are system versioned tables?

542


what is the command used to fetch first 5 characters of the string? : Sql dba

1126


Does db2 use sql?

502


What is foreign key and example?

499






what are string data types? : Sql dba

500


What is the usage of distinct keyword?

621


What does subquery mean in sql?

530


Does postgresql run on the cloud?

580


Is microsoft sql free?

590


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

1999


Can a commit statement be executed as part of a trigger?

598


What is the difference between nested table and varray?

510


What is the difference between sql, mysql and sql server?

523


what is meant by nl2br()? : Sql dba

558