SQL PLSQL Interview Questions
Questions Answers Views Company eMail

trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output trans_id trans_date trans_amt debit_credit_indicator 001 JAN 1599 cr no.of trans 2 i want trans_id and trans_date like 'JAN' or 'FEB' etc, trans_amt i want all credit amount - debit amount per each trans_id. and debit_credit_indicator and no.of transactions in a month.

Oracle,

1 4611

I Have A Table Like This. Cityno Cityname Mails 1 Bangalore 8km 2 Hsr Layout 20km 3 Mejistic 30km 4 Jayadeva 55km 5 Itpl 80km 6 Hebbal 115km I Have Data Like This I Want O/p Like This Distance No.ofcity 0-50km 3 51-100km 2 101-150km 4 And So On

DELL, HCL, Oracle,

6 11424

i have a customer table. trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output. trans_id trans_amt debit_credit_indicator i want get highest credit amount and lowest credit amount and highest debit amount and lowest debit amount for each trans_id. pls give me answer. i want urgent

3 4908

i have a table like this. cityno cityname mails 1 BANGALORE 8KM 2 HSR LAYOUT 20KM 3 MEJISTIC 30KM 4 JAYADEVA 55KM 5 ITPL 80KM 6 HEBBAL 115KM I HAVE DATA LIKE THIS I WANT O/P LIKE THIS DISTANCE NO.OFCITY 0-50KM 3 51-100KM 2 101-150KM 4 AND SO ON pls give me answer. i want urgent

6 6905

i have xml source. xml source having lacks of records. i want extract/retrive xml source data using sql query. please tell me how to write query.

TCS,

4 7021

i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL 9 10 11 12 NULL. I WANT COUNT OF NULL VALUES IN TABLE. WRITE A QUERY.

iGate, Wipro,

14 18322

what is d diff between grant,commit,rollback n savepoint

1 7492

PL/SQL allocates memory for the variable's at runtime or at compile time

3 5856

what is self join and how it works??

Infosys,

2 7294

wtite down triggr not any entry on Sunday

NIT,

2 5164

hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

1523

Hi All, I am new to both this blog and technology. I was able to see a response for one of the questions on triggers as below. I would like to know why are we using " if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then" instead, can't we use " if sysdate = 'sunday' then". I can understand the use of "rtrim", but dont know y v r using to_char. I have seen this in many cases but did not get a convincible explaination. Please help me with this and do excuse if this question sounds silly. Thanks in advance...... create or replace trigger trg_sun before insert on

begin if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then raise_application_error(-20345,'no transaction in sunday'); end if; end trg_sun;

2 3221

how to check the 3rd max salary from an employee table? One of the queries used is as follows: select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal). Here in the sub query "select count(distinct(sal)) from emp b where a.sal<=b.sal" or "select count(distinct(sal)) from emp b where a.sal=b.sal" should reveal the same number of rows is in't it? Can any one here please explain me how is this query working perfectly. However, there is another query to get the 3rd highest of salaries of employees that logic I can understand. Pls find the query below. "select min(salary) from emp where salary in(select distinct top 3 salary from emp order by salary desc)" Please explain me how "select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal)" works source:http://www.allinterview.com/showanswers/33264.html. Thanks in advance Regards, Karthik.

4 6687

Display the total debit counts, total credit counts, sum of total debits, sum of total credits from an employee's transaction table (a single table) containing the following columns. Transaction_number Transaction_amount Transaction_date Transaction_type --> tells if the amount is a credit or a debit. As the query alone is important, the table is left with specifying just the field's name. Pls help me with this query.

iNautix, Oracle,

3 16171

Create a procedure to delete certain records from a table and display the total number of records deleted in this process. (Condition for deletion can be of ur choice, for instance delete all records where eid='')

2 6762


Post New SQL PLSQL Questions

Un-Answered Questions { SQL PLSQL }

How do you delete duplicates in sql query using rowid?

533


Does asenumerable execute the query?

594


what is 'mysqladmin' in mysql? : Sql dba

529


How to find 3rd highest salary of an employee from the employee table in sql?

565


Does sql full backup truncate logs?

527






Write the command to remove all players named sachin from the players table.

732


Define join and name different types of joins?

514


What are stored procedures in mysql?

556


What is oracle sql developer?

603


What is a pl/sql block?

590


Why are cursors used?

578


Why function is used in sql?

518


Is left join same as inner join?

535


what is meant by urlencode and urldocode? : Sql dba

598


What are local and global variables and their differences?

580