Skip to main content

QA and ANS


1)      Display the details of all employees.
2)      Display the dept information from department table
3)      Display the name and job for all the employees.
4)      Display the name and salary for all the employees.
5)      Display the employee no and total salary for all the employees.
6)      Display the employee name and annual salary for all the employees
7)      Display the names of all the employees who are working in department number 20.
8)      Display the names of all the employees who are working as CLERK and drawing salary more than 3000.
9)      Display the employee number and name who are earning commission.
10)   Display the employee number and name who don’t earn any commission.
11)   Display the name of employees who are working as CLERK, SALESMAN or ANALYST and drawing salary more than 3000.
12)   Display the names of the employees who are working in the company for the past 5 years.
13)   Display the list of employees who have joined the company before 30-jun-90 or after 31-dec-90.
14)   Display the current date.
15)   Display the list of all users in your database ( use catalog table).
16)   Display the names of all tables from current user.
17)   Display the name of the current user.
18)   Display the display the names of employees working in dept no 10 or 20 or 40 or employees working as CLERK, SALESMAN or ANALYST.
19)   Display the names of employees whose name starts with alphabet S.
20)   Display the employee names for employees whose name ends with alphabet S.
21)   Display the names of employees whose names have second alphabet A in their names.
22)   Display the names of the employees whose names is exactly five characters in length.
23)   Display the names of the employee who are not working as managers.
24)   Display the names of the employee who are not working as SALESMAN or CLERS or ANALYST.
25)   Display all rows from emp table, the system should wait after every screen full of information.
26)   Display the total number of employee working in the company.
27)   Display the total salary being paid to all employees.
28)   Display the maximum salary from emp table.
29)   Display the minimum salary from emp table.
30)   Display the average salary from emp table.
31)   Display the maximum salary being paid to CLERK.
32)   Display the maximum salary being paid to dept no 20.
33)   Display the minimum salary being paid to any SALESMAN.
34)   Display the average salary drawn by managers.
35)   Display the totally salary drawn by analyst working in dept no 40.
36)   Display the names of the employee in order of salary i.e the name of the employee earning lowest salary should appear first.

37)   Display the names of the employee in descending order of salary.


1> What does the % symbol do in a SQL LIKE query ? 
AAns : The % wildcard in LIKE matches any number of characters. 
Example : 'S' matches 'Suraj', 'Sunday', 'Srijra' etc

2> Which SQL keyword is used to check if a value is in a list of values ? 
Ans : IN checks if a value matches any item in a list. 
Example : ....Where location IN ('Chennai', 'Mumbai', 'Hyderabad').
It 





Comments

Popular posts from this blog

About Oracle Buffer

About Oracle Buffer :- All Commands of SQL are typed at the SQL prompt. Only one SQL statement is managed in the SQL buffer. The current SQL statement replaces the previous SQL statement in the buffer. The SQL statements can be divided into different lines within the SQL buffer. Only one line i.e, the current line can be active at a time in the SQL buffer. At SQL prompt, editing is possible only in the current SQL buffer line. Every statement of SQL should be terminated using semi colon " ; ". One sql statement can contain only one semi colon. To run the previous or current SQL statement in the bufer type " / " at SQL prompt. To open the SQL editor type " ED " at SQL prompt.

Oracle Object Oriented Concepts

An Object is a reusable application component that developers need to be aware of, rather than how it works. Object are basic entities in a system. They could represent a person, place, bank account, or any item that is handled by program. Every object consists of an attribute and one or more methods. An attribute could be any property of the object. Class:           It is a collection of attributes and functions (method) to plan the object. Object Table : ·    Object table are created by using the user defined data types. ·        In an object table each row or record is treated as an object. ·        Each row in an object table has an object Identified (OID), which is unique through out       the   database. ·       The rows or objects of an object table can be referenced by other objects with in the  database. ·    ...

Filtering and Sorting data using SQL statements

  Filtering & Sorting Data using SQL     Once you know the basics ( SELECT , FROM , WHERE ), filtering and sorting helps you get the exact rows from tables .   1. Filtering with Conditions ( AND , OR , NOT )  - Use WHERE to filter rows. - Combine with logical operators :     • AND: all conditions true      • OR: any condition true      • NOT: negate condition   - - All conditions true (AND) SELECT *  FROM employees WHERE department = 'Sales'    AND salary > 50000; -- Any condition true (OR) SELECT *  FROM employees WHERE department = 'Sales'     OR department = 'Marketing'; -- Negate condition (NOT) SELECT *  FROM employees WHERE NOT department = 'HR';   2. Pattern Matching with LIKE   - % = any sequence, _ = single char     • Names starting with 'J'      • Names with 4 letters starting with 'J'   - - N...