SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shubhada
Posting Yak Master

India
117 Posts

Posted - 04/18/2008 :  08:45:31  Show Profile  Reply with Quote
Hi,
In interview i have asked follwoing question
1. U have one query ,how u will optiminze the query for bette performance.
2. Use of update statics
3. consider on one column we definde a constaint unique key and not null. so is it possible to create a primary key on the same column?

Please provide me answer for all above questions

Regards,
SHubhada.


SQLTeam

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 04/18/2008 :  11:55:32  Show Profile  Reply with Quote
1. create an index for every column in the table.
2. use to determine when backups are needed
3. If it's a numeric type, yes. Otherwise no.

;)

Edited by - cat_jesus on 04/18/2008 11:56:07
Go to Top of Page

Van
Constraint Violating Yak Guru

458 Posts

Posted - 04/18/2008 :  12:23:20  Show Profile  Reply with Quote
Actually for number 3 you can if it's "int" or "bigint" as well...

Edited by - Van on 04/18/2008 12:23:56
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 04/18/2008 :  14:35:40  Show Profile  Reply with Quote
Actually Cat, for number 1, would that be one index for each column and then one across all columns?? Never seem to get that one right!

Terry
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 04/18/2008 :  16:36:56  Show Profile  Reply with Quote
"1. create an index for every column in the table.
2. use to determine when backups are needed
3. If it's a numeric type, yes. Otherwise no.
"


Not really,This is not true.
1)Depends on the query. Database tuning advisor,execution plan will better guide you about index for better performance. Too many indexes affects performance
2)Increase the performance of the query.
3)Yes as long as there is no clustered index defined

Edited by - sodeep on 04/18/2008 16:37:53
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37142 Posts

Posted - 04/18/2008 :  16:55:45  Show Profile  Visit tkizer's Homepage  Reply with Quote
sodeep, your sarcasm detector must not be working.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30265 Posts

Posted - 04/18/2008 :  17:09:24  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Maybe because he is using TINYBIT datatype?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 04/19/2008 :  00:27:59  Show Profile  Reply with Quote
quote:
Originally posted by shubhadaIn interview i have asked follwoing question
1. U have one query ,how u will optiminze the query for bette performance.
2. Use of update statics
3. consider on one column we definde a constaint unique key and not null. so is it possible to create a primary key on the same column?

Dude! Forget about optimizing! You're never going to get past the syntax errors!

e4 d5 xd5 Nf6
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 04/21/2008 :  15:51:12  Show Profile  Reply with Quote
Sarcasm? Who, me? I ask a legitimate question and now I'm accused of sarcasm? I'm just trying to figure out this here SQL, ya' know, for bette preformance and stuff!!! Backups, what's that??? Statics, that's for wimps. And, I don't even want to definde a constraint...sounds too painful.....

Terry
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000