0
Q:

# When do you use UPDATE_STATISTICS command?

Q:

Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables ?

 A) Data Manipulation Language(DML) B) Data Definition Language(DDL) C) Both A & B D) None

Explanation:

The Data Definition Language (DDL) is used to manage table and index structure.
CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data definition elements.

2 1888
Q:

Which operator performs pattern matching ?

 A) LIKE operator B) EXISTS operator C) BETWEEN operator D) None of these

Explanation:

LIKE is a keyword that is used in the WHERE clause. Basically, LIKE allows us to do a search based operation on a pattern rather than specifying exactly what is desired (as in IN) or spell out a range (as in BETWEEN).

The syntax is as follows:
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}

{PATTERN} often consists of wildcards. In SQL, there are two wildcards:

% (percent sign) represents zero, one, or more characters.
_ (underscore) represents exactly one character.

3 4121
Q:

Write SQL Query to find second highest salary of Employee.

There are many ways to find second highest salary of Employee in SQL, you can either use SQL Join or Subquery to solve this problem. Here is SQL query using Subquery :

SELECT MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) FROM Employee );

Subject: SQL - Technology

1451
Q:

Write an SQL Query find number of employees according to gender whose DOB is between 01/01/1960 to 31/12/1975.

SELECT COUNT(*), sex from Employees  WHERE  DOB BETWEEN ‘01/01/1960 ' AND ‘31/12/1975’  GROUP BY sex;

Subject: SQL - Technology

5688
Q:

find all Employee records containing the word "Joe", regardless of whether it was stored as JOE, Joe, or joe.

SELECT  * from Employees  WHERE  upper(EmpName) like upper('joe%');

Subject: SQL - Technology

4649
Q:

Write a SQL Query to find year from date.

SELECT YEAR(GETDATE()) as "Year";

Subject: SQL - Technology

2231
Q:

Write an SQL Query to check whether date passed to Query is date of given format or not.

SQL has IsDate() function which is used to check passed value is date or not of specified format ,it returns 1(true) or 0(false) accordingly.

SELECT  ISDATE('1/08/13') AS "MM/DD/YY";

It will return 0 because passed date is not in correct format.

Subject: SQL - Technology

5815
Q:

What is Catalog Views?