Skip to main content

Top 35 SQL Interview Question asked in Oracle Apps Technical Interview or SQL TOP 35 Frequently asked question in Technical Interview

Top 35 SQL Interview Question asked in Oracle Apps R12 Technical Interview 

or 

SQL TOP 35 Frequently asked question in Technical Interview 




    








Frequently asked Technical (SQL) question in Oracle apps r12 -:


1.    To find EVEN NUMBER

select * from emp where rowid in (select decode(mod(rownum,2),0,rowid, null) from emp);

2.    To find EVEN NUMBER

select * from emp where rowid in (select decode(mod(rownum,2),0,null ,rowid) from emp);

3.    To find the 5th MAX salary

select distinct sal from emp e1 where 5 = (select count(distinct sal) from emp e2 where e1.sal <= e2.sal);

4.    To find the 9th MIN salary in the emp table.

select distinct sal from emp e1 where 9 = (select count(distinct sal) from emp e2 where e1.sal >= e2.sal);

5.    How can we use Rownum function/How can get output for first 10-row output

select * from emp where rownum <= &Enter_row_num;

6.    How can get output for Last 10-row output

select * from emp minus select * from emp where rownum <= (select count(*) - &Enter_row_num from emp);

7.    Use of Not in, Not Exists and /Department name without allocation of any Employee in it.
select * from dept where deptno not in (select deptno from emp);  

OR

select * from dept a where not exists (select * from emp b where a.deptno = b.deptno);

8.    To find 21 Max salaries?

select distinct sal from emp a where 21 >= (select count(distinct sal) from emp b where a.sal <= b.sal) order by a.sal desc;

9.    To find 11 Min salaries?

select distinct sal from emp a where 11 >= (select count(distinct sal) from emp b  where a.sal >= b.sal);

10.    To find the Nth maximum salary of an employee with a distinct function?

select distinct hiredate from emp a where &n =  (select count(distinct sal) from emp b where a.sal >= b.sal);

11.    Example of Left or right join

select empno,ename,b.deptno,dname from emp a, dept b where a.deptno(+) = b.deptno and empno is null;

select empno,ename,b.deptno,dname from emp a, dept b where a.deptno = b.deptno(+) and empno is null;

12.    To delete duplicate Records from Table 

delete from emp a where rowid != (select max(rowid) from emp b where  a.empno=b.empno);

13.    Use of Group by Function 

select count(EMPNO), b.deptno, dname from emp a, dept b  where a.deptno(+)=b.deptno  group by b.deptno,dname;

14.    Use of Mathematical Function in the query 

select ename,sal/12 as monthlysal from emp;

15.    Select all record "OR" 

select * from emp where deptno=90 or deptno=40;

16.    Select all record Using Less than and greater than.

select * from emp where deptno=40 and sal>1100;

17.    Use of "Not in" by example 

select * from emp where job not in ('SALESMAN','CLERK');

18.    Use of "IN" by example 

select * from emp where empid in('10','20','30');

19.    Select all records where ename starts with 'Sonu' and its length is 8 char.

select * from emp where ename like'Sonu___';

20.    Select all records where ename end with 'Chauhan'/Use of "%"

select * from emp where ename like'%Chauhan';

21.    Use of Count function

select count(MGR),count(sal) from emp;

22.    Use Formula in select 

select ename,(sal+nvl(comm,0)) as totalsal from emp;

23.    Select  any salary <15000 from emp table using a subquery

select * from emp  where sal> any(select sal from emp where sal<15000);

24.    Select  all salary <5000 from emp table using a subquery 

select * from emp  where sal> all(select sal from emp where sal<5000);

25.    Select all the employee group by deptno and sal in descending order.

select ename,deptno,sal from emp order by deptno,sal desc;

26.    How can I create an empty table emp1 with the same structure as emp?

Create table emp1 as select * from emp where 3=5;

27.    How to retrieve record where sal between 3000 to 7000? / Use of "Between"

Select * from emp where sal>=3000 And  sal<7000

28.    Select all records where dept no of both emp and dept table matches.

select * from emp where exists(select * from dept where emp.deptno=dept.deptno)

29.    How to use Union between two table 

(Select * from emp) Union (Select * from emp1)

30.    To find Intersect/Common attribute value 

(Select * from emp) Intersect (Select * from emp1)

31.     Use of "Minus"

(Select * from emp) Minus (Select * from emp1)

32.    Count the total sal deptno wise where more than 2 employees exist.

SELECT  deptno, sum(sal) As totalsal FROM emp GROUP BY deptno HAVING COUNT(empno) > 2

33.    Example of Subquery 

SELECT * FROM   AP_EXPENSE_REPORT_HEADERS_ALL WHERE  EMPLOYEE_ID IN ( SELECT PERSON_ID FROM   PER_ALL_PEOPLE_F WHERE  EMAIL_ADDRESS = &Email_id )

34.    Example of Union 

SELECT PO_HEADER_ID FROM   PO_headers_all 
union 
SELECT PO_HEADER_ID FROM   PO_lines_all

35     Example of Function Like Sum, Avg, etc 

SELECT avg(RATE) from PO_headers_all




“A GUIDE FOR ORACLE E-BUSINESS SUITE” – A complete Solution and Learning platform For Oracle Apps R12/11i, Training, India Localization, Technical, P2P, O2C, Drop-shipment, AR/AP Cycle, Implementation, Bug or error in Oracle Apps R12/11i, Up-gradation, Support, Alert, Personalization, Discoverer management, OracleApps R12/11i Module, Finance, SCM, MRP, ASCP, WIP, BOM, FA, AP, AR, OM, INV, AOL, MOAC, TCA structure, Project Accounting, CM, Functional,Oracle DBA, ERP, Techno-functional, OAF, Oracle Apps Interview Question and Error in Oracle apps R12/11i. For More Information Visit on www.OracleAppsGuide.com Or Subscribe your email-id on OracleAppsGuide





Comments

Post a Comment

Popular posts from this blog

AP, AR, GL, INV, PA, FA, PO, TCA, Workflow - Interface and Base table in Oracle Apps R12

Main Interface and Base table in Oracle Apps R12 GL Module (General Ledger Module tables in Oracle Apps R12) Interface Table Base Table gl_interface gl_budget_interface gl_je_batches gl_je_headers gl_je_lines gl_je_sources gl_je_categories gl_sets_of_books gl_daily_rates gl_balances gl_periods gl_period_sets gl_code_conbinations AR Module (Account Receivable Module  tables  in Oracle Apps R12) Interface Table Base Table ra_customers_interface_all   ra_contact_phones_int_all ra_customer_profiles_int_all hz_parties hz_cust_accounts hz_cust_acct_sites_all hz_cust_sit_use_all hz_party_sites hz_locations hz_party_site_uses hz_customer_profiles hz_organization_profiles hz_person_profiles ra_interface_lines_all ra_interface_distributions_all ra_interface_salescredits_all ra_customer_trx_all ra_customer_trx_lines_all ra_cust_trx_line_gl_dist_all ra_cust_trx_types_all ar_payment_schedules_all ra_batch_sources_All ar_vat_tax_all ra_terms ar_periods ar_perio

Error: - APP-PER-50022: Oracle Human Resource Could Not Retrieve a Value For The User Type Profile Option. Please ensure it is set property for your responsibility

Error: - APP-PER-50022: Oracle Human Resource Could Not Retrieve a Value For The User Type Profile Option. Please ensure it is set the property for your responsibility. Solution-:      (1)  Go to System administrator > Profile > System       (2) Now Search “ HR: User Type ” Profile option at Responsibility level with Respective Responsibility. And Click On FIND Button. Now Select HR: User Type Value “HR with Payroll User” (you can choose another option as well accordingly). And SAVE. Now check your responsibility, error removed. Go ahead with your next step and enjoy Oracle Apps. For More Information Visit on www.OracleAppsGuide.com Or Subscribe your email-id on OracleAppsGuide.

Definition of Lookup in Oracle Apps R12 Or What is Lookup in Oracle Apps R12? Or What is the main purpose of lookups in Oracle Apps R12?

Definition of Lookup in Oracle Apps R12 Or What is Lookup in Oracle Apps R12? Or What is the main purpose of lookups in Oracle Apps R12? The main purpose of a lookup is to keep programs flexible and easier to configure. Lookups are an approach of creating a configurable “list of values” in E-Business Suite. One of the simplest examples of a lookup type is gender. A “gender lookup” will have definitions as shown next: Code       Meaning M             Male F              Female U             Unknown Suppose that there is a table for employees named PER_ALL_PEOPLE_F and it has the following columns: FIRST_NAME LAST_NAME DATE_OF_BIRTH GENDER The screen that displays an employee’s gender will display a value of Male, Female, or Unknown. However, the database column PER_ALL_PEOPLE_F table. GENDER will store a value of M, F, or U. Hence, the screen displays the meaning, whereas the database columns reference the lookup via a lookup code. If in the future your organization wants the users to s