Round function

Round: It Rounds the given expression into the specified length. It can also truncates the expression to the specified length. Syntax: ROUND ( numeric_expression , length [ ,function ] ) Numeric_Expression: It can be expression which returns a numeric value or a

Read More

Itz Puzzle tym

Try to guess the Answers for the below Queries and also check with the key which i have provided. Click here to see the answers from the below. ————————————————— — I – Silly SELECTs. But Funny results. ————————————————— USE [AdventureWorks2008R2] GO —————————————————

Read More

What is Soundex() function?

Soundex(): In real time we frequently use search criteria to search for Employee names from Employee table. Below are the few examples. —————————————————————— SELECT * FROM [HumanResources].[Employee] WHERE [JobTitle] = ‘Chief Executive Officer’ —————————————————————— SELECT * FROM [HumanResources].[Employee] WHERE [JobTitle] LIKE ‘%Design%’

Read More

Is it possible to create a Foreign key without Primary key?

Yes. We can create a Foreign key without having Primary key in the parent table. Most of us are in a misconception that we can not create a Foreign key without primary key in the parent table. Also most of the books

Read More

What is GUID and how to generate it in SQL Server?

GUID: GUID (Globally Unique Identifier) is a 128 bit unique number which is generated by Operating system automatically. This number is globally unique and can not be generated the same number in any other computer in the entire world. Identity key in

Read More

What is a Transaction and explain the types in it.

Transaction: A Transaction is a group of SQL statements which are executed as a single SQL statement. Transactions ensures that all the statements in it are executed successfully and committed to the database. Otherwise, entire transaction will be rolled back. There are

Read More

Find the user who has deleted records in a table

This might be the most common issue faced by lot of database developers. But I am going teach you very easy steps to catch those guys too quickly. Be ready to HUNT 😛 Step 1: Create a database to practice this case.

Read More

Delete vs Truncate

Delete It is a DML command We can use filters in WHERE clause to delete the data Removes specified data only Deletes one row at a time Records removed data in transaction logs It does not resets the identity field of the

Read More