Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Question

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2008-04-18 : 08:45:31
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 - 2008-04-18 : 11:55:32
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.

;)
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2008-04-18 : 12:23:20
Actually for number 3 you can if it's "int" or "bigint" as well...
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-04-18 : 14:35:40
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
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-18 : 16:36:56
"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
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-18 : 16:55:45
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

30421 Posts

Posted - 2008-04-18 : 17:09:24
Maybe because he is using TINYBIT datatype?



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

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-04-19 : 00:27:59
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

676 Posts

Posted - 2008-04-21 : 15:51:12
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
   

- Advertisement -