Você está na página 1de 7

1) Display all the records in EMP table?

Select * from EMP;

2) Display all the records in EMP table where employee belongs to deptno 10?

Select * from EMP Where deptno=10;

3) Display all the records in EMP table where employee does not belong to deptno 30?

Select * from EMP where deptno <> 30;

(Or)

Select * from EMP where deptno! = 30;

4) Display total number of records in EMP table?

Select count (*) from EMP;

5) Display EMP table with salary descending order?

Select * from EMP order by Sal desc;

6) Display first five records in employee table?

Select * from EMP where rownum <= 5;

7) Display all the records in EMP table order by ascending deptno, descending salary?

Select * from EMP Order by deptno Asc, Sal desc;

(Or)

Select * from EMP order by deptno, Sal desc;

8) Display all employees those who were joined in year 1981?

Select * from EMP where hiredate like '%-%-81';

9) Display COMM in EMP table. Display zero in place of null.

Select comm, nvl (comm, 0) as replaced zero from EMP;

10) Display the records in EMP table where MGR in 7698, 7566 and Sal should be greater
then 1500

Select * from EMP where mgr in (7698, 7566) and Sal > 1500;
11) Display all employees where employees hired before 01-JAN-1981

Select * from EMP where hiredate < '01-JAN-81';

12) Display all employees those were not joined in 1981?

Select * from EMP where hiredate not LIKE '%-%-81';

13) Display all employees where their salary is less then the Fords salary?

Select * from EMP where < (select Sal from EMP where ename = 'FORD');

14) Display all the records in EMP table along with the rowid?

Select rowid, E.* from EMP E;

15) Display all records in EMP table those were joined before SCOTT joined?

Select * from EMP Where hiredate< (Select hiredate from EMP where ename = 'SCOTT');

16) Write a query to display current date?

Select To_char (sysdate,'mm-dd-yyyy') from dual;

17) Display distinct job from EMP table?

Select distinct job from EMP;

18) Display all the records in EMP table where employee hired after 28-SEP-81 and before
03-DEC-81?

Select * from EMP where hiredate between '28-SEP-81' AND '03-DEC-81';

19) Display all employees and corresponding managers

Select * from EMP where job like 'MANAGER';

20) Display all employees whose salary greater then the manager salary?

Select * from EMP where Sal> (select max (Sal) from EMP where job like 'MANAGER');

21) Display employees where length of ename is 5

Select ename from EMP where LENGTH (ename)>5

22) Display all employees where ename start with J and ends with S

Select * from EMP where ename like 'J%%S';


23) Display all employees where employee does not belong to 10, 20, 40

Select * from EMP where deptno not in (10, 20, 40);

24) Display all employees where jobs does not belong to PRESIDENT and MANAGER?

Select * from EMP where job not in ('PRESIDENT','MANAGER');

25) Display the maximum salary in the EMP table

Select MAX(Sal) from EMP;

26) Display average salary for job SALESMAN

Select AVG(Sal) from EMP where job='SALESMAN';

27) Display all records in EMP table for employee who does not receive any commission

Select * from EMP where comm is null;

28) Display all ename where first character could be anything, but second character should
be L?

Select ename from EMP where ename like '_L%';

29) Display sum of salary for each department. The output should be in one record

Select deptno, sum (Sal) from EMP group by deptno;

30) Display all department with Minimum salary and maximum salary?

Select MAX (Sal), MIN (Sal) from EMP;

31) Display all employees those who are not managers?

Select * from EMP where job not in 'MANAGER';

32) Display ename, deptno from EMP table with format of {ename} belongs to {deptno}

Select ename AS ename, deptno As Deptno from EMP;

33) Display total number of employees hired for 1980, 1981, 1982. The output should be in
one record.

Select count (*) from EMP where hiredate like ('%-%-81');

34) Display all the records for deptno which belongs to employee name JAMES?

Select * from EMP where deptno = (select deptno from EMP where ENAME='JAMES');
35) Display all the records in EMP table where salary should be less then or equal to
ADAMS salary?

Select * from EMP where Sal <= (select SAL from EMP where ENAME='ADAMS');

36) Display all employees those were joined before employee WARD joined?

Select * from EMP where hiredate < (select HIREDATE from EMP where ENAME='WARD');

37) Display all record in EMP table for deptno which belongs to KING's Job?

Select * from Where deptno = (select DEPTNO from EMP where ename='KING');

38) Display the employees for empno which belongs to job PRESIDENT?

Select empno from EMP where job='PRESIDENT';

39) Display list of ename those who have joined in Year 81 as MANAGER?

Select ename from EMP where hiredate in (%-%-81') (Select hiredate from EMP where job=
'MANAGER');

40) Display who is making highest commission?

Select MAX (comm) from EMP;

41) Display all employee whose location is DALLAS?

Select * from EMP where deptno= (select deptno from deptno where loc='DALLAS');

42) Delete EMP table for detpno 10 and 20.

Delete from EMP where deptno in (10, 20);

43) Delete all employees those are not getting any commission?

Delete from EMP where comm is null;

44) Delete all employees those who are only managers?

Delete from EMP where job='MANAGER';

45) Remove all the employees in SMITH's department

Delete EMP where deptno= (Select deptno from EMP where ename='SMITH');

46) Remove all employees who were joined before SMITH joined?

Delete from EMP Where hiredate< (Select hiredate from EMP where ename='SMITH');
47) Rename the employee name JONES to ANDY

Update EMP Set ename ='ANDY' where ename= 'JONES';

48) Update MARTIN salary same as SMITH's salary

Update EMP Set Sal = (Select Sal from EMP where ename='SMITH') Where ename='MARTIN';

49) Display the Empno, Ename, job, Hiredate, Exp of all Mgrs

Select empno, ename, job, hiredate, months_between (sysdate, hiredate) exp from EMP where
empno in (Select mgr

STUB DRIVER

Used in top-down approach Used in bottom-up approach

Top most module is tested first Lower module is tested first

Stimulates the lower level of components Stimulates higher level of components

Dummy program for lower level components Dummy program for higher level components

50) How many test cases can you write per day?

Depends on complexity of project

Application complex->20+

Application not complex->70.

51)How many test cases can you review per day?

I have not reviewed 20+ per day.

52)How many test cases can you execute per day?

Its depends on complexity of project 100 & 30

DISTINCT UNIQUE
It is keyword It is constraints
It retrieve distinct values It allows only unique values
53) Normalization?

Normalization is process which efficiently organizes the data in database

There are 3 types of organization 1.1NF

2.2NF

3.3NF

1.1NF:1.We sets the basic rules here.

2. Eliminates the redundancy (duplicate) data.

3. Create separate table for each group of table & finding each row uniquely using PK.

2.2NF:1.It meets all the requirements of 1NF

2. Here we make relationship between one table to another table by using FK.

3.3NF:1.It meets the all requirements of 2NF

2. It removes the entire columns which are not dependent on primary key

54) De-Normalization?

1. It is process of combining two or more tables

2. Here we combine many small tables to form one big table

3. It is the reverse process of normalization

4. Mainly used in DATAWAREHOUSE


55) System testing and Integration testing.

SYSTEM TESTING INTEGRATION TESTING


In system testing we test the complete system In integration testing we test the modules to see
as a Whole to check whether the system is whether they are integrating properly or not by
working properly or not means as per the combining the modules & tested as a group.
requirement or not.
Concentrate on both functional and Non functional Here tester has to focus on functional testing means
how modules are combined and tested as a group.
System must be integrated test before System must be unit tested before
It starts from the requirement specification It starts from the interface specification
Visibility of code doesnt shows It shows integration structure
It doesnt require any frame It requires some frame
It is kind of black box testing It is kind of both black and white box testing

56) Sanity Testing and Regression Testing

Sanity Testing Regression Testing


Sanity testing is a surface level testing where Regression testing is not surface level testing
QA engineer verifies that all the menus,
functions and commands available presented in
the product are working fine
Sanity testing is considered as a subset of Regression testing not considered as any subset
regression Testing
Performs when programmer will dont have Here have more time to test
time
Manually conducted Both manually and automation tool
Partially executes the test cases Executes all the test cases
Dont use the script Here we use the script

57) Why staging area?

1. Source performance: From here sources will get and sent to ODS.

2. Multiple formats: Cant be joined directly.

3. To facility operations for different time zones.

4. All the operations done on source their chances of data getting lost or completed.

Você também pode gostar