Searching for "he"

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

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

Q:

Where SQL server user names and passwords are stored in SQL server?

Answer

They get stored in System Catalog Views sys.server_principals and sys.sql_logins.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What are the properties and different Types of Sub-Queries?

Answer

Properties of Sub-Query


- A sub-query must be enclosed in the parenthesis.


- A sub-query must be put in the right hand of the comparison operator, and


- A sub-query cannot contain an ORDER-BY clause.


- A query can contain more than one sub-query.


Types of Sub-Query


- Single-row sub-query, where the sub-query returns only one row.


- Multiple-row sub-query, where the sub-query returns multiple rows,. and


- Multiple column sub-query, where the sub-query returns multiple columns

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

Can SQL Servers linked to other servers like Oracle?

Answer

SQL Server can be linked to any server provided it has OLE-DB provider from Microsoft to allow a link. E.g. Oracle has an OLE-DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What are the difference between clustered and a non-clustered index?

Answer

- A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.


- A non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What is the difference between a primary key and a unique key?

Answer

By default, primary key creates a clustered index on the column, whereas a unique key creates a non clustered index by default.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What are constraints? Mention the different types of constraints?

Answer

Constraints enable the RDBMS to enforce the integrity of the database automatically, without the need to create triggers, rule or defaults.


Types of Constraints: NOT NULL, CHEQUE, UNIQUE, PRIMARY KEY, FOREIGN KEY.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL