SQL Questions

Q:

Which operator performs pattern matching ?

A) LIKE operator B) EXISTS operator
C) BETWEEN operator D) None of these
 
Answer & Explanation Answer: A) LIKE operator

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.

 

More :: Certification Questions on SQL

Report Error

View Answer Report Error Discuss

27 36826
Q:

Write SQL Query to display current date?

Answer

The built in function called GetDate() returns the time stamp.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

16 9657
Q:

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

Answer

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

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

15 15770
Q:

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

Answer

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.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

7 12105
Q:

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

Answer

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

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

5 10023
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
 
Answer & Explanation Answer: B) Data Definition Language(DDL)

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.

Report Error

View Answer Report Error Discuss

Filed Under: SQL
Job Role: IT Trainer , Database Administration , Analyst

4 12861
Q:

SQL views can be used to hide?

A) Complicated SQL syntax B) Rows
C) Columns D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

In SQL, a SQL view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table.

 

SQL views can be used to hide rows and columns and complicated SQL syntax.

 

The fields in a view are fields from one or more real tables in the database.

Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

3 3711
Q:

A DBMS query language is designed to

A) Specify the structure of a database B) Support in the development of complex applications software
C) Support end users who use English-like commands D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: SQL
Job Role: Analyst , Database Administration , IT Trainer

2 5743