1)what is difference between char and varchar in sql server
2005

2) what is composite key and candidate key

3) what is temporary table and derived table

4) how to calculate difference between two dates

Answer Posted / murugavel

1) char datatype is used to store fixed length character
value & varchar is used to store variable length character
value.

2) Composite Key: combination of multiple fields will
produce the uniqeness is called composite key.

Candidate Key: A field has the ability to become a primary
key is known as candidate key.

3) Temporary Table: This table is only visible to this
session of SQL Server. When I close this session, the table
will be automatically dropped. You can treat this table just
like any other table with a few exceptions. The only real
major one is that you can't have foreign key constraints on
a temporary table.

Derived Table:In very basic terms, a derived table is a
virtual table that's calculated on the fly from a select
statement. The biggest benefit of using derived tables over
using temporary tables is that they require fewer steps, and
everything happens in memory instead of a combination of
memory and disk

4) using DATEDIFF function

Ex: SELECT DATEDIFF(dd,"01 March 2010","18 March 2010")

Is This Answer Correct ?    24 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can partial class be inherited?

504


What is the advantage of generics in c#?

505


Can a class or a struct have multiple constructors?

543


What are nested classes in c#?

552


Why we use methods in c#?

559






Define mutex in C#?

617


What is an ienumerable in c#?

545


How many types of variables are there in c#?

527


What is the difference between dynamic and var in c#?

463


What are the new features in c# 2.0?

517


Explain how can I get around scope problems in a try/catch?

486


Why we use anonymous methods in c#?

493


Is predicate a functional interface?

487


Is char * null terminated?

528


Explain About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.

597