<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5005148102632656774</id><updated>2011-11-27T16:38:19.506-08:00</updated><category term='Tip&apos;s'/><category term='Sybase'/><category term='Tutorial'/><category term='Interview Question&apos;s'/><category term='FAQ&apos;s'/><category term='Optimization'/><category term='Problem&apos;s'/><title type='text'>Sybase Database Interview Questions and Answers</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-7124843377162677481</id><published>2009-08-20T19:59:00.002-07:00</published><updated>2009-08-20T20:14:22.557-07:00</updated><title type='text'>How many rows may be retrieved by the select statement in the following SQL</title><content type='html'>create table t1 (k int unique) insert t1 values (rand()*1000) insert t1 values (rand()*1000) insert t1 values (rand()*1000) [...1000 additional inserts...] select * from t1 where k = rand()*1000&lt;br /&gt;Ans: 0 or 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-7124843377162677481?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/7124843377162677481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=7124843377162677481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7124843377162677481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7124843377162677481'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/08/how-many-rows-may-be-retrieved-by.html' title='How many rows may be retrieved by the select statement in the following SQL'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1364239208487278747</id><published>2009-08-20T19:59:00.001-07:00</published><updated>2009-08-20T20:04:45.782-07:00</updated><title type='text'>Explain the set commands given below</title><content type='html'>1) set rowcount (Instruct the server to rturn only the first n rows of data)&lt;br /&gt;2) set nocount on ( stops reporting the number of rows returned)&lt;br /&gt;3) set noexec on ( parse and optimize, but don’t exec the query (used with show plan for looking at the plan without running a query)) showplan gives the final optimization plan for a query)&lt;br /&gt;4) set statistics time on (requests the execution time)&lt;br /&gt;Construct the Query using the Tables album and track of music database&lt;br /&gt;album&lt;br /&gt;Asin&lt;br /&gt;Title&lt;br /&gt;artist&lt;br /&gt;price&lt;br /&gt;release&lt;br /&gt;label&lt;br /&gt;Rank&lt;br /&gt;B00000255F&lt;br /&gt;Born to Run&lt;br /&gt;Bruce Springsteen&lt;br /&gt;13.98&lt;br /&gt;1975-08-25&lt;br /&gt;Sony&lt;br /&gt;521&lt;br /&gt;B000002UAU&lt;br /&gt;Sgt. Pepper's Lonely Hearts Club Band&lt;br /&gt;The Beatles&lt;br /&gt;13.49&lt;br /&gt;1967-06-01&lt;br /&gt;Capitol&lt;br /&gt;218&lt;br /&gt;...&lt;br /&gt;Track&lt;br /&gt;Album&lt;br /&gt;dsk&lt;br /&gt;posn&lt;br /&gt;Song&lt;br /&gt;B00000255F&lt;br /&gt;1&lt;br /&gt;1&lt;br /&gt;Thunder Road&lt;br /&gt;B00000255F&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;Tenth Avenue Freeze-Out&lt;br /&gt;B00000255F&lt;br /&gt;1&lt;br /&gt;3&lt;br /&gt;Night&lt;br /&gt;B00000255F&lt;br /&gt;1&lt;br /&gt;4&lt;br /&gt;Backstreets&lt;br /&gt;B00000255F&lt;br /&gt;1&lt;br /&gt;5&lt;br /&gt;Born to Run&lt;br /&gt;...&lt;br /&gt;B000002UAU&lt;br /&gt;1&lt;br /&gt;1&lt;br /&gt;Sgt. Pepper's Lonely Hearts Club Band&lt;br /&gt;B000002UAU&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;With a Little Help from My Friends&lt;br /&gt;B000002UAU&lt;br /&gt;1&lt;br /&gt;3&lt;br /&gt;Lucy in the Sky With Diamonds&lt;br /&gt;B000002UAU&lt;br /&gt;1&lt;br /&gt;4&lt;br /&gt;Getting Better&lt;br /&gt;B000002UAU&lt;br /&gt;1&lt;br /&gt;5&lt;br /&gt;She's Leaving Home&lt;br /&gt;...&lt;br /&gt;A "title track" is where the song is the same as the title. Find the title&lt;br /&gt;Tracks&lt;br /&gt;select song "title tracks" from album,track where album.asin=track.album and album.title=track.song&lt;br /&gt;Find the songs that appear on more than 2 albums. Include a count of the number of times each shows up&lt;br /&gt;select song, count (album) from album, track where album.asin=track.album group by song having count(song)&gt;2&lt;br /&gt;A "good value" album is one where the price per track is less than 50 pence. Find the good value album - show the title, the price and the number of tracks&lt;br /&gt;select title,price,count(song) from album,track where album.asin=track.album group by title having (price/count(song))&lt;0.5&lt;br /&gt;Wagner's Ring cycle has an imposing 173 tracks, Bing Crosby clocks up 101 tracks&lt;br /&gt;List albums so that the album with the most tracks is first. Show the title and the number of tracks&lt;br /&gt;select title, count(song) from album,track where album.asin=track.album group by title order by count(song) desc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1364239208487278747?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1364239208487278747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1364239208487278747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1364239208487278747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1364239208487278747'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/08/explain-set-commands-given-below.html' title='Explain the set commands given below'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-3603304815019236412</id><published>2009-08-20T19:59:00.000-07:00</published><updated>2009-08-20T20:04:03.313-07:00</updated><title type='text'>Find the Top album of each company</title><content type='html'>select title ,label ,min(rank) from album group by label&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-3603304815019236412?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/3603304815019236412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=3603304815019236412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3603304815019236412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3603304815019236412'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/08/find-top-album-of-each-company.html' title='Find the Top album of each company'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-410065519088300695</id><published>2009-07-04T02:39:00.000-07:00</published><updated>2009-07-04T02:39:01.246-07:00</updated><title type='text'>Find the title and artist who recorded the song 'Alison'</title><content type='html'>&lt;code&gt;&lt;span style="font-family:Arial;"&gt;Ans: select title,artist from album,track where track.song="Alison"&lt;/span&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-410065519088300695?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/410065519088300695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=410065519088300695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/410065519088300695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/410065519088300695'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/07/find-title-and-artist-who-recorded-song.html' title='Find the title and artist who recorded the song &apos;Alison&apos;'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-216569614747326218</id><published>2009-07-03T02:38:00.000-07:00</published><updated>2009-07-03T02:38:01.090-07:00</updated><title type='text'>Explain timestamp datatype?</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-family:Arial;"&gt;Construct the Query using the Tables album and track of music database&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 462.15pt; margin-left: 6.75pt; margin-right: 6.75pt;" align="left" border="1" cellpadding="0" width="616"&gt;  &lt;tbody&gt;&lt;tr style="height: 15.8pt;"&gt;   &lt;td colspan="7" style="border: medium none ; padding: 0.75pt; height: 15.8pt;"&gt;   &lt;p class="MsoNormal" style="background: black none repeat scroll 0% 0%; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center"&gt;&lt;span style=";font-family:Arial;color:white;"  &gt;album&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.8pt;"&gt;   &lt;td style="padding: 0.75pt; height: 15.8pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;Asin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 120pt; height: 15.8pt;" valign="top" width="160"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;title&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 79.45pt; height: 15.8pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;artist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 34.5pt; height: 15.8pt;" valign="top" width="46"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;price&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 71.05pt; height: 15.8pt;" valign="top" width="95"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;release&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 40.4pt; height: 15.8pt;" valign="top" width="54"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;label&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 28.35pt; height: 15.8pt;" valign="top" width="38"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;Rank&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 30.7pt;"&gt;   &lt;td style="padding: 0.75pt; height: 30.7pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 120pt; height: 30.7pt;" valign="top" width="160"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;Born to Run&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 79.45pt; height: 30.7pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;Bruce Springsteen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 34.5pt; height: 30.7pt;" valign="top" width="46"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;13.98&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 71.05pt; height: 30.7pt;" valign="top" width="95"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;1975-08-25&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 40.4pt; height: 30.7pt;" valign="top" width="54"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;Sony&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 28.35pt; height: 30.7pt;" valign="top" width="38"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;521&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 30.7pt;"&gt;   &lt;td style="padding: 0.75pt; height: 30.7pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 120pt; height: 30.7pt;" valign="top" width="160"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;Sgt. Pepper's Lonely Hearts Club Band&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 79.45pt; height: 30.7pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;The Beatles&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 34.5pt; height: 30.7pt;" valign="top" width="46"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;13.49&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 71.05pt; height: 30.7pt;" valign="top" width="95"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;1967-06-01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 40.4pt; height: 30.7pt;" valign="top" width="54"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;Capitol&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 28.35pt; height: 30.7pt;" valign="top" width="38"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;218&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.8pt;"&gt;   &lt;td colspan="7" style="padding: 0.75pt; height: 15.8pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family:Arial;"&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;table class="MsoNormalTable" style="width: 462.15pt;" border="1" cellpadding="0" width="616"&gt;&lt;tbody&gt;&lt;tr style="height: 13.3pt;"&gt;   &lt;td colspan="4" style="border: medium none ; padding: 0.75pt; height: 13.3pt;"&gt;   &lt;p class="MsoNormal" style="background: black none repeat scroll 0% 0%; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center"&gt;&lt;span style=";font-family:Arial;color:white;"  &gt;Track&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;Album&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;dsk&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;posn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;Song&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Thunder Road&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;st1:street st="on"&gt;&lt;st1:address st="on"&gt;&lt;span style="font-family:Arial;"&gt;Tenth Avenue&lt;/span&gt;&lt;/st1:address&gt;&lt;/st1:street&gt;&lt;span style="font-family:Arial;"&gt; Freeze-Out&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Night&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Backstreets&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B00000255F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Born to Run&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 13.3pt;"&gt;   &lt;td colspan="4" style="padding: 0.75pt; height: 13.3pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;... &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Sgt. Pepper's Lonely   Hearts Club Band&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;With a Little Help from My   Friends&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Lucy in the Sky With   Diamonds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Getting Better&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.15pt;"&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;B000002UAU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-family:Arial;"&gt;5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 14.15pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;She's Leaving Home&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 13.3pt;"&gt;   &lt;td colspan="4" style="padding: 0.75pt; height: 13.3pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;... &lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-216569614747326218?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/216569614747326218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=216569614747326218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/216569614747326218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/216569614747326218'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/07/explain-timestamp-datatype.html' title='Explain timestamp datatype?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-6435566734059799897</id><published>2009-07-01T01:33:00.000-07:00</published><updated>2009-07-01T01:33:00.982-07:00</updated><title type='text'>How many rows may be retrieved by the select statement in the following SQL  code samples?</title><content type='html'>&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;count() Returns the number of rows found &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;having keyword should always follow the group by&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;A result set based on a query with a proper join condition is called a cartesian product&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;distinct requires an additional sorting step using a worktable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;5.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;subquery always return single column of data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;6.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family:Arial;"&gt;once you create a column and declare its datatype, you cannot&lt;span style=""&gt;  &lt;/span&gt;change that datatype without dropping and recreating the table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-family:Arial;"&gt;Ans: FTFTF(F)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-6435566734059799897?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/6435566734059799897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=6435566734059799897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/6435566734059799897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/6435566734059799897'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/07/how-many-rows-may-be-retrieved-by.html' title='How many rows may be retrieved by the select statement in the following SQL  code samples?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1191642840719957660</id><published>2009-06-30T02:33:00.000-07:00</published><updated>2009-06-30T02:33:00.342-07:00</updated><title type='text'>How many rows may be retrieved by the select statement in the following SQL  code samples?</title><content type='html'>&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:12;"  lang="FR" &gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;color:black;"&gt;create table t1&lt;span style=""&gt;  &lt;/span&gt;(k int unique)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   lang="FR" &gt;&lt;span style=""&gt;               &lt;/span&gt;insert t1 values (rand()*1000)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   lang="FR" &gt;&lt;span style=""&gt;               &lt;/span&gt;insert t1 values (rand()*1000)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   lang="FR" &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   &gt;insert t1 values (rand()*1000)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   &gt;&lt;span style=""&gt;               &lt;/span&gt;[...1000 additional inserts...]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:Arial;font-size:100%;color:black;"   &gt;&lt;span style=""&gt;               &lt;/span&gt;select * from t1 where k = rand()*1000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;span style="font-family:Arial;font-size:100%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;Ans: 0 or 1&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1191642840719957660?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1191642840719957660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1191642840719957660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1191642840719957660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1191642840719957660'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/how-many-rows-may-be-retrieved-by.html' title='How many rows may be retrieved by the select statement in the following SQL  code samples?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-2391727182491103799</id><published>2009-06-28T02:34:00.000-07:00</published><updated>2009-06-28T02:34:01.459-07:00</updated><title type='text'>What will be the output of the following query?</title><content type='html'>&lt;span style="font-family:Arial;"&gt;Suppose I have a table with following column&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;E_Id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;BLL12&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;BRR&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;BDGT8&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;NW23L&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;KO9G0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;B___B&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;___BN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;BSNMA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;___12&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style=""&gt;   &lt;/span&gt;BNG&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;c&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;“select E_Id from table where E_Id like ‘___’”&lt;span style=""&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;Ans: BRR&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;% -0 or more&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;_ - any single chr&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family:Arial;"&gt;[]- any single chr listed in the bracket&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-2391727182491103799?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/2391727182491103799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=2391727182491103799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2391727182491103799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2391727182491103799'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/what-will-be-output-of-following-query.html' title='What will be the output of the following query?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-5674266793418695454</id><published>2009-06-27T02:33:00.000-07:00</published><updated>2009-06-27T02:33:02.069-07:00</updated><title type='text'>How do you find the name of the employees those have missed more than 5 days of work in last 30 days</title><content type='html'>There are two tables master is Employees and the detail is Attendance. The Employee_ID field is common to both tables. How do you find the name of the employees those have missed more than 5 days of work in last 30 days&lt;br /&gt;&lt;br /&gt;Select name from Employees a where a.id in (select b.id from attendance b where a.id=b.id and date between (lastmonth+1 ,lastmonth) presence=0 group by id having count(presence)&gt;4)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-5674266793418695454?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/5674266793418695454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=5674266793418695454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5674266793418695454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5674266793418695454'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/how-do-you-find-name-of-employees-those.html' title='How do you find the name of the employees those have missed more than 5 days of work in last 30 days'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-5730654267113712040</id><published>2009-06-25T02:29:00.000-07:00</published><updated>2009-06-25T02:29:00.753-07:00</updated><title type='text'>What command do we use to rename a database?</title><content type='html'>Ans: sp_renamedb ‘oldname’ , ‘newname’&lt;br /&gt;Well sometimes sp_renamedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases? - In such cases we can first bring to db to single user using sp_dboptions and then we can rename that db and then we can rerun the sp_dboptions command to remove the single user mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-5730654267113712040?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/5730654267113712040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=5730654267113712040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5730654267113712040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5730654267113712040'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/what-command-do-we-use-to-rename.html' title='What command do we use to rename a database?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-395076508264957090</id><published>2009-06-24T02:32:00.000-07:00</published><updated>2009-06-24T02:32:00.207-07:00</updated><title type='text'>Give me the Global variable names for the description given below</title><content type='html'>1. Error number reported for last SQL statement ( @@error)&lt;br /&gt;2. Current transaction mode (chained or unchained)(@@tranchained)&lt;br /&gt;3. Status of prevoius fetch statement in a cursor(@@sqlstatus)&lt;br /&gt;4. Transaction nesting level(@@trancount)&lt;br /&gt;5. Current process ID(@@spid)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-395076508264957090?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/395076508264957090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=395076508264957090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/395076508264957090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/395076508264957090'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/give-me-global-variable-names-for.html' title='Give me the Global variable names for the description given below'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-8915601557495705980</id><published>2009-06-24T02:31:00.000-07:00</published><updated>2009-06-24T02:31:00.893-07:00</updated><title type='text'>What’s the difference between DELETE TABLE and TRUNCATE TABLE commands?</title><content type='html'>Ans: DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow.&lt;br /&gt;TRUNCATE TABLE also deletes all the rows in a table, but it won’t log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster.&lt;br /&gt;Of course, TRUNCATE TABLE can be rolled back.&lt;br /&gt;TRUNCATE TABLE is functionally identical to DELETE statement with no WHERE clause: both remove all rows in the table.&lt;br /&gt;But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE. The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the table’s data, and only the page deallocations are recorded in the transaction log. TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain.&lt;br /&gt;The counter used by an identity for new rows is reset to the seed for the column. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement.&lt;br /&gt;You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint; instead, use DELETE statement without a WHERE clause. Because TRUNCATE TABLE is not logged, it cannot activate a trigger.&lt;br /&gt;TRUNCATE TABLE may not be used on tables participating in an indexed view&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-8915601557495705980?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/8915601557495705980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=8915601557495705980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/8915601557495705980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/8915601557495705980'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/whats-difference-between-delete-table.html' title='What’s the difference between DELETE TABLE and TRUNCATE TABLE commands?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-3969232584449301498</id><published>2009-06-22T02:29:00.000-07:00</published><updated>2009-06-22T02:29:01.571-07:00</updated><title type='text'>What is default? Is there a column to which a default can’t be bound?</title><content type='html'>Ans: A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can’t have defaults bound to them. See CREATE DEFAULT in books online&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-3969232584449301498?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/3969232584449301498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=3969232584449301498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3969232584449301498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3969232584449301498'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/what-is-default-is-there-column-to.html' title='What is default? Is there a column to which a default can’t be bound?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-2790610501414549450</id><published>2009-06-21T02:32:00.000-07:00</published><updated>2009-06-21T02:32:01.728-07:00</updated><title type='text'>Write a query to find the duplicate rows from a table?</title><content type='html'>Select name, count(*) from tablename group by name having count(*)&gt;1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-2790610501414549450?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/2790610501414549450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=2790610501414549450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2790610501414549450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2790610501414549450'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/write-query-to-find-duplicate-rows-from.html' title='Write a query to find the duplicate rows from a table?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-2425517324762047452</id><published>2009-06-20T02:29:00.000-07:00</published><updated>2009-06-20T02:29:01.044-07:00</updated><title type='text'>What is the advantage of stored procedure?</title><content type='html'>Ans: Faster Execution: after first exec it become memory resident and do not need to be reparsed, recompiled&lt;br /&gt;Reduced network traffic&lt;br /&gt;Modular programming&lt;br /&gt;Reduced operator error-less info to pass&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-2425517324762047452?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/2425517324762047452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=2425517324762047452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2425517324762047452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/2425517324762047452'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/what-is-advantage-of-stored-procedure.html' title='What is the advantage of stored procedure?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-8431030276926688260</id><published>2009-06-19T02:29:00.000-07:00</published><updated>2009-06-19T02:30:19.587-07:00</updated><title type='text'>What is the difference between a sub-query and a correlated sub-query?</title><content type='html'>Ans: A subquery is a query that SQL Server must evaluate before it can process the main query. It doesn’t depend on a value in the outer subquery.&lt;br /&gt;A correlated subquery is the one that depends on a value in a join clause in the outer subquery&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-8431030276926688260?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/8431030276926688260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=8431030276926688260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/8431030276926688260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/8431030276926688260'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2009/06/what-is-difference-between-sub-query.html' title='What is the difference between a sub-query and a correlated sub-query?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-5429062617398753474</id><published>2008-08-01T03:29:00.003-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Problem&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Sybase problems 3</title><content type='html'>1. I have written a query which you can see below. The query qpproximately takes 50- 60 SEC to run,&lt;br /&gt;    which I believe is way too high. The total rows returned is 10,000 . &lt;br /&gt;    Any idea to improve the query timings ?&lt;br /&gt;&lt;br /&gt;The number of rows in each table are as follows :&lt;br /&gt;ACCOUNTS : 1,580&lt;br /&gt;PERSONNEL : 1,616&lt;br /&gt;DIVISION : 15&lt;br /&gt;LABOR_COMMITTED : 23,000&lt;br /&gt;FISCAL_SYSTEM_PERIODS : 20&lt;br /&gt;FISCAL_YEARS : 20&lt;br /&gt;&lt;br /&gt;INDEXES :&lt;br /&gt;ACCOUNTS TABLE- 1. ACCOUNT_ID ( Primary Key), 2. IN_AC_COMBINED(ACCOUNT_ID , ACCOUNT_MANAGER) LABOR_COMMITTED TABLE- 1.LABOR_COMMIT_ID ( Primary Key) 2. IN_LC_COMBINED(PERSONNEL_ID, ACCOUNT_ID) PERSONNEL TABLE- 1. PERSONNEL_ID ( Primary key)&lt;br /&gt;&lt;br /&gt;The Actual Query :&lt;br /&gt; SELECT AC.ACCOUNT_NUMBER , AC.ACCOUNT_NAME , AC.ACCOUNT_END_DATE , P1.NAME , D.DIVISION_NUMBER , P.SURNAME_ISI || ' '|| P.FIRST_NAME Person_Name, ISNULL(P.EMPLOYEE_ID,P.VISITOR_NUMBER) Employee_Number, CONVERT(DATETIME , FSP.FISCAL_SYSTEM_PERIOD_CAL_YR_EQ || ' ' || FY.FISCAL_YEAR) Month_Year , FSP.FISCAL_SYSTEM_PERIOD_CAL_YR_EQ || ' ' || FY.FISCAL_YEAR Month/Year, ROUND(LC.LCS_EFFORT,2) LCS_Effort , 'ACTUAL' AS 'Labor Type' , (SELECT CODE_VALUE FROM CODES CD WHERE CODE_ID = P.STAFF_CATEGORY_CODE_ID) STAFF_CAT FROM ACCOUNTS AC(INDEX IN_AC_COMBINED), PERSONNEL P1 ,DIVISIONS D, LABOR_COMMITED LC (index in_lc_combined) , PERSONNEL P , FISCAL_SYSTEM_PERIODS FSP , FISCAL_YEARS FY WHERE P1.PERSONNEL_ID IN (SELECT DISTINCT CHILD.PERSONNEL_ID FROM PERSONNEL CHILD, PERSONNEL PARENT WHERE PARENT.PERSONNEL_ID IN (7167,7041) AND CHILD.LFT BETWEEN PARENT.LFT AND PARENT.RGT AND PARENT.LFT &lt;&gt; 0 AND PARENT.RGT &lt;&gt; 0) AND AC.ACCOUNT_MANAGER = P1.PERSONNEL_ID AND P1.DIVISION_ID = D.DIVISION_ID AND AC.ACCOUNT_ID = LC.ACCOUNT_ID AND LC.PERSONNEL_ID = P.PERSONNEL_ID AND FSP.FISCAL_SYSTEM_PERIOD_ID = LC.FISCAL_PERIOD_ID AND FY.FISCAL_YEAR_ID = LC.FISCAL_YEAR_ID AND LC.COMMITED_DATE IS NOT NULL AND CONVERT(DATETIME,FISCAL_SYSTEM_PERIOD_CAL_YR_EQ || ' ' || FISCAL_YEAR) &lt;= CONVERT(DATETIME,'January, 2007') AND CONVERT(DATETIME,FISCAL_SYSTEM_PERIOD_CAL_YR_EQ || ' ' || FISCAL_YEAR) &gt;= CONVERT(DATETIME,'February, 2006')&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;2. I have a table with 10 million rows. about 9.5 million rows are identified by certain criteria  must be deleted from this table.&lt;br /&gt;     If i use DELETE statment for this, optimizer takes nearly 15-20 minutes to execute the query,so how can i minimize the execution time?&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;3. I was working on a stored procedure for a pending QC . I need to negate the bskSymbol which have multiple consSymbol .&lt;br /&gt;&lt;br /&gt;    so for that i am using the query given below and saving that in a #table .&lt;br /&gt;&lt;br /&gt;    select bskSymbol from RSK_IM_ModifyBasket group by bskSymbol having count(*) &gt; 1 and BatchId = 0&lt;br /&gt;&lt;br /&gt;  or Like -&gt;&lt;br /&gt;&lt;br /&gt;        select into ... #temporary table&lt;br /&gt;         ....&lt;br /&gt;         bskSymbol not in (select bskSymbol&lt;br /&gt;         from RSK_IM_ModifyBasket b&lt;br /&gt;         group by bskSymbol&lt;br /&gt;         having count(*) &gt; 1 and BatchId = 0&lt;br /&gt;         )&lt;br /&gt;&lt;br /&gt;                does not produce any one to one mapping of bskSymbol and consSymbol .&lt;br /&gt;&lt;br /&gt;         where as the query given below shows some bskSymbol columns with one to one mapping of bskSymbol and consSymbol . by one to one mapping i mean           for some bskSymbol we have count value as 1 .&lt;br /&gt;&lt;br /&gt;                          select bskSymbol,count(consSymbol) from RSK_IM_ModifyBasket where BatchId = 0 group by bskSymbol&lt;br /&gt;&lt;br /&gt;                            can u suggest where am i wrong ?.&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;Hi friends,&lt;br /&gt;I am facing a problem with bcp process on the following environment&lt;br /&gt;OS - sun solaris&lt;br /&gt;database - sybase&lt;br /&gt;&lt;br /&gt;I have 13 tables in my database with max 8450782 rows in a table.&lt;br /&gt;so I have write a script for unix, in which whole bcp process is done in one shot being a single process in background(bcp-out from source table , truncate on destination table,bcp-in ). in this way my all the 13 tables refreshes simultaniously.my tables have not any indexes,or other referential dependency.&lt;br /&gt;some times this whole process slow down significantly.so is there any issue with multiple tables refreshing.&lt;br /&gt;is my this approach is wrong or what i need to speed up the process.&lt;br /&gt;any suggestion will be appriciated.&lt;br /&gt;&lt;br /&gt;sol:&lt;br /&gt;&lt;br /&gt; think you might be limited by your disk I/O speeds. But things you can use to try and speed up the process is a fifo special file (man mkfifo) as the bcp file and a larger network packet size (bcp -A 8704)&lt;br /&gt;Would it be worth altering your unix script to do one table at a time. It might avoid the competition for resources. It would be good to time each stage so you can see where the issue is.&lt;br /&gt;&lt;br /&gt;Do you drop the indexes on the destination table before bcping in, then create them again afterwards? hoping to use fast bcp.&lt;br /&gt;&lt;br /&gt;Another option might be to try putting the 13 tables into their own database and simply dump the database at the source and restore it on the destination rather than bcping in and out each table.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Does anyone know of an easy way to merge Sybase users from 2 dataservers into one? Syslogins is different on both servers.&lt;br /&gt;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-5429062617398753474?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/5429062617398753474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=5429062617398753474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5429062617398753474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/5429062617398753474'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/sybase-problems-3.html' title='Sybase problems 3'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1613552305894027398</id><published>2008-08-01T03:29:00.001-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Problem&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Sybase problems 2</title><content type='html'>Cursor - Not fetching next record&lt;br /&gt;Posted: Apr 13, 2007 5:45 PM      Reply &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hi,&lt;br /&gt;I am BusinessObjects Developer and new to Sybase-IQ.&lt;br /&gt;I had created on stored procedure and facing an issue that the cursor is not fetching next record.&lt;br /&gt;Can anybody help to debug this issue.&lt;br /&gt;&lt;br /&gt;Below is the stored procedure.&lt;br /&gt;declare @catcode varchar(12);&lt;br /&gt;declare @MX integer;&lt;br /&gt;declare @MTH integer;&lt;br /&gt;declare @Yr integer;&lt;br /&gt;declare @Yr_Max integer;&lt;br /&gt;declare @Yr_Min integer;&lt;br /&gt;begin&lt;br /&gt;declare CRS_catcode SCROLL cursor for&lt;br /&gt;select distinct CATEGORY_CODE_13&lt;br /&gt;from DBA.SOD_Catcode&lt;br /&gt;order by convert(integer,CATEGORY_CODE_13) asc;&lt;br /&gt;&lt;br /&gt;open CRS_catcode;&lt;br /&gt;&lt;br /&gt;set @Yr_MIN=2000;&lt;br /&gt;set @Yr_MAX=2007;&lt;br /&gt;set @Yr=@Yr_MIN;&lt;br /&gt;&lt;br /&gt;CAT_LOOP:&lt;br /&gt;LOOP&lt;br /&gt;fetch next CRS_catcode&lt;br /&gt;into @catcode ;&lt;br /&gt;&lt;br /&gt;if convert(int,@catcode) &gt;= 842 then&lt;br /&gt;leave CAT_LOOP;&lt;br /&gt;else&lt;br /&gt;set @Yr=@Yr_MIN;&lt;br /&gt;while @Yr &lt;= 2007 loop&lt;br /&gt;print @Yr;&lt;br /&gt;set @MTH=1;&lt;br /&gt;while @MTH &lt;= 12 loop&lt;br /&gt;--Domestic&lt;br /&gt;update dba.SOD_CATCODE set&lt;br /&gt;SOD_CATCODE.Rolling_Month_Amt = AAM from&lt;br /&gt;(select B.buss_unit_desc,B.LINE_ITEM_DESC,B.GBO,&lt;br /&gt;B.ledger_type,B.SOD_PAGE,SUM(B.ACTUAL_AMOUNT_MTD) as AAM from&lt;br /&gt;dba.SOD_CATCODE as B where&lt;br /&gt;B.category_code_13 = @CATCODE and B.FISCAL_YEAR = @Yr and&lt;br /&gt;B.FISCAL_MONTH &gt;= 1 and B.FISCAL_MONTH &lt;= @MTH and B.LEDGER_TYPE like 'DOM%'&lt;br /&gt;group by B.buss_unit_desc,B.LINE_ITEM_DESC,B.GBO,B.ledger_type,B.SOD_PAGE) as B,dba.SOD_CATCODE&lt;br /&gt;where&lt;br /&gt;SOD_CATCODE.category_code_13 = @CATCODE and SOD_CATCODE.GBO = B.GBO and&lt;br /&gt;SOD_CATCODE.buss_unit_desc = B.buss_unit_desc and SOD_CATCODE.ledger_type like 'DOM%' and&lt;br /&gt;SOD_CATCODE.LINE_ITEM_DESC = B.LINE_ITEM_DESC and SOD_CATCODE.SOD_PAGE = B.SOD_PAGE and&lt;br /&gt;SOD_CATCODE.FISCAL_YEAR = @Yr and SOD_CATCODE.FISCAL_MONTH = @MTH;&lt;br /&gt;commit work;&lt;br /&gt;set @MTH=@MTH+1&lt;br /&gt;end loop;&lt;br /&gt;set @Yr=@Yr+1&lt;br /&gt;end loop&lt;br /&gt;end if;&lt;br /&gt;if sqlstate = err_notfound then&lt;br /&gt;print sqlstate;&lt;br /&gt;LEAVE CAT_LOOP;&lt;br /&gt;end if ;&lt;br /&gt;end loop CAT_LOOP;&lt;br /&gt;close CRS_catcode&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------&lt;br /&gt; Re: Cursor - Not fetching next record&lt;br /&gt;Posted: Jul 12, 2007 5:34 PM      Reply &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hi dear&lt;br /&gt;u have not use fetch next statement in your sp before the close of the cursor&lt;br /&gt;&lt;br /&gt;try this , i think it will help u&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* Notice: Formatted SQL is not the same as input */&lt;br /&gt;(52,32)then&lt;br /&gt;DECLARE @catcode VARCHAR(12);&lt;br /&gt;DECLARE @MX INTEGER;&lt;br /&gt;DECLARE @MTH INTEGER;&lt;br /&gt;DECLARE @Yr INTEGER;&lt;br /&gt;DECLARE @Yr_Max INTEGER;&lt;br /&gt;DECLARE @Yr_Min INTEGER;&lt;br /&gt;begin&lt;br /&gt;declare CRS_catcode SCROLL cursor for&lt;br /&gt;select distinct CATEGORY_CODE_13&lt;br /&gt;from DBA.SOD_Catcode&lt;br /&gt;order by convert(integer,CATEGORY_CODE_13) asc;&lt;br /&gt;&lt;br /&gt;open CRS_catcode;&lt;br /&gt;&lt;br /&gt;set @Yr_MIN=2000;&lt;br /&gt;set @Yr_MAX=2007;&lt;br /&gt;set @Yr=@Yr_MIN;&lt;br /&gt;&lt;br /&gt;CAT_LOOP:&lt;br /&gt;LOOP&lt;br /&gt;fetch next CRS_catcode&lt;br /&gt;into @catcode ;&lt;br /&gt;&lt;br /&gt;if convert(int,@catcode) &gt;= 842 then&lt;br /&gt;leave CAT_LOOP;&lt;br /&gt;else&lt;br /&gt;set @Yr=@Yr_MIN;&lt;br /&gt;while @Yr &lt;= 2007 loop&lt;br /&gt;print @Yr;&lt;br /&gt;set @MTH=1;&lt;br /&gt;while @MTH &lt;= 12 loop&lt;br /&gt;--Domestic&lt;br /&gt;update dba.SOD_CATCODE set&lt;br /&gt;SOD_CATCODE.Rolling_Month_Amt = AAM from&lt;br /&gt;(select B.buss_unit_desc,B.LINE_ITEM_DESC,B.GBO,&lt;br /&gt;B.ledger_type,B.SOD_PAGE,SUM(B.ACTUAL_AMOUNT_MTD) as AAM from&lt;br /&gt;dba.SOD_CATCODE as B where&lt;br /&gt;B.category_code_13 = @CATCODE and B.FISCAL_YEAR = @Yr and&lt;br /&gt;B.FISCAL_MONTH &gt;= 1 and B.FISCAL_MONTH &lt;= @MTH and B.LEDGER_TYPE like 'DOM%'&lt;br /&gt;group by B.buss_unit_desc,B.LINE_ITEM_DESC,B.GBO,B.ledger_type,B.SOD_PAGE) as B,dba.SOD_CATCODE&lt;br /&gt;where&lt;br /&gt;SOD_CATCODE.category_code_13 = @CATCODE and SOD_CATCODE.GBO = B.GBO and&lt;br /&gt;SOD_CATCODE.buss_unit_desc = B.buss_unit_desc and SOD_CATCODE.ledger_type like 'DOM%' and&lt;br /&gt;SOD_CATCODE.LINE_ITEM_DESC = B.LINE_ITEM_DESC and SOD_CATCODE.SOD_PAGE = B.SOD_PAGE and&lt;br /&gt;SOD_CATCODE.FISCAL_YEAR = @Yr and SOD_CATCODE.FISCAL_MONTH = @MTH;&lt;br /&gt;commit work;&lt;br /&gt;set @MTH=@MTH+1&lt;br /&gt;end loop;&lt;br /&gt;&lt;br /&gt;set @Yr=@Yr+1&lt;br /&gt;end loop&lt;br /&gt;end if;&lt;br /&gt;&lt;br /&gt;IF sqlState = Err_NotFound&lt;br /&gt;IF sqlState = Err_NotFound Then&lt;br /&gt;PRINT sqlState;&lt;br /&gt;LEAVE CAT_LOOP;&lt;br /&gt;end if ;&lt;br /&gt;end loop CAT_LOOP;&lt;br /&gt;----------------------------------------------&lt;br /&gt;fetch next CRS_catcode&lt;br /&gt;into @catcode ;&lt;br /&gt;-----------------------------------------------&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;close CRS_catcode&lt;br /&gt;&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1613552305894027398?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1613552305894027398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1613552305894027398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1613552305894027398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1613552305894027398'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/sybase-problems-2.html' title='Sybase problems 2'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1871475606052529503</id><published>2008-08-01T03:28:00.000-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Problem&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Sybase problems</title><content type='html'>1. I am facing a problem with bcp process on the following environment&lt;br /&gt;    OS - Linux&lt;br /&gt;    database - sybase&lt;br /&gt;&lt;br /&gt;   I have 13 tables in my database with max 8450782 rows in a table.&lt;br /&gt;   so I have write a script for unix, in which whole bcp process is done in one shot being a single process in background(bcp-out from source table , truncate on    destination table,bcp-in ). in this way my all the 13 tables refreshes simultaniously.my tables have not any indexes,or other referential dependency.&lt;br /&gt;   some times this whole process slow down significantly.so is there any issue with multiple tables refreshing.&lt;br /&gt;   is my this approach is wrong or what i need to speed up the process.&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;2. I am having five user in each Sybase server,Now i want to merge Sybase users from 2 dataservers into one? Syslogins is different on both servers how do i do     this in efficient way.&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;3. I have the following procedure:&lt;br /&gt;&lt;br /&gt;create PROCEDURE sp_SEARCH_Contragents(@nSPFirmID integer,@nFilterID integer,@szName varchar(255)=null,@szTaxNum varchar(255)=null,@szBULSTAT varchar(255)=null,@szFullCode varchar(255)=null,@szCity varchar(255)=null,@szPhone varchar(255)=null,@szAddress varchar(255)=null)&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt;declare @szNameSign varchar(2),&lt;br /&gt;@szTaxNumSign varchar(2),&lt;br /&gt;@szBULSTATSign varchar(2),&lt;br /&gt;@szFullCodeSign varchar(2),&lt;br /&gt;@szCitySign varchar(2),&lt;br /&gt;@szPhoneSign varchar(2),&lt;br /&gt;@szAddressSign varchar(2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create table #tResult(&lt;br /&gt;Name varchar(255) null,&lt;br /&gt;TaxNum varchar(30) null,&lt;br /&gt;BULSTAT varchar(10) null,&lt;br /&gt;FullCode varchar(100) null,&lt;br /&gt;City varchar(255) null,&lt;br /&gt;Phone varchar(100) null,&lt;br /&gt;Address varchar(255) null,&lt;br /&gt;FoldID integer null,&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;insert into #tResult( Name,TaxNum,BULSTAT,FullCode,City,Phone,Address,Fo ldID)&lt;br /&gt;select..........from &lt;some&gt; where.............&lt;br /&gt;&lt;br /&gt;insert into #tResult(Name,TaxNum,BULSTAT,FullCode,City,Phone,A ddress,FoldID)&lt;br /&gt;select.................. from &lt;other&gt; where..............&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select Name as Name,&lt;br /&gt;TaxNum as TaxNum,&lt;br /&gt;BULSTAT as BULSTAT,&lt;br /&gt;FullCode as FullCode,&lt;br /&gt;City as City,&lt;br /&gt;Phone as Phone,&lt;br /&gt;Address as Address,&lt;br /&gt;FoldID as FoldID&lt;br /&gt;from #tResult&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;If I execute the procedure from ISQL with some input values it is working correctly. But if I try to execute it from Java like&lt;br /&gt;&lt;br /&gt;ResultSet res = stmt.executeQuery("exec sp_SEARCH_Contragents &lt;the&gt;");&lt;br /&gt;&lt;br /&gt;or like this&lt;br /&gt;&lt;br /&gt;CallableStatement cs = conn.PreparedCall("{call sp_SEARCH_Contragents &lt;the&gt;)}");&lt;br /&gt;&lt;br /&gt;I don't get any rows or error,could you fick the problem where i am having ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1871475606052529503?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1871475606052529503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1871475606052529503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1871475606052529503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1871475606052529503'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/sybase-problems.html' title='Sybase problems'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-9180597436760557768</id><published>2008-08-01T03:27:00.000-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Set III</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:???????????????¡ì????????; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:SimSun;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;If you are create trigger for insert in which you are going to insert 10 rows how many time it will fire?&lt;span style=""&gt;                                     &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Only once&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare IN and EXISTS?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;in allow duplicate values and sub query have oe column,exists not allow duplicates and inner query can have multi columns&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;3&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Index Covering?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Index covering is a mechanism for using the leaf level of nonclustered index the way the data page of a clustered index would work. Index covering occurs when all columns referenced in a query are contained in the index itself.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;4&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Checkpoint?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The point at which all data pages that have been changed are guaranteed to have been written to the database device.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;5&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is direct update and deffered update?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Direct Update:An update operation that takes place in a single step, that is, the log records are written and the data and index pages are changed. Direct updates can be performed in three ways: in-place update, on-page update, and delete/insert direct update.&lt;span style=""&gt;                                                                                                                                                                                                                     &lt;/span&gt;&lt;span style=""&gt;                                                                                                                                                                                                                                                                &lt;/span&gt;&lt;span style=""&gt;                                  &lt;/span&gt;&lt;br /&gt;Deffered Update:An update operation that takes place in two steps. First, the log records for deleting existing entries and inserting new entries are written to the log, but only the delete changes to the data pages and indexes take place. In the second step, the log pages are rescanned, and the insert operations are performed on the data pages and indexes.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;6&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is @@spid,@@rowcount,@@error?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a name="RANGE!C14"&gt;returns the no of rows affected by the preceding query&lt;/a&gt;&lt;/p&gt;  &lt;span style=""&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;7&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I what to see all locks in the server?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_lock,syslocks&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;8&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is sp_help and sp_helpdb?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_help use to display the objects in a database,sp_helpdb used to display the databases in your server&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;9&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the different types of lock in Sybase?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Shared locks :SQL server applies shared lock for read operations. All the&lt;span style=""&gt;  &lt;/span&gt;processes can read,&lt;span style=""&gt;       &lt;/span&gt;but no process can write.&lt;br /&gt;Update lock&lt;span style=""&gt;  &lt;/span&gt;:allows many processes to read, but no other process can get an excl. or update&lt;span style=""&gt;       &lt;/span&gt;lock. This lock is applied during update or delete but changes to excl lock when&lt;span style=""&gt;       &lt;/span&gt;modification takes place and exists till the transaction is completed.&lt;br /&gt;&lt;br /&gt;Exclusive lock: SQL server applies exclusive lock for data modification operations. When the&lt;span style=""&gt;      &lt;/span&gt;transaction gets exclusive lock, other transactions cannot obtain any other type&lt;span style=""&gt;      &lt;/span&gt;of locks until the exclusive lock is released at the end of the transaction.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;10&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain&lt;span style=""&gt;  &lt;/span&gt;Join order for Performance?&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;The optimal query plan for a join involves picking the best indexes for each table and the most efficient order to process the tables in the joins. The query optimizer checks all the join orders for cost optimization. The minimum I/O time which reduces cost will be selected for processing. If many tables are joined, SQL breaks into possible tables of a group. Examine the tables in the group and query optimizer performs permutation on each table and makes the final four tables, which minimize the cost and I/Os.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;11&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain Index and Performance?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Clustered index not reusing available space on preceding pages which makes pages grow longer and the search takes long time to complete. It is better to use cluster index for data value that is somewhat randomly distributed throughout the table.&lt;br /&gt;&lt;br /&gt;In non-cluster point of view, first check the impact on the performance of OLTP environment for addition of non-clustered index. It is better to use non-cluster where low number of duplicates are present. It is good for large number of duplicate values. It is more effective if less than 10 to 20% of data is to be accessed through non clustered. Non-clustered is useful for single row lookups, joins, queries on columns that are highly selective and for queries with small range retrievals&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;12&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;what is a ghost record ? &lt;/p&gt;  &lt;p class="MsoNormal"&gt;These are records that have been logically deleted but not physically deleted from the leaf level of an index.&lt;br /&gt;The reasons for this are complicated, but basically having ghost records simplfies key-range locking and transaction rollback.&lt;br /&gt;The record is marked with a bit that indicates it's a ghost record and cannot be physically deleted until the transaction that caused it to be ghosted commits. Once this is done, it is deleted by an asynchronous background proces (called the ghost-cleanup task) or it is converted back to a real record by an insert of a record with the exact same set of keys.&lt;br /&gt;Ghost records will be mentioned later in the series when I discuss page compaction.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;13&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Delete and Truncate?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;14&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is the use of timestamp?&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;timestamp is a data type that exposes automatically generated binary&lt;br /&gt;numbers, which are guaranteed to be unique within a database. timestamp is&lt;br /&gt;used typically as a mechanism for version-stamping table rows. The storage&lt;br /&gt;size is 8 bytes.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;15&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the Inbuilt User defined datatypes&lt;span style=""&gt;  &lt;/span&gt;available in Sybase?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sysnames,timestamps&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;16&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Write a query to select all records that do not have a null value?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;17&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How the Hotspot can be Resolved?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;using heap table&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;18&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How can I select the first 500 rows from a table having million rows &amp;amp; generate a flat file?&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;set rowcount 500&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;19&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Write a query to find out the Nth max and min?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;To find Nth max:&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;select * from table_name T1 where (N-1)=(select count (distinct T2.column_name)from&lt;span style=""&gt;   &lt;/span&gt;table_name T2 where T2.column_name&gt;T1.col_name)&lt;br /&gt;&lt;br /&gt;To find Nth min:&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;select * from table_name T1 where (N-1)=(select count (distinct&lt;span style=""&gt;  &lt;/span&gt;T2.column_name) from&lt;span style=""&gt;   &lt;/span&gt;table_name T2 where T2.column_name&lt;T1.col_name)&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;20&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What system procedures are used to list all the indexes?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_indexes&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;21&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the modes of transaction? And how do you change from one mode to another?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;unchained mode:&lt;span style=""&gt;   &lt;/span&gt;The default mode, called unchained or Transact-SQL mode,&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;requires explicit begin transaction statements paired with commit&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;transaction or rollback transaction statements to complete the&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;transaction.&lt;br /&gt;&lt;br /&gt;chained mode:&lt;span style=""&gt;   &lt;/span&gt;The SQL standards-compatible mode, called chained mode,&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;implicitly begins a transaction before any data retrieval or&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;modification statement. These statements include: delete, insert,&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;open, fetch, select, and update. You must still explicitly end the&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;transaction with commit transaction or rollback transaction.&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;You can set either mode using the chained option of the set command.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;23&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do u run a file with lot of queries on ISQL?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;isql -U -P -S -iinput file&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;24&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is the error code of Deadlock and How will you eliminate Deadlock?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;errorcode for dead lock is 1205 and for stored procedure is -3.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;25&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do you handle Error in Sybase?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;The @@ERROR Function: SQL Server sets the @@ERROR object. If the statement was successful, @@ERROR is set to 0, otherwise it is set to the designate error code. All SQL Server error codes can be found within the master.dbo.sysmessages system table. One important thing to remember is that @@ERROR is cleared each time a statement is executed. It is a good practice to store the value within a local variable.&lt;br /&gt;&lt;br /&gt;SP_ADDMESSAGE:Use the sp_addmessage feature to add your own customized messages. The following information is given about each parameter:&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;br /&gt;RAISERROR:You can also use the RAISERROR command to create an error message. RAISERROR can send the error message information back to a client application.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;26&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do you handle error in BCP?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-e&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;27&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Write a query to convert the date to dd/mm/yy?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select convert(char,date_exp,101)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;28&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When a query is sent to the database and an index is not being used, what type of execution is taking&lt;span style=""&gt;                        &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;table scan&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;place?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;29&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is an advantage to using a stored procedure as opposed to passing an SQL query from an&lt;span style=""&gt;     &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;faster execution , avoid dead lock,avoid network traffic&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;application&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;30&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are defaults? Is there a column to which a default can't be bound? &lt;/p&gt;  &lt;p class="MsoNormal"&gt;When you are inserting suppose forgot to enter the value for particular column than you will provide some constant value for that .identity ,timestamps column are default cannot bound&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;31&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Where do you think the users names and passwords will be stored in sql server?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;syslogins&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;32&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is lock escalation?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Lock escalation is the process of converting a lot of low level locks (like row locks, page locks) into higher level locks (like table locks).&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;33&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are user defined datatypes and when you should go for them? &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;User defined datatypes let you extend the base SQL Server datatypes by providing a descriptive name, and format to the database. Take for example, in your database, there is a column called Flight_Num which appears in many tables. In all these tables it should be varchar(8). In this case you could create a user defined datatype called Flight_num_type of varchar(8) and use it across all your tables. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;34&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is bit datatype and what's the information that can be stored inside a bit column? &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Bit datatype is used to store boolean information like 1 or 0 (true or false). Untill SQL Server 6.5 bit datatype could hold either a 1 or 0 and there was no support for NULL. But from SQL Server 7.0 onwards, bit datatype can represent a third state, which is NULL. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;35&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are constraints? Explain different types of constraints?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults.&lt;br /&gt;&lt;br /&gt;Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;36&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are “GRANT” and “REVOKE’ statements?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;37&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are Wildcard operators in sybase?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Selects documents that contain matches to a character string containing variables. The WILDCARD operator lets you define a search string with variables, which can be used to locate related word matches in documents. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;38&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How will you find second maximum value in a table?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select max(column) from table where column&lt;(select max(column) from table)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;39&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Optimistic locking?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Optimistic index locking does not acquire an address lock on the root page of an index during normal data manipulation language operations (DML). If your updates and inserts can cause modifications to the root page of the accessed index, optimistic index locking restarts the search and acquires an exclusive table lock, not an address lock.&lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;40&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the types of Direct update not in place?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;cheap direct update and Expensive direct update&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;41&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How the Trigger differ from rules and constraints?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;42&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If I want current database name?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;db_name()&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;43&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If I want to check my query syntax what shall I do?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;set parseonly on&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;44&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Why we should go for Deallocating the cursors?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;45&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do you call the Remote stored Procedures?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;exec server_name.db_name.proc_name&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;46&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is the Drawbacks of Normalization?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Although most successful databases are normalized to some degree, there is one substantial drawback of a normalized database: reduced database performance. The acceptance of reduced performance requires the knowledge that when a query or transaction request is sent to the database, there are factors involved, such as CPU usage, memory usage, and input/output (I/O). To make a long story short, a normalized database requires much more CPU, memory, and I/O to process transactions and database queries than does a denormalized database. A normalized database must locate the requested tables and then join the data from the tables to either get the requested information or to process the desired data. A more in-depth discussion concerning database performance occurs in Hour 18, "Managing Database Users."&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;47&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain BCP and Performance?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;48&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain Tempdb and Performance?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;49&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Thresholds and how will you add ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;50&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is the maximum row length limited by size of data page&lt;span style=""&gt;  &lt;/span&gt;in SQL Server?&lt;/p&gt;  &lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;2KB&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-9180597436760557768?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/9180597436760557768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=9180597436760557768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/9180597436760557768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/9180597436760557768'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/set-iii.html' title='Set III'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-3058724627399931611</id><published>2008-08-01T03:25:00.000-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Set II</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:???????????????¡ì????????; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:SimSun;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;what is In &amp;amp; OUT in stored procedure?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The output keyword may be specified in the sp creation statement if the parameters can be passed both in and out of the sp,when passing out you must specifiy output keyword in execution statement&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Tell me the limitation of the Trigger?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;any create commend,drop command,alter table,grant,revoke,select into,truncate,update statistics are not permitted in trigger&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;3&lt;/p&gt;  &lt;p class="MsoNormal"&gt;can I update view?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;yes,but view had created using only one table&lt;span style=""&gt;  &lt;/span&gt;than update is possiable&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;4&lt;/p&gt;  &lt;p class="MsoNormal"&gt;what is difference between constraints and rules?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;rules deals with constant and one rule can bound one column,constraints can bound many column and it can be compare with column in another table &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;5&lt;/p&gt;  &lt;p class="MsoNormal"&gt;how will you bind a rule?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_bindrule&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;6&lt;/p&gt;  &lt;p class="MsoNormal"&gt;explain about @@sqlstatus?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It returns the status of the pervious fetch statement in a cursor&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;7&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the steps involved in creating cursor?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Declaring cursors,declaring variables,opening cursors,fetching rows,main loop,closing the cursor,deallocating cursors&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;8&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Transaction Log?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It is a database level system table called syslogs,which contains a sequential list of all modification to every objects in the database.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;9&lt;/p&gt;  &lt;p class="MsoNormal"&gt;compare Rollback transaction and Rollback Trigger?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;10&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How will bcp out the Identity column?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-E&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;11&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Demand lock and Dead lock?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A deadlock occurs when there is a cyclic dependency between two or more transactions for the same set of resources.&lt;span style=""&gt;                                                          &lt;/span&gt;&lt;span style=""&gt;                                              &lt;/span&gt;Demand Lock:A demand lock prevents any more shared locks from being set on a data resource (table or data page). Any new shared lock request has to wait for the demand lock request to finish.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;12&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How to get the last month’s&lt;span style=""&gt;  &lt;/span&gt;last Day?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select datename(dw,dateadd(dd,30-datepart(dd,getdate()),dateadd(mm,-1,getdate())))&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;13&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is patindex()?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;returns the starting postion of the specified ,else 0&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;14&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do I get the Duplicate rows from a table?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select * from table name group by column1 having count(*)&gt;1&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;15&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;what is&lt;span style=""&gt;  &lt;/span&gt;command permission and object permission?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;OP is Grant/revoke to these objects for permissions which includes select,update,delete,execute.CP is grant /revoke permission for create (db,table,view,procedure,defaults)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;16&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain Stored Procedures on performance?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Query optimizer generates a query plan for a st. proc based on the parameters parsed in the first time it is executed. To make st.prc to perform well, first the quires used in the procedure are to be checked. Also since it is compiled and stored in memory, procedure may become inefficient over time. Further execution used only if it is gain otherwise again the st. proc is recompiled.&lt;br /&gt;For example when it was first compiled, it may be fast as the table size is small and the table scan is better choice. But when the table grows into huge, index selection may be a better option than the table scans for that query. But the procedure will still do only table scan as it is pre-compiled, so as a general rule, if the table size changes by 20%, we have to run update statistics on the table and recompile the stored procedure. For stored proc in which, the parameter has the strong influence over the result set, we have to make it with recompile option, so that it compiles every time it is accessed. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;17&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is sp_dboption?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It is used to enable or disable db option for your database&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;18&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain Denormalization techniques?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Denormalization is used for performance boosting. In which normalized db is denormalized for the sake of performance. According to normalization all columns has to depend on the primary key, but some times creating a manipulated field.&lt;br /&gt;&lt;br /&gt;Redundant column may be used in a table when we always join the first table to get a column data from the second table using foreign key. Data partitioning techniques like vertically splitting the tables, horizontally splitting the tables can be used to denormalize a db. Vertical split technique is typically used to minimize the size of the primary table or to move infrequently accessed columns to a separate table. Horizontal split technique involves splitting the table at row level into two or more tables. For ex, if we can split the table into two tables, so that the first table has the recent entries and a table that has historical data, we can drastically increase the size of the new table, whose columns are going to access frequently&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;19&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Which is better Stored procedure or Trigger?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you intend to set or modify some column values in the proc/trig, a trig&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;is the right place to&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;do it.&lt;span style=""&gt;  &lt;/span&gt;A BEFORE trigger can directly modify the row buffer before it is&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;updated/inserted.&lt;span style=""&gt;  &lt;/span&gt;A&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;procedure would have to issue a UPDATE, thus a performance penalty.&lt;br /&gt;---------------------&lt;br /&gt;2. The trigger has all the row data automatically available to it.&lt;span style=""&gt;  &lt;/span&gt;For the&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;procedure to have the&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;same information, you'll either have to pass all values to the proc via&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;parms, or the proc will need&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;to re-read the data, a performance penalty.&lt;br /&gt;-----------------------------&lt;br /&gt;3. If your application issues a single update, delete, or insert that modifies&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;multiple rows, a FOR&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;EACH ROW trigger will be fired for each row.&lt;span style=""&gt;  &lt;/span&gt;It could be difficult to&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;provide the SP the&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;information that allows it to identify the set of rows that were modified.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;20&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;I made two tables A B id1 age id1 age 1 Asked me to find out all the id1's which are&lt;span style=""&gt;  &lt;/span&gt;in table A and&lt;span style=""&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select * from A where not exists(select id1 from B)&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;do not exist in table b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;21&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How did you know the index was the cause of the performance degration?&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;22&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare left and Right Outer Join?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For left join all row was selected in outer table and for inner table row which are not meet the join condition are filled with NULL. In Right join inner table all row was selected and for outer table the rows which not meet the join conditins will filled with NULL&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;23&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Join and Its Types?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;Joins are used in queries to explain how different tables are related. Joins also&lt;span style=""&gt;       &lt;/span&gt;let you select data from a table depending upon data from another table.&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further&lt;span style=""&gt;      &lt;/span&gt;classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;24&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;what are different global variables ? &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;@@rowcount-returns no of rows processed by preceeding command.&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;@@error- returns the error code for last or current query.&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;@@transtate- returns the current transaction state.&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;@@tranchained-returns the current transcation mode.&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;@@server- returns the server name.&lt;br /&gt;&lt;span style=""&gt;     &lt;/span&gt;@@version-returns the version of the sql server and OS used in a system.&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;@@spid- current process id.&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;@@identity-returns the lastly incremented identity value.&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;@@nestlevel-No of level in stored procedures/trigger.&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;@@sqlstatus-status of previous fetch statement in cursor. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;25&lt;/p&gt;  &lt;p class="MsoNormal"&gt;what is temporary tables&lt;span style=""&gt;  &lt;/span&gt;and its types?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sub query&lt;span style=""&gt;          &lt;/span&gt;: A select statement that is nested inside another select, insert, update&lt;span style=""&gt;    &lt;/span&gt;or delete statement, or inside another subquery.&lt;br /&gt;&lt;br /&gt;Correlated subquery: A subquery that cannot be evaluated independently, but that depends on&lt;span style=""&gt;    &lt;/span&gt;the outer query for its results. Also called a repeating subquery, since&lt;span style=""&gt;    &lt;/span&gt;the subquery is executed once for each row that might be selected by the&lt;span style=""&gt;    &lt;/span&gt;outer query.&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;26&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Union and &lt;st1:place st="on"&gt;Union&lt;/st1:place&gt; all?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;union remove the duplicates and go for worktable creation where as union all allow duplicates and don't go for WT&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;27&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Subquery and Correlated Subquery?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sub query&lt;span style=""&gt;          &lt;/span&gt;: A select statement that is nested inside another select, insert, update&lt;span style=""&gt;    &lt;/span&gt;or delete statement, or inside another subquery.&lt;br /&gt;&lt;br /&gt;Correlated subquery: A subquery that cannot be evaluated independently, but that depends on&lt;span style=""&gt;    &lt;/span&gt;the outer query for its results. Also called a repeating subquery, since&lt;span style=""&gt;    &lt;/span&gt;the subquery is executed once for each row that might be selected by the&lt;span style=""&gt;    &lt;/span&gt;outer query.&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;28&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Update Statistics?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;29&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Primary key and Unique key?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;30&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Advantages and disadvantages of cursors?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;31&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Select into and Insert into?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;select into it will create default table and copy the value to that table from other,insert into use to insert the value only in existing table&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;32&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is “COMPUTE BY” clause in Sybase?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When ever we use compute by ,we must also include order by&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;33&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Check point in Transaction Log?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Checkpoint writes all dirty pages for the database from cache to disk,starting with the log and also it reduces the amount of work the server need to do at recovery time&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;34&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare 2 nd and 3 rd &lt;st1:place st="on"&gt;Normal&lt;/st1:place&gt; form?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Second normal form-nonkey fields must depend on the entire pr. Key.&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;Third normal form---nonkey fields must not depend on other nonkey fields.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;35&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is –I option in Sybase tools?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It is the name of the interface file to use when trying to find a server to connect to&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;36&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Is there any way to create Primary or Foreignkey on a table other than Query?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_primarykey,sp_foreginkey&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;37&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If I want to round the value 999.99 as 1000 ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;round(999.99,0)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;38&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Distribution page?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;server keeps distribution information for each index on a separate page in the datebase &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;39&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare Composite Index and Multiple Index&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;40&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is Row Padding?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Locking of the page for a long time make the other process to wait. So the time required to complete the process will increase which is not desirable. SQL prevents dirty reads by using shared locks. Make the row big enough so that only one row fit on a page which avoid the locking of page. This is called row padding.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;41&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Explain Database and Performance?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;42&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How will you create Login name and User in Sybase?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;sp_addlogin,sp_adduser&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;43&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;Is it necessary to drop &amp;amp; recreate all procedures and triggers every few months ?&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;44&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is difference between Count() and Count(*)?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;count(*) will inclued null rows and faster&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;45&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Advantage of Stored Procedure?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;faster execution,reduce network traffic,Modular programming,reduced operator eror,enforced consistency&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;46&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In a query which is better? using IN or EXISTS?&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;in allow duplicate values and sub query have oe column,exists not allow duplicates and inner query can have multi columns&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;47&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;what are triggers? advantage ? disadvantage?&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;48&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How do u copy the output results into a file?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;isql -&lt;st1:place st="on"&gt;&lt;st1:country-region st="on"&gt;Usa&lt;/st1:country-region&gt;&lt;/st1:place&gt; -P -S -oos_file_name&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;49&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Write a query to find out the Nth max and min?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;To find Nth max:&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;select * from table_name T1 where (N-1)=(select count (distinct T2.column_name)from&lt;span style=""&gt;   &lt;/span&gt;table_name T2 where T2.column_name&gt;T1.col_name)&lt;br /&gt;&lt;br /&gt;To find Nth min:&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;select * from table_name T1 where (N-1)=(select count (distinct&lt;span style=""&gt;  &lt;/span&gt;T2.column_name) from&lt;span style=""&gt;   &lt;/span&gt;table_name T2 where T2.column_name&lt;T1.col_name)&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;50&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CREATE INDEX myIndex ON myTable(myColumn)What type of Index will get created after&lt;span style=""&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;non clustered index&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;executing the above statement?&lt;/p&gt;  &lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-3058724627399931611?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/3058724627399931611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=3058724627399931611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3058724627399931611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3058724627399931611'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/set-ii.html' title='Set II'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-7669583032780150671</id><published>2008-08-01T03:22:00.001-07:00</published><updated>2008-12-22T20:21:59.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Questions and Answers Set I</title><content type='html'>Questions&lt;br /&gt;Answers&lt;br /&gt;1&lt;br /&gt;what is stored procedure?what is the maximum parameter can pass through it? &lt;br /&gt;It is a db objects that exists independly of the table ,Which contain a set of query.maximum paraperters pass through it is 255&lt;br /&gt;2&lt;br /&gt;what is Advantage of stored procedure?&lt;br /&gt;faster execution,reduce network traffic,Modular programming,reduced operator eror,enforced consistency&lt;br /&gt;3&lt;br /&gt;what is Trigger?how many trigger can  a table have and what are?&lt;br /&gt;It is internal part of a statement that fired when insert,update,delete operation taken place.Three trigger,Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table. &lt;br /&gt;4&lt;br /&gt;What is magic table?&lt;br /&gt;The table that exists within a trigger named as Inserted and deleted are Magic table&lt;br /&gt;5&lt;br /&gt;what is view?how many table can join for  creating view?&lt;br /&gt;It is logical way of looking at physical data located in a table,16&lt;br /&gt;6&lt;br /&gt;how will you add a column and drop a column?&lt;br /&gt;Alter table table name [add][drop] column name&lt;br /&gt;7&lt;br /&gt;explain about @@sqlstatus?&lt;br /&gt;It returns the status of the pervious fetch statement in a cursor&lt;br /&gt;8&lt;br /&gt;compare WHERE clause and HAVING clause?&lt;br /&gt;Where clause cannot have Aggeregate function ,and it select the row before the group by function .having select the row after the group by&lt;br /&gt;9&lt;br /&gt;What is dead lock?&lt;br /&gt;A deadlock occurs when there is a cyclic dependency between two or more transactions for the same set of resources.&lt;br /&gt;10&lt;br /&gt;What is sp_dboption?&lt;br /&gt;It is used to enable or disable db option for your database&lt;br /&gt;11&lt;br /&gt;What is CURSOR?&lt;br /&gt;It is a pointer , use for row by row operation&lt;br /&gt;12&lt;br /&gt;Why we should go for Deallocating the cursors?&lt;br /&gt;When we Deallocate the cursor so that server will clear the memory space occupied by the cursor we can use that space for some other action&lt;br /&gt;13&lt;br /&gt;How many index can have for a table?&lt;br /&gt;250&lt;br /&gt;14&lt;br /&gt;What is Clustered and Nonclustered index?&lt;br /&gt;When you craete a clustered index on a table, all the rows in the table are stored in the order of the clustered index key. So, there can be only one clustered index per table. Non-clustered indexes have their own storage separate from the table data storage. Non-clustered indexes are stored as B-tree structures (so do clustered indexes), with the leaf level nodes having the index key and it's row locater&lt;br /&gt;15&lt;br /&gt;How do I get the Duplicate rows from a table?&lt;br /&gt;select * from table group by column having count(*)&gt;1&lt;br /&gt;16&lt;br /&gt;While creating index I forgot to tell what type what will happen?&lt;br /&gt;nonclustered index&lt;br /&gt;17&lt;br /&gt;Compare Primary key and Unique key?&lt;br /&gt;Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.&lt;br /&gt;18&lt;br /&gt;What is BCP?and Types?&lt;br /&gt;It is used for import and export the values from table to os file and vice-ver.Fast bcp and Slow bcp&lt;br /&gt;19&lt;br /&gt;Compare left and Right Outer Join?&lt;br /&gt;For left join all row was selected in outer table and for inner table row which are not meet the join condition are filled with NULL. In Right join inner table all row was selected and for outer table the rows which not meet the join conditins will filled with NULL&lt;br /&gt;20&lt;br /&gt;While bcp in default,rules,constraints can be applied?&lt;br /&gt;Only default can apply&lt;br /&gt;21&lt;br /&gt;What is Hotspot?&lt;br /&gt;Whan a multipe processes attempt to modify a same page in table&lt;br /&gt;22&lt;br /&gt;How do I force the lock?&lt;br /&gt;Using Holdlock&lt;br /&gt;23&lt;br /&gt;What is Isolation levels and explain them?&lt;br /&gt;The categories of locking behavior within transaction that are defined by ANSI,Level are 0,1,2,3&lt;br /&gt;24&lt;br /&gt;how to get Yesterday’s date?&lt;br /&gt;dataadd(dd,-1,getdate())&lt;br /&gt;25&lt;br /&gt;What is –I option in Sybase tools?&lt;br /&gt;It is the name of the interface file to use when trying to find a server to connect to&lt;br /&gt;26&lt;br /&gt;How do u copy the output results into a file?&lt;br /&gt;isql -Usa -P -S -oos_file_name&lt;br /&gt;27&lt;br /&gt;What are defaults? Is there a column to which a default can't be bound? &lt;br /&gt;When you are inserting suppose forgot to enter the value for particular column than you will provide some constant value for that .identity ,timestamps column are default cannot bound&lt;br /&gt;28&lt;br /&gt;If I want current database name?&lt;br /&gt;db_name()&lt;br /&gt;29&lt;br /&gt;If i want creation text of a particular  object (such as SP,Trigger,view,rule,default)what shall i do                     &lt;br /&gt;sp_helptext,defncopy,syscomments&lt;br /&gt;30&lt;br /&gt;Compare Join and SubQuery in performance?&lt;br /&gt;Generally Join queries consume more memory than sub query. Sub query in turn involve intermediate table creation so affects performance, because of high I/Os fetches need for processing. If the RAM memory is more, then the Joins can be used instead of sub queries. Under memory constraints we can go for sub queries.&lt;br /&gt;Sometimes sub queries are flattened to join to improve the performance. Also making the outer query to compare inner query with equality option can materialize the subquery.&lt;br /&gt;31&lt;br /&gt;What are the different types of lock in Sybase?&lt;br /&gt;Shared locks :SQL server applies shared lock for read operations. All the  processes can read,       but no process can write.&lt;br /&gt;Update lock  :allows many processes to read, but no other process can get an excl. or update       lock. This lock is applied during update or delete but changes to excl lock when       modification takes place and exists till the transaction is completed.&lt;br /&gt;&lt;br /&gt;Exclusive lock: SQL server applies exclusive lock for data modification operations. When the      transaction gets exclusive lock, other transactions cannot obtain any other type      of locks until the exclusive lock is released at the end of the transaction.&lt;br /&gt;32&lt;br /&gt;List out all System procedure in your server?&lt;br /&gt;select name from sysobjects where type='P'&lt;br /&gt;33&lt;br /&gt;There's a performance issue What will be your very first step towards the solution? &lt;br /&gt;First you need to identify which query is creating the problem and than to identify where the problem lies in that query. Query that is taking maximum time is the first you want to consider for the optimization. To check which query is taking maximum time to execute place getdate() both before and after the query. Identity the type of the query whether it is a data look-up query, or data modification query.&lt;br /&gt;34&lt;br /&gt;What is @@rowcount?&lt;br /&gt;returns the no of rows affected by the preceding query&lt;br /&gt;35&lt;br /&gt;How do you check whether the rollback was correct?&lt;br /&gt;By checking the @@trancount value  before rollback statement execute&lt;br /&gt;36&lt;br /&gt;What is Index Covering?&lt;br /&gt;Index covering is a mechanism for using the leaf level of nonclustered index the way the data page of a clustered index would work. Index covering occurs when all columns referenced in a query are contained in the index itself.&lt;br /&gt;37&lt;br /&gt;How do you select unique rows using Sybase?&lt;br /&gt;using Distinct keyword&lt;br /&gt;39&lt;br /&gt;How many database Sybase 11 have ,list out with explanations?&lt;br /&gt;four.Master,Model,sybsystemprocs,tempdb&lt;br /&gt;40&lt;br /&gt;What is Roll Forward and Roll Back?&lt;br /&gt;Roll forward : commited transaction not written to data area are rolled forward into the data.Roll back:uncommited transaction rollback all data modification done with in transaction are reversed&lt;br /&gt;41&lt;br /&gt;If I want to round the value 999.99 as 1000 ?&lt;br /&gt;round(999.99,0)&lt;br /&gt;42&lt;br /&gt;What is Phantom reads? &lt;br /&gt;when one transaction reads a set of rows that satisfy a search &lt;br /&gt;condition, and then a second transaction modifies the data (through an &lt;br /&gt;insert, delete, update, and so on). If the first transaction repeats &lt;br /&gt;the read with the same search conditions, it obtains a different set &lt;br /&gt;of rows. &lt;br /&gt;43&lt;br /&gt;How will you Restart and Exit on while loop?&lt;br /&gt;continue,break&lt;br /&gt;44&lt;br /&gt;Compare Delete and Truncate?&lt;br /&gt;DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.&lt;br /&gt;45&lt;br /&gt;How many columns  can table  have?&lt;br /&gt;250&lt;br /&gt;46&lt;br /&gt;How will you find second maximum value in a table?&lt;br /&gt;select max(column1) from table where column1&lt;(select max(column1) from table)&lt;br /&gt;47&lt;br /&gt;How shall I simulate from level 0 to level 3 in Isolation?&lt;br /&gt;using holdlock&lt;br /&gt;48&lt;br /&gt;Can I explicitly insert  a value in a Identity column?&lt;br /&gt;set identity_insert on&lt;br /&gt;49&lt;br /&gt;Can I change the data type of column ?&lt;br /&gt;yes using modify keyword&lt;br /&gt;50&lt;br /&gt;How will you tune a query?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-7669583032780150671?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/7669583032780150671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=7669583032780150671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7669583032780150671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7669583032780150671'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/questions-and-answers-set-i.html' title='Questions and Answers Set I'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1748456341383727277</id><published>2008-08-01T03:17:00.000-07:00</published><updated>2008-12-22T20:21:59.689-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQ&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Q 122</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:???????????????¡ì????????; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-alt:Verdana; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:536871559 0 0 0 415 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent 	{margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:.5in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	mso-layout-grid-align:none; 	text-autospace:none; 	font-size:12.0pt; 	mso-bidi-font-size:16.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1614050942; 	mso-list-type:hybrid; 	mso-list-template-ids:86138368 250015912 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:12.0pt; 	font-family:"Times New Roman"; 	color:windowtext;} @list l1 	{mso-list-id:1854803998; 	mso-list-type:hybrid; 	mso-list-template-ids:1056441562 67698703 1907120554 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l1:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1:level2 	{mso-level-text:"%2\)"; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;I)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt;"&gt; &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;1. Give some notes on Indexes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;span style=""&gt;2. Expalin the steps involved during the first execution and subsequent executions of a stored&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;    &lt;/span&gt;procedure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;3.State whether the following statements are true or false&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Wildcards can be contained in values passed to stored procedure-T(like)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Rules, defaults and column properties do not apply to parameters defined with user defiend datatypes -T&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Parameter name should be 20 characters in length-F(29)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;In order to make changes in the stored procedure, we can alter the stored procedure-F(drop)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;The stored procedure return 0 on success and 1 for errors-F (0 , -1 to -99)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;        &lt;/span&gt;4.&lt;span style=""&gt;  &lt;/span&gt;Explain the set commands given below&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;1)&lt;span style=""&gt;   &lt;/span&gt;set rowcount (Instruct the server to rturn only the first n rows of data)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;2)&lt;span style=""&gt;   &lt;/span&gt;set statistics io on (Asks the server for the no. of logical and physical page requests)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;                  &lt;/span&gt;3)&lt;span style=""&gt;   &lt;/span&gt;set nocount on ( stops reporting the number of rows returned)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;4)&lt;span style=""&gt;   &lt;/span&gt;set noexec on ( parse and optimize, but don’t exec the query (used with show plan for looking at the plan without running a query)) showplan gives the final optimization plan for a query)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;5)&lt;span style=""&gt;   &lt;/span&gt;set statistics time on (requests the execution time)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;        &lt;/span&gt;5.&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;What is isolation level, list different isolation levels in Sybase and what is default?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;To avoid the manual overriding of locking, we have transaction isolation level which are tied&lt;span style=""&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;with transaction.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;List of different isolation levels are isolation level 0,1,2,3. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;Isolation level 1- this allow read operation can only read pages. No dirty reads are allowed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;Isolation level 0-This allows reading pages that currently are being modified. It allows dirty&lt;span style=""&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;   &lt;/span&gt;read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;  &lt;/span&gt;Isolation level 2-Allows a single page to be read many times within same transaction and&lt;span style=""&gt;    &lt;/span&gt;guarantees that same value is read each time. This prevent other users to read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyTextIndent"&gt;Isolation level 3- preventing another transaction from updating, deleting or inserting rows for pages previously read within transaction&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;Isolation level 1 is the default.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;II)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;span style=""&gt;  &lt;/span&gt;The database has the Following relations: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Classes(class,type,country,numGuns,bore,displacement) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Ships(name,class,launched) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Battles(name,date) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Outcomes(ship,battle,result) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: justify;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Ships in classes are arranged to a single project. A class is normally assigned the name of the first ship in the class under consideration (head ship); otherwise, class name does not coincide with any ship name in the database). The relation Classes includes the class name, type (bb for a battle ship, or bc for a battle cruiser), country the ship was built, number of main guns, gun caliber (diameter of the gun barrel, in inches), and displacement (weight in tons). The relation Ships includes the ship's name, its class name, and launch year. The relation Battles covers the name and date of the battle the ships participated; while the result of their participation in the battle (sunk, damaged, or unharmed - OK) is in the relation Outcomes. Note: the relation Outcomes may include the ships not included in the relation Ships.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;span style=""&gt;                       &lt;/span&gt;&lt;span style=""&gt;                                                                                                                                                                                                                                                                &lt;/span&gt;&lt;span style=""&gt;                                                                                                                                                 &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:341.25pt;"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\02\clip_image001.gif" href="http://www.sql-ex.ru/images/ships.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/02/clip_image001.gif" shapes="_x0000_i1025" width="455" height="258" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style="color: black;"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;Point out the battles in which      at least three ships from the same country took part.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Verdana; color: black;"&gt;Find all ship      names beginning with letter "R".&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Verdana; color: black;"&gt;For each class,      define the number of ships of this class that were sunk in battles. Result      set: class, number of sunked ships.&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Verdana; color: black;"&gt;For each class,      consisting of at least three ships, define the number of ships (that must      be at least 1) of this class sunk in battles. Result set: class, number of      sunken ships.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1748456341383727277?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1748456341383727277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1748456341383727277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1748456341383727277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1748456341383727277'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/q-122.html' title='Q 122'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-3695310858945711279</id><published>2008-08-01T03:16:00.000-07:00</published><updated>2008-12-22T20:21:59.689-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQ&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Q 121</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:???????????????¡ì????????; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-alt:Verdana; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:536871559 0 0 0 415 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h2 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:2; 	font-size:18.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1206527748; 	mso-list-type:hybrid; 	mso-list-template-ids:-1082889296 -616268492 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l1 	{mso-list-id:1275675921; 	mso-list-type:hybrid; 	mso-list-template-ids:-28644596 10418264 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l1:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l2 	{mso-list-id:1505776453; 	mso-list-type:hybrid; 	mso-list-template-ids:487518548 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l2:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;h2&gt;&lt;span style="font-size: 14pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;I) &lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;1.&lt;span style=""&gt;  &lt;/span&gt;State whether the following is true or false&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;1)&lt;span style=""&gt;  &lt;/span&gt;The object names of the SQL server can be upto 50 characters in length and are case-sensitive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;2)&lt;span style=""&gt;  &lt;/span&gt;The name of the tables can be same in the same database&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;3)&lt;span style=""&gt;  &lt;/span&gt;The default property for the identity column is null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;4)&lt;span style=""&gt;  &lt;/span&gt;Identity columns must use the numeric datatype and have a scale of 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Ans: F-30, T, F, T&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;   &lt;/span&gt;2.&lt;span style=""&gt;  &lt;/span&gt;Answer the following&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;A numeric column allows to store upto _38__ decimal places&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;The scale of the numeric datatype for identity column is_0___&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Views can have __16__levels of nesting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Maximum number of parameters the stored procedure can accept is _255__&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;(set identity_insert table_name on)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;  &lt;/span&gt;3.&lt;span style=""&gt;  &lt;/span&gt;Explain the views with check option&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;  &lt;/span&gt;4.&lt;span style=""&gt;  &lt;/span&gt;Give the function name for the description given&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.5in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Largest integer less than or equal to the specified value-floor(num_expr)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Current active roles for user-show_role()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Returns a specified part of date_expr value as a string- datename(datepart,dateexpr)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Replace expr1, if null with expr2- isnull(expr1, expr2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Generates string of int_expr spaces- space(int_exp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;6)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Returns length of expr in bytes-datalength(expr)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;span style=""&gt;  &lt;/span&gt;5. What are the different kinds of locks in sybase?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2 style="margin: 0in 0in 0.0001pt 0.25in;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Locking: The process of restricting access to resources in a multi-user environment to&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;maintain security and prevent concurrent access problems. SQL Server&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;automatically applies locks to tables or pages.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;Shared locks—SQL server applies shared lock for read operations. All the processes can read, but no process can write. (Eg- select statement.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;Exclusive lock--- SQL server applies exclusive lock for data modification operations. When the transaction gets exclusive lock, other transactions cannot obtain any other type of locks until the exclusive lock is released at the end of the transaction.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;Update lock –allows many processes to read, but no other process can get an excl. or update lock. This lock is applied during update or delete but changes to excl lock when modification takes place and exists till the transaction is completed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;h2&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt;"&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;II)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt; The database scheme consists of four relations:&lt;br /&gt;&lt;br /&gt;Product(maker, model, type)&lt;br /&gt;PC(code, model, speed, ram, hd, cd, price)&lt;br /&gt;Laptop(code, model, speed, ram, hd, screen, price)&lt;br /&gt;Printer(code, model, color, type, price)&lt;br /&gt;&lt;br /&gt;The relation "Product" shows the maker, model number, and type (pc, laptop, or printer). It is assumed that model numbers are unique for all the makers and product types. For each model number specifying pc in the relation "PC", its listed speed (of the processor in MGz), total RAM (in MGb), hd capacity (in Gb), CD ROM speed (for example, '4x'), and the price. The relation "Laptop" is similar to that one of PCs except for the CD ROM speed which is replaced by screen size (in inches). For each printer model in the relation "Printer" it is pointed whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 3pt 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 3pt 0.0001pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 9pt; font-family: Verdana;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:353.25pt;"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\02\clip_image001.gif" href="http://sql-ex.ru/images/computers.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/02/clip_image001.gif" shapes="_x0000_i1025" width="471" height="307" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Find the maker producing at least two different&lt;span style=""&gt;  &lt;/span&gt;PC having speed&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 39.75pt;"&gt;not&lt;span style=""&gt;  &lt;/span&gt;less than 750 MGz.&lt;span style=""&gt;  &lt;/span&gt;&lt;b&gt;Result set:&lt;/b&gt; Maker.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;2)&lt;span style=""&gt;  &lt;/span&gt;Find out Nth min price which includes pc,laptop,printer&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;         &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;For each group of laptops with the identical model number, add following record &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;       &lt;/span&gt;into PC table: &lt;b style=""&gt;code: &lt;/b&gt;minimal code among laptops in the group +20;&lt;b style=""&gt;model:&lt;/b&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;       &lt;/span&gt;laptop's max model number +1000;&lt;b style=""&gt;speed: &lt;/b&gt;maximal speed among laptops in the &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;       &lt;/span&gt;group;&lt;b style=""&gt;ram:&lt;/b&gt; maximal ram size among laptops in the group *2 ,&lt;b style=""&gt;hd&lt;/b&gt;: maximal hd &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;       &lt;/span&gt;capacity among laptops in the group *2;&lt;b style=""&gt;cd:&lt;/b&gt; default value;&lt;b style=""&gt;price:&lt;/b&gt; maximal price&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;       &lt;/span&gt;among laptops in the group divided by 1.5;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;         &lt;/span&gt;insert pc(code,model,speed,ram,hd,price) select min(code)+20,model+1000,max(speed),max(ram)*2,max(hd)*2,max(price)/1.5&lt;span style=""&gt;  &lt;/span&gt;from laptop group by model&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-3695310858945711279?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/3695310858945711279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=3695310858945711279' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3695310858945711279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3695310858945711279'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/08/q-121.html' title='Q 121'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-1658946498699821874</id><published>2008-07-23T01:36:00.000-07:00</published><updated>2008-12-22T20:21:59.689-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Sybase Interview Questions and Answers </title><content type='html'>  &lt;div class="post hentry"&gt;&lt;a name="4919442399159180463"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_9342.html"&gt;Sybase  Interview Questions and Answers X&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 644pt; border-collapse: collapse;" str="" width="859" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 309pt;" width="412"&gt; &lt;col style="width: 300pt;" width="400"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 17.25pt;" height="23"&gt; &lt;td class="xl23" style="width: 35pt; height: 17.25pt;" width="47" height="23"&gt;Sl.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 309pt;" width="412"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 300pt;" width="400"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl26" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;1&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;In a table A have &lt;a id="AdBriteInlineAd_name" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="name"&gt;name&lt;/a&gt; and id,table B&lt;span&gt;  &lt;/span&gt;have Id and deposit and table C have id and withdrawal ,write a query to  retrive the name and final amount I.e deposit-withdrawal&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" str="select name,b.deposit-c.withdrawl from a,b,c where a.id=b.id and b.id=c.id " width="400"&gt;&lt;a id="AdBriteInlineAd_select" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="select"&gt;select&lt;/a&gt;  name,b.deposit-c.withdrawl from a,b,c where a.id=b.id and b.id=c.id&lt;span&gt;  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;2&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)Is the&lt;span&gt; &lt;/span&gt;&lt;a id="AdBriteInlineAd_stored" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" onclick="" href="http://click.adbrite.com/mb/click.php?sid=766652&amp;amp;banner_id=10895041&amp;amp;variation_id=133272&amp;amp;uts=1216802135&amp;amp;cpc=302e333334&amp;amp;keyword_id=23352&amp;amp;inline=y&amp;amp;zk_id=34719463&amp;amp;ab=168362082&amp;amp;sscup=29fec4be09937698064ef2d812423460&amp;amp;sscra=74d59ded65ddc6b6d5d1cbd5cf4e0765&amp;amp;ub=3504911940&amp;amp;guid=66fdbddeac8e3c873eef90ed258fccee&amp;amp;rs=&amp;amp;r=" target="_top" display="inline" keyword="stored"&gt;Stored&lt;/a&gt; Procedure is reentrant  ?&lt;span&gt; &lt;/span&gt;B) What is not reentrant?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;It is not reentrant ,only one user can &lt;a id="AdBriteInlineAd_access" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="access"&gt;access&lt;/a&gt; SP one at the &lt;a id="AdBriteInlineAd_time" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="time"&gt;time&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;3&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is the use of &lt;a id="AdBriteInlineAd_creating" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="creating"&gt;creating&lt;/a&gt; view with &lt;a id="AdBriteInlineAd_check" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="check"&gt;check&lt;/a&gt; option?&lt;span&gt;  &lt;/span&gt;B)Can I update View?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)Check &lt;a id="AdBriteInlineAd_flag" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll 50% bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" target="_top" display="inline" keyword="flag"&gt;flag&lt;/a&gt; prevent insertion or  updation of a rows that will subsequently not meet the view criteria&lt;span&gt;  &lt;/span&gt;B) Yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;4&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;explain about @@spid?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;current proccess id&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;5&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is the performance issue on CURSOR?&lt;span&gt; &lt;/span&gt;B)What are the  step involved in creating Cursor?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)Each time you fetch a row from the cursor,&lt;br /&gt;it results in a  network roundtrip, where as a normal SELECT query makes only one rowundtrip,  however large the resultset is. Cursors are also costly because they require  more resources and temporary storage (results in more IO operations). Furthere,  there are restrictions on the SELECT statements that can be used with some types  of cursors. Most of the times, set based operations can be used instead  of&lt;br /&gt;cursors.&lt;br /&gt;B)Declaring cursors,declaring variables,opening  cursors,fetching rows,main loop,closing the cursor,deallocating  cursors&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;6&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" str="A)What are the Properties of Transaction?                                        B) What is Chained Mode  in Transaction?                                           " width="412"&gt;A)What  are the Properties of Transaction?&lt;span&gt; &lt;/span&gt;B) What is Chained Mode&lt;span&gt;  &lt;/span&gt;in Transaction?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;server maintain transaction log,server performs automatic recovery  upon restart ,server locks table pages during transaction,transaction control  statement&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;7&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;what is -A option on bcp?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;change the network packet size for bcp session&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;8&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How would you update SP if the tables are modified?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;we have to drop the Sp and recreate it&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;9&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)How will you minimizse the Lock contention?&lt;span&gt; &lt;/span&gt;B)What is  Hotspots?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;keep Transaction as short and concise as possiable,keep transaction in  single batch,consider running transaction in stored procedure,commit update in  cursor frequently,avoid hotspots.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 141.75pt;" num="" width="47" height="189"&gt;10&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is optimistic locking?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;11&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is -X option in defn copy?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;password encryption&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 126pt;" num="" width="47" height="168"&gt;12&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;You have two tables a and b with column c1 in both of them.  Column&lt;br /&gt;c1 in table a has values 1, 2 and 3 and the column in tables b has  values 3,&lt;br /&gt;4, 5. How many rows would the following query return? select * from  a, b&lt;br /&gt;where a.c1 &lt;&gt; b.c1&lt;br /&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;1row&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;13&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" str="What happen when we have  cascading effect on unique  index ? " width="412"&gt;What happen  when we have&lt;span&gt; &lt;/span&gt;cascading effect on unique&lt;span&gt; &lt;/span&gt;index ?&lt;span&gt;  &lt;/span&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;optimizer will go for deffered update&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 141.75pt;" num="" width="47" height="189"&gt;14&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A) What are the types of index?&lt;span&gt; &lt;/span&gt;B)What is the difference  between Clustered and non clustered index on performance wise?&lt;/td&gt; &lt;td class="xl30" style="width: 300pt;" width="400"&gt;B)When you craete a clustered  index on a table, all the rows in the table are stored in the order of the  clustered index key. So, there can be only one clustered index per table.  Non-clustered indexes have their own storage separate from the table data  storage. Non-clustered indexes are stored as B-tree structures (so do clustered  indexes), with the leaf level nodes having the index key and it's row  locater,clustered index is better for range queries,more duplicates in table and  non clustered for single row lookup.one clustered index and 249 non clustered  index.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;15&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Checkpoint?&lt;/td&gt; &lt;td class="xl27" style="border-left: medium none; width: 300pt;" width="400"&gt;The  point at which all data pages that have been changed are guaranteed to have been  written to the database device.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;16&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is deadlock ?&lt;span&gt; &lt;/span&gt;B) how it is differed from demand  lock?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)A deadlock occurs when there is a cyclic dependency between two or  more transactions for the same set of resources.&lt;span&gt; &lt;/span&gt;B) Demand Lock:A  demand lock prevents any more shared locks from being set on a data resource  (table or data page). Any new shared lock request has to wait for the demand  lock request to finish.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 157.5pt;" height="210"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 157.5pt;" num="" width="47" height="210"&gt;17&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is dirty read ?&lt;span&gt; &lt;/span&gt;B)how it is deferred from phantom  read?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" str="A)   Such reads occur when one transaction modifies a row, and a second transaction reads that row before the first transaction commits the change. If the first transaction rolls back the change, the information read by the second transaction becomes invalid B)when one transaction reads a set of rows that satisfy a search  condition, and then a second transaction modifies the data (through an  insert, delete, update, and so on). If the first transaction repeats the read with the same search conditions, it obtains a different set of rows. " width="400"&gt;A)&lt;span&gt;  &lt;/span&gt;Such reads occur when one transaction modifies a row, and a second  transaction reads that row before the first transaction commits the change. If  the first transaction rolls back the change, the information read by the second  transaction becomes invalid&lt;br /&gt;B)when one transaction reads a set of rows that  satisfy a search&lt;br /&gt;condition, and then a second transaction modifies the data  (through an&lt;span&gt; &lt;/span&gt;insert, delete, update, and so on). If the first  transaction repeats the read with the same search conditions, it obtains a  different set of rows.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;18&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Why would we use stored procedures over triggers for  optimizing&lt;br /&gt;queries?&lt;br /&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A trigger gets fired for every transaction. It is another overhead in  the query. Depending on how important the query is you can drop triggers and  write a store procedure for that. And at end of the day you can run that stored  procedure to perform the operations performed by the trigger.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;19&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;what is str()?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" str="numeric to character conversion " width="400"&gt;numeric to character  conversion&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;20&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How do you list out all the indexes?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;sp_helpindexes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 94.5pt;" num="" width="47" height="126"&gt;21&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Rollback trigger and how its differed from rollback Tran?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;You can roll back triggers using either the rollback trigger statement  or the rollback transaction statement (if the trigger is fired as part of a  transaction). However, rollback trigger rolls back only the effect of the  trigger and the statement that caused the trigger to fire; rollback transaction  rolls back the entire transaction&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 252pt;" height="336"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 252pt;" num="" width="47" height="336"&gt;22&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the Drawbacks of Normalization?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Although most successful databases are normalized to some degree,  there is one substantial drawback of a normalized database: reduced database  performance. The acceptance of reduced performance requires the knowledge that  when a query or transaction request is sent to the database, there are factors  involved, such as CPU usage, memory usage, and input/output (I/O). To make a  long story short, a normalized database requires much more CPU, memory, and I/O  to process transactions and database queries than does a denormalized database.  A normalized database must locate the requested tables and then join the data  from the tables to either get the requested information or to process the  desired data. A more in-depth discussion concerning database performance occurs  in Hour 18, "Managing Database Users."&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;23&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference in creating Temp table using select into and  create command?&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;select into will create with rows and it is faster ,create command  will create only table structure.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;24&lt;/td&gt; &lt;td class="xl29" style="border-left: medium none; width: 309pt;" width="412"&gt;How do  you delete the identity gaps in identity columns?&lt;/td&gt; &lt;td class="xl27" style="border-left: medium none; width: 300pt;" width="400"&gt;&lt;span&gt;&lt;/span&gt;bcp out all the rows to a flat file and truncte the  table,then bcp in the rows from file to that table&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="8779302771365033191"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_321.html"&gt;Sybase  Interview Questions and Answers IX&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 416pt; border-collapse: collapse;" str="" width="555" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 26pt;" width="35"&gt; &lt;col style="width: 212pt;" width="283"&gt; &lt;col style="width: 178pt;" width="237"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl24" style="width: 26pt; height: 31.5pt;" width="35" height="42"&gt;Sl.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 212pt;" width="283"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 178pt;" width="237"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 15.75pt;" width="35" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 63pt;" num="" width="35" height="84"&gt;1&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;What is the difference between decimal and Float datatypes?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" str="Float is approximate numeric datatypes and precision value is 15 digits,Decimal in exact numeric datatype and precision value is 28 " width="237"&gt;Float  is approximate numeric datatypes and precision value is 15 digits,Decimal in  exact numeric datatype and precision value is 28&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 39pt;" height="52"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 39pt;" num="" width="35" height="52"&gt;2&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;The table Emp with (name,dept,id,salary) find&lt;span&gt; &lt;/span&gt;employee  name who is having max salary among all the emp in dept wise.&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;select *&lt;span&gt; &lt;/span&gt;from emp group by dept having  max(salary)&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 173.25pt;" height="231"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 173.25pt;" num="" width="35" height="231"&gt;3&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)What are the limitation while passing the parameter in stored  procedures?&lt;span&gt; &lt;/span&gt;B)What is Default paameter in SP?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;A)Parameters name may be upto 29 character in length,upto 255  parameter may be defined,rules,defaults and column properites may not be applied  but wildcard can applied,text,image datatype can pass trough for read only  ,&lt;span&gt; &lt;/span&gt;B)While we create sp we have to assgin the default value for  the&lt;span&gt; &lt;/span&gt;parameter.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 31.5pt;" num="" width="35" height="42"&gt;4&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;How do you list out all the Rules and Defaults in your database?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;select name from sysobjects where type ='D' or type='R'&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 126pt;" num="" width="35" height="168"&gt;5&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)How the Stored Procedure is said to be Faster execution ?&lt;span&gt;  &lt;/span&gt;B)What are the advantage of SP?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;A)Sp after their first execution become memory resident and no need to  reparsed,reoptimized or recompiled .&lt;span&gt; &lt;/span&gt;B)faster execution,reduce  network traffic,Modular programming,reduced operator eror,enforced  consistency&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 47.25pt;" num="" width="35" height="63"&gt;6&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)What are limitation on view that cannot include?&lt;span&gt; &lt;/span&gt;B)Can  I drop a view?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;select into,compute clause,union,order by.yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 141.75pt;" num="" width="35" height="189"&gt;7&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)What are the limitation of Trigger?&lt;span&gt; &lt;/span&gt;B)What happen when  we update the table using Trigger?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" str="A)any create commend,drop command,alter table,grant,revoke,select into,truncate,update statistics are not permitted in trigger .                                                                   B)The delete row will  entered into the Deleted table and newly inserted row  will enter into the inserted table and base table inside the trigger " width="237"&gt;A)any  create commend,drop command,alter table,grant,revoke,select into,truncate,update  statistics are not permitted in trigger .&lt;span&gt; &lt;/span&gt;B)The delete row  will&lt;span&gt; &lt;/span&gt;entered into the Deleted table and newly inserted row&lt;span&gt;  &lt;/span&gt;will enter into the inserted table and base table inside the  trigger&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 15.75pt;" num="" width="35" height="21"&gt;8&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;explain about @@transtate?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;&lt;span&gt;&lt;/span&gt;returns the current transaction state.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 110.25pt;" num="" width="35" height="147"&gt;9&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)what are the steps involed in creating cursor?&lt;span&gt; &lt;/span&gt;B)What  is the syntax for cursor declaration for update?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;A)Declaring cursors,declaring variables,opening cursors,fetching  rows,main loop,closing the cursor,deallocating cursors&lt;span&gt; &lt;/span&gt;B)declare  cursor_name cursor for select_statement for update&lt;span&gt; &lt;/span&gt;[of  col_list]&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 315pt;" height="420"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 315pt;" num="" width="35" height="420"&gt;10&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)What is nested transaction ?&lt;span&gt; &lt;/span&gt;B)In Which Mode nested  transaction is eliminated?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;A)You can nest transactions within other transactions. When you nest  begin transaction and commit transaction statements, the outermost pair actually  begin and commit the transaction. The inner pairs just keep track of the nesting  level. Adaptive Server does not commit the transaction until the commit  transaction that matches the outermost begin transaction is issued. Normally,  this transaction "nesting" occurs as stored procedures or triggers that contain  begin/commit pairs call each other,The @@trancount global variable keeps track  of the current nesting level for transactions.&lt;span&gt; &lt;/span&gt;B) Chained  Mode&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 47.25pt;" num="" width="35" height="63"&gt;11&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" str="How can I select the second 500 rows from a table having million rows &amp;amp; generate a flat file?  " width="283"&gt;How  can I select the second 500 rows from a table having million rows &amp;amp; generate  a flat file?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;BCP -F and -L&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 63pt;" num="" width="35" height="84"&gt;12&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" str="A)What is  Hotspot ?                                                                                " width="283"&gt;A)What  is&lt;span&gt; &lt;/span&gt;Hotspot ?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;Whan a multipe processes attempt to modify a same page in table,It can  be resolved using heap table and clustered index&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 31.5pt;" num="" width="35" height="42"&gt;13&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;If I want current host computer name of client process?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;host_name()&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 15.75pt;" num="" width="35" height="21"&gt;14&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;What are the SP related with syskeys?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;sp_primarykey,sp_common key&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 94.5pt;" num="" width="35" height="126"&gt;15&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;A)What is the difference between&lt;span&gt; &lt;/span&gt;isolation level 2 and  3?&lt;span&gt; &lt;/span&gt;B)In which level Dirty read is eliminated?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;A)Level 2 allow phantom read and prevent dirty read and non repeatable  read and always go for page level locks: Level 3 prevents all the three reads  and go for table level locks&lt;span&gt; &lt;/span&gt;B)Level 1,2,&amp;amp; 3&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 267.75pt;" height="357"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 267.75pt;" num="" width="35" height="357"&gt;16&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;Compare Join and SubQuery in performance?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;Generally Join queries consume more memory than sub query. Sub query  in turn involve intermediate table creation so affects performance, because of  high I/Os fetches need for processing. If the RAM memory is more, then the Joins  can be used instead of sub queries. Under memory constraints we can go for sub  queries.&lt;br /&gt;Sometimes sub queries are flattened to join to improve the  performance. Also making the outer query to compare inner query with equality  option can materialize the subquery.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 15.75pt;" num="" width="35" height="21"&gt;17&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;What is str()?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;gives the sustring from string&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 15.75pt;" num="" width="35" height="21"&gt;18&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;How do you handle error in BCP?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" str="'-e" width="237"&gt;-e&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 31.5pt;" num="" width="35" height="42"&gt;19&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;Explain -Z option in defncopy?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none;"&gt;No  Answer&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl26" style="border-top: medium none; width: 26pt; height: 94.5pt;" num="" width="35" height="126"&gt;20&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 212pt;" width="283"&gt;Explain me the I and II normal form ?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 178pt;" width="237"&gt;Normal I : all repeating groups have to moved into separate tables and  one column contain exactly one value.&lt;span&gt; &lt;/span&gt;Normal II: A nonkey fields  must depend on the entire primary key.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_321.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T23:08:00-07:00"&gt;11:08  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=8779302771365033191"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=8779302771365033191"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="3525456511382690762"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_9426.html"&gt;Sybase  Interview Questions and Answers VIII&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 644pt; border-collapse: collapse;" str="" width="859" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 309pt;" width="412"&gt; &lt;col style="width: 300pt;" width="400"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 17.25pt;" height="23"&gt; &lt;td class="xl23" style="width: 35pt; height: 17.25pt;" width="47" height="23"&gt;Sl.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 309pt;" width="412"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 300pt;" width="400"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl26" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;1&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;In a table A have name and id,table B&lt;span&gt; &lt;/span&gt;have Id and deposit  and table C have id and withdrawal ,write a query to retrive the name and final  amount I.e deposit-withdrawal&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" str="select name,b.deposit-c.withdrawl from a,b,c where a.id=b.id and b.id=c.id " width="400"&gt;select  name,b.deposit-c.withdrawl from a,b,c where a.id=b.id and b.id=c.id&lt;span&gt;  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;2&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)Is the&lt;span&gt; &lt;/span&gt;Stored Procedure is reentrant ?&lt;span&gt; &lt;/span&gt;B)  What is not reentrant?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;It is not reentrant ,only one user can access SP one at the  time&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;3&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is the use of creating view with check option?&lt;span&gt;  &lt;/span&gt;B)Can I update View?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria&lt;span&gt; &lt;/span&gt;B) Yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;4&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;explain about @@spid?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;current proccess id&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;5&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is the performance issue on CURSOR?&lt;span&gt; &lt;/span&gt;B)What are the  step involved in creating Cursor?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)Each time you fetch a row from the cursor,&lt;br /&gt;it results in a  network roundtrip, where as a normal SELECT query makes only one rowundtrip,  however large the resultset is. Cursors are also costly because they require  more resources and temporary storage (results in more IO operations). Furthere,  there are restrictions on the SELECT statements that can be used with some types  of cursors. Most of the times, set based operations can be used instead  of&lt;br /&gt;cursors.&lt;br /&gt;B)Declaring cursors,declaring variables,opening  cursors,fetching rows,main loop,closing the cursor,deallocating  cursors&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;6&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" str="A)What are the Properties of Transaction?                                               B) What is Chained Mode  in Transaction?                                           " width="412"&gt;A)What  are the Properties of Transaction?&lt;span&gt; &lt;/span&gt;B) What is Chained Mode&lt;span&gt;  &lt;/span&gt;in Transaction?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;server maintain transaction log,server performs automatic recovery  upon restart ,server locks table pages during transaction,transaction control  statement&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;7&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;what is -A option on bcp?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;change the network packet size for bcp session&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;8&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How would you update SP if the tables are modified?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;we have to drop the Sp and recreate it&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;9&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)How will you minimizse the Lock contention?&lt;span&gt; &lt;/span&gt;B)What is  Hotspots?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;keep Transaction as short and concise as possiable,keep transaction in  single batch,consider running transaction in stored procedure,commit update in  cursor frequently,avoid hotspots.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 141.75pt;" num="" width="47" height="189"&gt;10&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is optimistic locking?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;11&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is -X option in defn copy?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;password encryption&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 126pt;" num="" width="47" height="168"&gt;12&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;You have two tables a and b with column c1 in both of them.  Column&lt;br /&gt;c1 in table a has values 1, 2 and 3 and the column in tables b has  values 3,&lt;br /&gt;4, 5. How many rows would the following query return? select * from  a, b&lt;br /&gt;where a.c1 &lt;&gt; b.c1&lt;br /&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;8 rows&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;13&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" str="What happen when we have  cascading effect on unique  index ? " width="412"&gt;What happen  when we have&lt;span&gt; &lt;/span&gt;cascading effect on unique&lt;span&gt; &lt;/span&gt;index ?&lt;span&gt;  &lt;/span&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;optimizer will go for deffered update&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 173.25pt;" height="231"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 173.25pt;" num="" width="47" height="231"&gt;14&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A) What are the types of index?&lt;span&gt; &lt;/span&gt;B)What is the difference  between Clustered and non clustered index on performance wise?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A) Clustered and Non clustered index&lt;span&gt; &lt;/span&gt;B) B)When you craete  a clustered index on a table, all the rows in the table are stored in the order  of the clustered index key. So, there can be only one clustered index per table.  Non-clustered indexes have their own storage separate from the table data  storage. Non-clustered indexes are stored as B-tree structures (so do clustered  indexes), with the leaf level nodes having the index key and it's row  locater,clustered index is better for range queries,more duplicates in table and  non clustered for single row lookup.one clustered index and 249 non clustered  index.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;15&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Checkpoint?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;The point at which all data pages that have been changed are  guaranteed to have been written to the database device.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;16&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is deadlock ?&lt;span&gt; &lt;/span&gt;B) how it is differed from demand  lock?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A)A deadlock occurs when there is a cyclic dependency between two or  more transactions for the same set of resources.&lt;span&gt; &lt;/span&gt;B) Demand Lock:A  demand lock prevents any more shared locks from being set on a data resource  (table or data page). Any new shared lock request has to wait for the demand  lock request to finish.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 157.5pt;" height="210"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 157.5pt;" num="" width="47" height="210"&gt;17&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is dirty read ?&lt;span&gt; &lt;/span&gt;B)how it is deferred from phantom  read?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" str="A)   Such reads occur when one transaction modifies a row, and a second transaction reads that row before the first transaction commits the change. If the first transaction rolls back the change, the information read by the second transaction becomes invalid B)when one transaction reads a set of rows that satisfy a search  condition, and then a second transaction modifies the data (through an  insert, delete, update, and so on). If the first transaction repeats the read with the same search conditions, it obtains a different set of rows. " width="400"&gt;A)&lt;span&gt;  &lt;/span&gt;Such reads occur when one transaction modifies a row, and a second  transaction reads that row before the first transaction commits the change. If  the first transaction rolls back the change, the information read by the second  transaction becomes invalid&lt;br /&gt;B)when one transaction reads a set of rows that  satisfy a search&lt;br /&gt;condition, and then a second transaction modifies the data  (through an&lt;span&gt; &lt;/span&gt;insert, delete, update, and so on). If the first  transaction repeats the read with the same search conditions, it obtains a  different set of rows.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;18&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Why would we use stored procedures over triggers for  optimizing&lt;br /&gt;queries?&lt;br /&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A trigger gets fired for every transaction. It is another overhead in  the query. Depending on how important the query is you can drop triggers and  write a store procedure for that. And at end of the day you can run that stored  procedure to perform the operations performed by the trigger.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;19&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;what is str()?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" str="numeric to character conversion " width="400"&gt;numeric to character  conversion&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;20&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How do you list out all the indexes?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;sp_helpindexes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 94.5pt;" num="" width="47" height="126"&gt;21&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Rollback trigger and how its differed from rollback Tran?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;You can roll back triggers using either the rollback trigger statement  or the rollback transaction statement (if the trigger is fired as part of a  transaction). However, rollback trigger rolls back only the effect of the  trigger and the statement that caused the trigger to fire; rollback transaction  rolls back the entire transaction&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 252pt;" height="336"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 252pt;" num="" width="47" height="336"&gt;22&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the Drawbacks of Normalization?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Although most successful databases are normalized to some degree,  there is one substantial drawback of a normalized database: reduced database  performance. The acceptance of reduced performance requires the knowledge that  when a query or transaction request is sent to the database, there are factors  involved, such as CPU usage, memory usage, and input/output (I/O). To make a  long story short, a normalized database requires much more CPU, memory, and I/O  to process transactions and database queries than does a denormalized database.  A normalized database must locate the requested tables and then join the data  from the tables to either get the requested information or to process the  desired data. A more in-depth discussion concerning database performance occurs  in Hour 18, "Managing Database Users."&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;23&lt;/td&gt; &lt;td class="xl30" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference in creating Temp table using select into and  create command?&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;select into will create with rows and it is faster ,create command  will create only table structure.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_9426.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T23:05:00-07:00"&gt;11:05  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=3525456511382690762"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=3525456511382690762"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="2120888786146200224"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_5082.html"&gt;Sybase  Interview Questions and Answers VII&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt;Sl.No Questions Answers&lt;br /&gt;&lt;br /&gt;1 A)How do  find how many rows are deleted using trigger? A)By checking no rows entered into  the deleted table inside the trigger&lt;br /&gt;2 How do you create empty copy of an  existing table ? Select * into table1 from table2 where 1=2&lt;br /&gt;3 How do you get  the value return by the stored procedures? Using OUTPUT keyword&lt;br /&gt;4 A)What is  the difference between a return (0) and a return(X) ,X being any integer in a  SP? B) What are the limitation Paramters in SP? A)every SP automatically returns  an integer status value:0 is returened on successful compltion,-1 to -99 are  returned for sql server detected error B)Parameters name may be upto 29  character in length,upto 255 parameter may be defined,rules,defaults and column  properites may not be applied but wildcard can applied,text,image datatype can  pass trough for read only&lt;br /&gt;5 A)Can I update view? B)What are the limitation on  view ? A)yes,but view had created using only one table than update is possiable  B)View can have aggregate function,joins,distinct clause but not include select  into,compute,union,order by clause&lt;br /&gt;6 Explain about @@identity? return the  lastly inserted identity value&lt;br /&gt;7 What is Timestamp? "timestamp is a data type  that exposes automatically generated binary numbers, which are guaranteed to be  unique within a database. timestamp is used typically as a mechanism for  version-stamping table rows. The storage size is 8 bytes.&lt;br /&gt;"&lt;br /&gt;8 A)what is  Cursor? B) What is CURSOR and performance? "A) Its a Pointer used for row by row  operation . B)Each time you fetch a row from the cursor,&lt;br /&gt;it results in a  network roundtrip, where as a normal SELECT query makes only one rowundtrip,  however large the resultset is. Cursors are also costly because they require  more resources and temporary storage (results in more IO operations). Furthere,  there are restrictions on the SELECT statements that can be used with some types  of cursors.Most of the times, set based operations can be used instead of  cursors.&lt;br /&gt;"&lt;br /&gt;9 A)What is DeadLock? B)What is error code for Deadlock? "A) A  deadlock occurs when there is a cyclic dependency between two or more  transactions for the same set of resourcesB)errorcode for dead lock is 1205 and  for stored procedure is -3.&lt;br /&gt;"&lt;br /&gt;10 What are the stored procedure that are  related with syskeys? sp_primarykey,sp_forigenkey,sp_commonkey&lt;br /&gt;11 A) How do I  force the Lock ? A)Using Hold Lock&lt;br /&gt;12 There are three tables  A(col1,col2),B(col1,col2),C(col1,col2,col3) what will be the result Select *  from A,B,C where A.col1=B.col1 no of rows selected by A.col1=B.col1 * no of rows  in C&lt;br /&gt;13 Write a query to convert the date to dd/mm/yy? "select  convert(char,date_exp,101)&lt;br /&gt;"&lt;br /&gt;14 What is Distribution page? server keeps  distribution information for each index on a separate page in the datebase&lt;br /&gt;15  A)What is the difference between isolation level 2 and 3? B)In which level Non  Repeatable read is eliminated? A)Level 2 allow phantom read and prevent dirty  read and non repeatable read and always go for page level locks: Level 3  prevents all the three reads and go for table level locks B)Level 3&lt;br /&gt;16  A)Which one we have to create first clustered or non clustered index ?  A)Clustered index&lt;br /&gt;17 Find the name from EMP which strats with a or b or c.  select name from EMP where name like'[abc]%'&lt;br /&gt;18 What is replicate()? Repeats  char_exp, int_exp times&lt;br /&gt;19 What is -T option in bcp? This is the size of text  or image data,default size is 32KB&lt;br /&gt;20 Explain -E in isql? It is used to  specfiy an editor,vi is default&lt;br /&gt;21 How do you transfer the Table syntax to a  file ? using isql we can do it&lt;br /&gt;23 What is the drawaback of Normalization?  "Although most successful databases are normalized to some degree, there is one  substantial drawback of a normalized database: reduced database performance. The  acceptance of reduced performance requires the knowledge that when a query or  transaction request is sent to the database, there are factors involved, such as  CPU usage, memory usage, and input/output (I/O). To make a long story short, a  normalized database requires much more CPU, memory, and I/O to process  transactions and database queries than does a denormalized database. A  normalized database must locate the requested tables and then join the data from  the tables to either get the requested information or to process the desired  data. A more in-depth discussion concerning database performance occurs in Hour  18, ""Managing Database Users.""&lt;br /&gt;&lt;br /&gt;"  &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_5082.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T23:05:00-07:00"&gt;11:05  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=2120888786146200224"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=2120888786146200224"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="3525757078028389408"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_6676.html"&gt;Sybase  Interview Questions and Answers VI&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 548pt; border-collapse: collapse;" str="" width="731" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 255pt;" width="340"&gt; &lt;col style="width: 258pt;" width="344"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 21pt;" height="28"&gt; &lt;td class="xl25" style="width: 35pt; height: 21pt;" width="47" height="28"&gt;Sl.No&lt;/td&gt; &lt;td class="xl26" style="border-left: medium none; width: 255pt;" width="340"&gt;Questions&lt;/td&gt; &lt;td class="xl26" style="border-left: medium none; width: 258pt;" width="344"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl28" style="border-left: medium none; width: 255pt;" width="340"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl28" style="border-left: medium none; width: 258pt;" width="344"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 126pt;" num="" width="47" height="168"&gt;1&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Subquery and Correlated Subquery?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="Sub query : A select statement that is nested inside another select, insert, update or delete statement, or inside another subquery. Correlated subquery: A subquery that cannot be evaluated independently, but that depends on the outer query for its results. Also called a repeating subquery, since  the subquery is executed once for each row that might be selected by the    outer query. " width="344"&gt;Sub  query : A select statement that is nested inside another select, insert, update  or delete statement, or inside another subquery.&lt;br /&gt;Correlated subquery: A  subquery that cannot be evaluated independently, but that depends on the outer  query for its results. Also called a repeating subquery, since&lt;span&gt; &lt;/span&gt;the  subquery is executed once for each row that might be selected by the&lt;span&gt;  &lt;/span&gt;outer query.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;2&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is the use of creating view with check option?&lt;span&gt; &lt;/span&gt;B)  Can I drop a View?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria&lt;span&gt; &lt;/span&gt;B)yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;3&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)Explain about @@sqlstatus?&lt;span&gt; &lt;/span&gt;B)What are possiable value  of @@sqlstatus?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)It returns the status of the pervious fetch statement in a cursor  B)0,1,2&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;4&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is the performance issue on&lt;span&gt; &lt;/span&gt;CURSOR?&lt;span&gt;  &lt;/span&gt;B)What are the steps involed in creating the cursor?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)Each time you fetch a row from the cursor,it results in a network  roundtrip, where as a normal SELECT query makes only one rowundtrip, however  large the resultset is. Cursors are also costly because they require more  resources and temporary storage (results in more IO operations). Furthere, there  are restrictions on the SELECT statements that can be used with some types of  cursors.Most of the times, set based operations can be used instead of  cursors.&lt;br /&gt;B)Declaring cursors,declaring variables,opening cursors,fetching  rows,main loop,closing the cursor,deallocating cursors&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;5&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What are the Properties of Transaction?&lt;span&gt; &lt;/span&gt;B)What&lt;span&gt;  &lt;/span&gt;are the modes of transaction ?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)server maintain transaction log,server locks table pages during  transaction,server performs automatic recovery upon restart ,transaction control  statement B)Chained and Unchained&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;6&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How will bcp out the Identity column?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;-E&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;7&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A) what are the two modes in BCP?&lt;span&gt; &lt;/span&gt;B)explain&lt;span&gt;  &lt;/span&gt;about how to achive fast BCP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;B)Table does'nt have indexes and trigger and we have to set select  into bulk copy&lt;span&gt; &lt;/span&gt;option for the particular database&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;8&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Can I transfer table syntax from database to flat file using  defncopy?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="No ,It can be done using isql " width="344"&gt;No ,It can be done using  isql&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;9&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is lock escalation?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Lock escalation is the process of converting a lot of low level locks  (like row locks, page locks) into higher level locks (like table  locks).&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;10&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is optimistic locking?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;11&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Checkpoint?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;The point at which all data pages that have been changed are  guaranteed to have been written to the database device.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 135pt;" height="180"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 135pt;" num="" width="47" height="180"&gt;12&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" str="There's a performance issue What will be your very first step towards the solution? " width="340"&gt;There's  a performance issue What will be your very first step towards the  solution?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;I will run the Update Sataiscis and&lt;span&gt; &lt;/span&gt;you need to identify  which query is creating the problem and than to identify where the problem lies  in that query. Query that is taking maximum time is the first you want to  consider for the optimization. To check which query is taking maximum time to  execute place getdate() both before and after the query. Identity the type of  the query whether it is a data look-up query, or data modification  query.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;13&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" str="A)What is Phantom Reads?                                                                 " width="340"&gt;A)What  is Phantom Reads?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)when one transaction reads a set of rows that satisfy a search  condition, and then a second transaction modifies the data (through an insert,  delete, update, and so on). If the first transaction repeats the read with the  same search conditions, it obtains a different set of rows.&lt;br /&gt;B) Such reads  occur when one transaction reads a row and a second transaction modifies that  row. If the second transaction commits its change, subsequent reads by the first  transaction yield different results than the original read.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 176.25pt;" height="235"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 176.25pt;" num="" width="47" height="235"&gt;14&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Join and SubQuery in performance?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Generally Join queries consume more memory than sub query. Sub query  in turn involve intermediate table creation so affects performance, because of  high I/Os fetches need for processing. If the RAM memory is more, then the Joins  can be used instead of sub queries. Under memory constraints we can go for sub  queries.Sometimes sub queries are flattened to join to improve the performance.  Also making the outer query to compare inner query with equality option can  materialize the subquery.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;15&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is datediff?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="return the date difference accordding to the  datapart " width="344"&gt;return  the date difference accordding to the&lt;span&gt; &lt;/span&gt;datapart&lt;span&gt;  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;16&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is the system procedure to view current lock and processes  respectively?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;No Answer&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;17&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare not IN and not EXISTS?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;in allow duplicate values and sub query have one column,exists not  allow duplicates and inner query can have multi columns&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;18&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is Rollback trigger ?&lt;span&gt; &lt;/span&gt;B) how it is differ from  Rollback transaction?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;You can roll back triggers using either the rollback trigger statement  or the rollback transaction statement (if the trigger is fired as part of a  transaction). However, rollback trigger rolls back only the effect of the  trigger and the statement that caused the trigger to fire; rollback transaction  rolls back the entire transaction&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;19&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What happen when we delete the table using Trigger?&lt;span&gt; &lt;/span&gt;B)  What are the limitation of Trigger?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)The delete row will&lt;span&gt; &lt;/span&gt;entered into the Deleted table  inside the trigger&lt;span&gt; &lt;/span&gt;B ) any create commond,drop command,alter  table,grant,revoke,select into,truncate,update statistics are not permitted in  trigger&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 206.25pt;" height="275"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 206.25pt;" num="" width="47" height="275"&gt;20&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is the Drawbacks of Normalization?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Although most successful databases are normalized to some degree,  there is one substantial drawback of a normalized database: reduced database  performance. The acceptance of reduced performance requires the knowledge that  when a query or transaction request is sent to the database, there are factors  involved, such as CPU usage, memory usage, and input/output (I/O). To make a  long story short, a normalized database requires much more CPU, memory, and I/O  to process transactions and database queries than does a denormalized database.  A normalized database must locate the requested tables and then join the data  from the tables to either get the requested information or to process the  desired data.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;21&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do you call the remote SP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;severname.database.owner.Spname&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;22&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Truncate and Delete?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;DELETE TABLE is a logged operation, so the deletion of each row gets  logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes  all the rows in a table, but it won't log the deletion of each row, instead it  logs the deallocation of the data pages of the table, which makes it faster. Of  course, TRUNCATE TABLE can be rolled back.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;23&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Explain&lt;span&gt; &lt;/span&gt;sp_recompile?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Sp_recompile is used when updated statistics have been updated on the  table and when an index has been added to a table that you want the optimizer to  consider to generate new query plan for the SP&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;24&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Sp_dboption?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;It is used to enable or diable option for database&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;25&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Write a query for selecting all persons with lastname like  'smith'(anycase)from a table?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;select lastname from table where lastname like&lt;span&gt;  &lt;/span&gt;'%[Ss][Mm][Ii][Tt][Hh]%'&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;26&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Given two tables A and B having 3 and 2 columns respectively,If I run  select * from A,B what will be the number of rows?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Cartiesan product&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;27&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is&lt;span&gt; &lt;/span&gt;money and smallmoney?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;it is exact datatye with four digit decimal precision ,money with 8  bytes and small money with 4 bytes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;28&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is recursive SP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. " width="344"&gt;you  can write stored procedures that call themselves. Recursion can be defined as a  method of problem solving wherein the solution is arrived at by repetitively  applying it to subsets of the problem.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;29&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is system procedure related with syskeys?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;sp_primarykey,sp_commonkey&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;30&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do you list out all the indexes in a database?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;sp_helpindexes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;31&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do I get the current database name?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;db_name()&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;32&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Demand lock and Dead lock?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A deadlock occurs when there is a cyclic dependency between two or  more transactions for the same set of resources.&lt;span&gt; &lt;/span&gt;Demand Lock:A  demand lock prevents any more shared locks from being set on a data resource  (table or data page). Any new shared lock request has to wait for the demand  lock request to finish.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 257.25pt;" height="343"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 257.25pt;" num="" width="47" height="343"&gt;33&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A) What are two types of Index?&lt;span&gt; &lt;/span&gt;B)Explain Index and  Performance?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A) Clustered and Non Clustered Index&lt;span&gt; &lt;/span&gt;B)Clustered index  not reusing available space on preceding pages which makes pages grow longer and  the search takes long time to complete. It is better to use cluster index for  data value that is somewhat randomly distributed throughout the  table.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;In non-cluster point of view, first check the impact on  the performance of OLTP environment for addition of non-clustered index. It is  better to use non-cluster where low number of duplicates are present. It is good  for large number of duplicate values. It is more effective if less than 10 to  20% of data is to be accessed through non clustered. Non-clustered is useful for  single row lookups, joins, queries on columns that are highly selective and for  queries with small range retrievals&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl30" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;34&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 255pt;" str="What is bit datatype ? " width="340"&gt;What is bit datatype ?&lt;span&gt;  &lt;/span&gt;&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 258pt;" str="Bit datatype is used to store boolean information like 1 or 0 (true or false). and there was no support for NULL. " width="344"&gt;Bit  datatype is used to store boolean information like 1 or 0 (true or false). and  there was no support for NULL.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_6676.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T23:03:00-07:00"&gt;11:03  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=3525757078028389408"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=3525757078028389408"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="4718308177312458615"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_7869.html"&gt;Sybase  Interview Questions and Answers V&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 619pt; border-collapse: collapse;" str="" width="825" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 309pt;" width="412"&gt; &lt;col style="width: 275pt;" width="366"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 20.25pt;" height="27"&gt; &lt;td class="xl23" style="width: 35pt; height: 20.25pt;" width="47" height="27"&gt;Sl.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 309pt;" width="412"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 275pt;" width="366"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl26" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl27" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;1&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference between decimal and Float datatypes?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Float is approximate numeric datatypes and precision value is 15  digits,Decimal in exact numeric datatype and precision value is 28&lt;span&gt;  &lt;/span&gt;Float have presion upto 7 and it is float datatype,Decimal is numeri  datatype&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl27" style="width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;2&lt;/td&gt; &lt;td class="xl29" style="border-left: medium none; width: 309pt;" width="412"&gt;The  table Emp with (name,dept,id,salary) find&lt;span&gt; &lt;/span&gt;employee name who is  having max salary among all the emp in dept wise.&lt;/td&gt; &lt;td class="xl30" style="border-left: medium none; width: 275pt;" width="366"&gt;select  *&lt;span&gt; &lt;/span&gt;from emp group by dept having max(salary)&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl27" style="width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;3&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What are the limitation while passing the parameter in stored  procedures?&lt;span&gt; &lt;/span&gt;B)What is Default paameter in SP?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Parameters name may be upto 29 character in length,upto 255 parameter  may be defined,rules,defaults and column properites may not be applied but  wildcard can applied,text,image datatype can pass trough for read only , B.  char,varchar&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;4&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How do you list out all the Rules and Defaults in your database?&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;select name from sysobjects where type ='D' or type='R'&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl27" style="width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;5&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)How the Stored Procedure is said to be Faster execution ?&lt;span&gt;  &lt;/span&gt;B)What are the advantage of SP?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Sp after their first execution become memory resident and no need to  reparsed,reoptimized or recompiled .&lt;span&gt; &lt;/span&gt;faster execution,reduce  network traffic,Modular programming,reduced operator eror,enforced  consistency&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl27" style="width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;6&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What are limitation on view that cannot include?&lt;span&gt; &lt;/span&gt;B)Can  I drop a view?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;select into,compute clause,union,order by. B. yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl27" style="width: 35pt; height: 94.5pt;" num="" width="47" height="126"&gt;7&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What are the limitation of Trigger?&lt;span&gt; &lt;/span&gt;B)What happen when  we update the table using Trigger?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" str="Any create commend,drop command,alter table,grant,revoke,select into,truncate,update statistics are not permitted in trigger .                                                                   The delete row will  entered into the Deleted table and newly inserted row  will enter into the inserted table and base table inside the trigger " width="366"&gt;Any  create commend,drop command,alter table,grant,revoke,select into,truncate,update  statistics are not permitted in trigger .&lt;span&gt; &lt;/span&gt;The delete row will&lt;span&gt;  &lt;/span&gt;entered into the Deleted table and newly inserted row&lt;span&gt; &lt;/span&gt;will  enter into the inserted table and base table inside the trigger&lt;span&gt;  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;8&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;explain about @@transtate?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;&lt;span&gt;&lt;/span&gt;returns the current transaction state.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl27" style="width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;9&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What are the steps involed in creating cursor?&lt;span&gt; &lt;/span&gt;B)What  is the syntax for cursor declaration for update?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Declaring cursors,declaring variables,opening cursors,fetching  rows,main loop,closing the cursor,deallocating cursors&lt;span&gt; &lt;/span&gt;declare  cursor_name cursor for select_statement for update&lt;span&gt; &lt;/span&gt;[of  col_list]&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl27" style="width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;10&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is lock escalation?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Lock escalation is the process of converting a lot of low level locks  (like row locks, page locks) into higher level locks (like table  locks).&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl27" style="width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;11&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is optimistic locking?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 204.75pt;" height="273"&gt; &lt;td class="xl27" style="width: 35pt; height: 204.75pt;" num="" width="47" height="273"&gt;12&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is nested transaction ?&lt;span&gt; &lt;/span&gt;B)In Which Mode nested  transaction is eliminated?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;You can nest transactions within other transactions. When you nest  begin transaction and commit transaction statements, the outermost pair actually  begin and commit the transaction. The inner pairs just keep track of the nesting  level. Adaptive Server does not commit the transaction until the commit  transaction that matches the outermost begin transaction is issued. Normally,  this transaction "nesting" occurs as stored procedures or triggers that contain  begin/commit pairs call each other,The @@trancount global variable keeps track  of the current nesting level for transactions. B. Chained Mode&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl27" style="width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;13&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" str="How can I select the first 500 rows from a table having million rows &amp;amp; generate a flat file?  " width="412"&gt;How  can I select the first 500 rows from a table having million rows &amp;amp; generate  a flat file?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;BCP -F and in out filename -L&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl27" style="width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;14&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;A)What is&lt;span&gt; &lt;/span&gt;Hotspot ?&lt;span&gt; &lt;/span&gt;B) How can be  Resolved?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Whan a multipe processes attempt to modify a same page in table.&lt;span&gt;  &lt;/span&gt;B)It can be resolved using heap table and clustered index&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl27" style="width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;15&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Table has a column varchar(10) that contain numeric and alphanumeric  values ,I want alpha numeric value how shall I get it?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;using wildcards&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;16&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;If I want current host computer name of client process?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;host_name()&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;17&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What are the SP related with syskeys?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;No Answer&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl27" style="width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;18&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference between&lt;span&gt; &lt;/span&gt;isolation level 2 and  3?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Not Clear&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 162.75pt;" height="217"&gt; &lt;td class="xl27" style="width: 35pt; height: 162.75pt;" num="" width="47" height="217"&gt;19&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Explain Worktables for performance?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;&lt;span&gt;&lt;/span&gt;If column has a unique/primary key, than there is no need  to specify the distinct clause.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;If you have more than four  tables to joins, it will definitely use a worktable to resolve the query. Try to  keep the number of tables to join to minimum. Try to create subquery to avoid  join of more than four tables.&lt;span&gt; &lt;/span&gt;If there is an index on a column,  which keeps the column sorted, you do need to specify order by clause in the  query. If you know that data is unique, than there is no need to specify the  group by clause in the query.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;20&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is str()?&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;numeric to character conversion&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;21&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How do you handle error in BCP?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;-e&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 32.25pt;" height="43"&gt; &lt;td class="xl27" style="width: 35pt; height: 32.25pt;" num="" width="47" height="43"&gt;22&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Explain -Z option in defncopy?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;This tells defncopy to put message and prompts in a language other  than default language for server&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63.75pt;" height="85"&gt; &lt;td class="xl27" style="width: 35pt; height: 63.75pt;" num="" width="47" height="85"&gt;23&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Explain me the I and II normal form ?&lt;/td&gt; &lt;td class="xl33" style="border-top: medium none; border-left: medium none; width: 275pt;" width="366"&gt;Normal I : all repeating groups have to moved into separate tables and  one column contain exactly one value.&lt;span&gt; &lt;/span&gt;Normal II: A nonkey fields  must depend on the entire primary key.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_7869.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T22:59:00-07:00"&gt;10:59  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=4718308177312458615"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=4718308177312458615"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="7396503694223019671"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_7455.html"&gt;Sybase  Interview Questions and Answers IV&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 644pt; border-collapse: collapse;" str="" width="859" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 309pt;" width="412"&gt; &lt;col style="width: 300pt;" width="400"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl23" style="width: 35pt; height: 15.75pt;" width="47" height="21"&gt;Sl.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 309pt;" width="412"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 300pt;" width="400"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl26" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 126pt;" num="" width="47" height="168"&gt;1&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Explain&lt;span&gt; &lt;/span&gt;Correlated Subquery with examples?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;&lt;br /&gt;Correlated subquery: A subquery that cannot be evaluated  independently, but that depends on&lt;span&gt; &lt;/span&gt;the outer query for its results.  Also called a repeating subquery, since&lt;span&gt; &lt;/span&gt;the subquery is executed  once for each row that might be selected by the&lt;span&gt; &lt;/span&gt;outer query.Using  Exists is fine example for correlated subquery.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;2&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Is the&lt;span&gt; &lt;/span&gt;Stored Procedure is reentrant and What is&lt;span&gt;  &lt;/span&gt;not reentrant?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;It is not reentrant ,only one user can access SP one at the  time&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;3&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the use of creating view with check option?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;4&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;explain about @@servername?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;name of the local sql server&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 236.25pt;" height="315"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 236.25pt;" num="" width="47" height="315"&gt;5&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the disadvantage of CURSOR?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Each time you fetch a row from the cursor,&lt;br /&gt;it results in a network  roundtrip, where as a normal SELECT query&lt;br /&gt;makes only one rowundtrip, however  large the resultset is. Cursors are&lt;br /&gt;also costly because they require more  resources and temporary storage&lt;br /&gt;(results in more IO operations). Furthere,  there are restrictions on&lt;br /&gt;the SELECT statements that can be used with some  types of cursors.&lt;br /&gt;&lt;br /&gt;Most of the times, set based operations can be used  instead of&lt;br /&gt;cursors.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;6&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What are the Properties of Transaction?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;server maintain transaction log,server locks table pages during  transaction,server performs automatic recovery upon restart ,transaction control  statement&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;7&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;During BCP out How do I exclude a column?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Create a view based on the table that you want to exclude a column  from and&lt;br /&gt;then bcp out from the view or using format file.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;8&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is lock escalation?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Lock escalation is the process of converting a lot of low level locks  (like row locks, page locks) into higher level locks (like table  locks).&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 141.75pt;" num="" width="47" height="189"&gt;9&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is optimistic locking?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;10&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;You have two tables a and b with column c1 in both of them. Column c1  in table a has values 1, 2 and 3 and the column in tables b has values 3, 4, 5.  How many rows would the following query return? select * from a, b where a.c1  &lt;&gt; b.c1&lt;br /&gt;&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;1 row&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;11&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is deffered update?&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;No Answer&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 141.75pt;" height="189"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 141.75pt;" num="" width="47" height="189"&gt;12&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference between Clustered and non clustered index on  performance wise?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;When you craete a clustered index on a table, all the rows in the  table are stored in the order of the clustered index key. So, there can be only  one clustered index per table. Non-clustered indexes have their own storage  separate from the table data storage. Non-clustered indexes are stored as B-tree  structures (so do clustered indexes), with the leaf level nodes having the index  key and it's row locater,clustered index is better for range queries,more  duplicates in table and non clustered for single row lookup.one clustered index  and 249 non clustered index.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;13&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Distribution page?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" str="server keeps distribution information for each index on a separate page in the datebase " width="400"&gt;server  keeps distribution information for each index on a separate page in the  datebase&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;14&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How shall I simulate from level 0 to level 3 in Isolation?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;using holdlock&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;15&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Why would we use stored procedures over triggers for  optimizing&lt;br /&gt;queries?&lt;br /&gt;&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;A trigger gets fired for every transaction. It is another overhead in  the query. Depending on how important the query is you can drop triggers and  write a store procedure for that. And at end of the day you can run that stored  procedure to perform the operations performed by the trigger.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;16&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is ceiling()?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Smallest integer greater than or equal to specified value&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;17&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the stored procedure to view current lock and processes  respectively?&lt;/td&gt; &lt;td class="xl28" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;sp_lock and sp_who&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 94.5pt;" num="" width="47" height="126"&gt;18&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is Rollback trigger in a Trigger?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;You can roll back triggers using either the rollback trigger statement  or the rollback transaction statement (if the trigger is fired as part of a  transaction). However, rollback trigger rolls back only the effect of the  trigger and the statement that caused the trigger to fire; rollback transaction  rolls back the entire transaction&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 252pt;" height="336"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 252pt;" num="" width="47" height="336"&gt;19&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the Drawbacks of Normalization?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Although most successful databases are normalized to some degree,  there is one substantial drawback of a normalized database: reduced database  performance. The acceptance of reduced performance requires the knowledge that  when a query or transaction request is sent to the database, there are factors  involved, such as CPU usage, memory usage, and input/output (I/O). To make a  long story short, a normalized database requires much more CPU, memory, and I/O  to process transactions and database queries than does a denormalized database.  A normalized database must locate the requested tables and then join the data  from the tables to either get the requested information or to process the  desired data. A more in-depth discussion concerning database performance occurs  in Hour 18, "Managing Database Users."&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;20&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;Write a query for selecting all persons with lastname  like'smith'(anycase)from a table?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;select name from table where name like " "&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;21&lt;/td&gt; &lt;td class="xl27" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;How do you delete the identity gaps in identity columns?&lt;/td&gt; &lt;td class="xl22" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;Set Identity ON and set identity value is NULL&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl25" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;22&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 309pt;" width="412"&gt;What is the difference in creating Temp table using select into and  create command?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 300pt;" width="400"&gt;select into will create with rows and it is faster ,create command  will create only table structure.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_7455.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T22:58:00-07:00"&gt;10:58  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=7396503694223019671"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=7396503694223019671"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="2852594074529235399"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_21.html"&gt;Sybase  Interview Questions and Answers III&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 532pt; border-collapse: collapse;" str="" width="708" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 32pt;" width="42"&gt; &lt;col style="width: 250pt;" span="2" width="333"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 22.5pt;" height="30"&gt; &lt;td class="xl24" style="width: 32pt; height: 22.5pt;" width="42" height="30"&gt;S.No&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 250pt;" width="333"&gt;Questions&lt;/td&gt; &lt;td class="xl24" style="border-left: medium none; width: 250pt;" width="333"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 12.75pt;" height="17"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 12.75pt;" width="42" height="17"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 12.75pt;" height="17"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 12.75pt;" num="" width="42" height="17"&gt;1&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="Display the name starts with small letters?                                 " width="333"&gt;Display  the name starts with small letters?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;select name from table where name like'[a-z]%'&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 25.5pt;" height="34"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 25.5pt;" num="" width="42" height="34"&gt;2&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Does datatypes listed in sysobjects?&lt;span&gt; &lt;/span&gt;a. Where it will be  stored?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;NO&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 129.75pt;" height="173"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 129.75pt;" num="" width="42" height="173"&gt;3&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="What is cascade delete in sybase?                                           a.What is the referential Integrity? " width="333"&gt;What  is cascade delete in sybase?&lt;span&gt; &lt;/span&gt;a.What is the referential  Integrity?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="In Sybase 11, triggers are needed to complement the declarative referential integrity constraints (foreign key) specifications only for referential integrity constraints associated with cascades, nullifies or multi-target delete rules. Sybase 11 trigger procedures generated from the OPM schema .SYB11; we show below only part of this file, namely the procedures associated with the relations representing object class " width="333"&gt;In  Sybase 11, triggers are needed to complement the declarative referential  integrity constraints (foreign key) specifications only for referential  integrity constraints associated with cascades, nullifies or multi-target delete  rules. Sybase 11 trigger procedures generated from the OPM schema .SYB11; we  show below only part of this file, namely the procedures associated with the  relations representing object class&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 51pt;" height="68"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 51pt;" num="" width="42" height="68"&gt;4&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Comapre exists and like?&lt;span&gt; &lt;/span&gt;a. What is the difference  between IN and Exists?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Like is used for Wildcards and it support the subqueries return single  value,Exists supports for subqueries return multi value as well as subqueries  can have multi column selection in it.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63.75pt;" height="85"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 63.75pt;" num="" width="42" height="85"&gt;5&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the difference between select into and insert?&lt;span&gt;  &lt;/span&gt;a.How do you create empty copy of an existing table ?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;select into used to create a new table dynamically and insert the rows  into the new table ,where insert used to insert the values into already exixting  table and it will log the details. Select&lt;span&gt; &lt;/span&gt;* into table1 from table2  where 1=2&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63.75pt;" height="85"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 63.75pt;" num="" width="42" height="85"&gt;6&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the use of creating view with check option?&lt;span&gt; &lt;/span&gt;a.  can I update view?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria yes,but view had created using only one  table&lt;span&gt; &lt;/span&gt;than update is possiable,If it is more than one we can update  with some restrictions.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 280.5pt;" height="374"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 280.5pt;" num="" width="42" height="374"&gt;7&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is stored procedures?&lt;span&gt; &lt;/span&gt;a. Why should I use stored  procedures?&lt;/td&gt; &lt;td class="xl25" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Security - you can revoke access to the base tables and only allow  users to access and manipulate the data via the stored  procedures.&lt;br /&gt;Performance - stored procedures are parsed and a query plan is  compiled. This information is stored in the system tables and it only has to be  done once.&lt;br /&gt;Network - if you have users who are on a WAN (slow connection)  having stored procedures will improve throughput because less bytes need to flow  down the wire from the client to ASE.&lt;br /&gt;Tuning - if you have all your SQL code  housed in the database, then it's easy to tune the stored procedure without  affecting the clients (unless of course the parameter change).&lt;br /&gt;Modularity -  during application development, the application designer can concentrate on the  front-end and the DB designer can concentrate on the ASE.&lt;br /&gt;Network latency -  a client on a LAN may seem slower if it is sending large numbers of separate  requests to a database server, bundling them into one procedure call may improve  responsiveness. Also, servers handling large numbers of small requests can spend  a surprising amount of CPU time performing network IO.&lt;br /&gt;Minimise blocks and  deadlocks - it is a lot easier to handle a deadlock if the entire transaction is  performed in one database request, also locks will be held for a shorter time,  improving concurrency and potentially reducing the number of deadlocks. Further,  it is easier to ensure that all tables are accessed in a consistent order if  code is stored centrally rather than dispersed among a number of  apps.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 25.5pt;" height="34"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 25.5pt;" num="" width="42" height="34"&gt;8&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is recursive SP ?&lt;span&gt; &lt;/span&gt;a. how it is differ from Nested  SP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Recursive Sp is Sp call by itself,Nested Sp is Sp call the another  SP&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 12.75pt;" height="17"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 12.75pt;" num="" width="42" height="17"&gt;9&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How do you display the information on a current login ?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;sp_login&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 25.5pt;" height="34"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 25.5pt;" num="" width="42" height="34"&gt;10&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;For cursor what is the possible values of @@sqlstatus?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;0-successful,1-error,2-no more rows to fetch&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 153pt;" height="204"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 153pt;" num="" width="42" height="204"&gt;11&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="Why we need Trigger?                                                                 a. Why would we use stored procedures over triggers for optimizing queries?                                                          " width="333"&gt;Why  we need Trigger?&lt;span&gt; &lt;/span&gt;a. Why would we use stored procedures over  triggers for optimizing queries?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Provide sophisticated auditing&lt;br /&gt;Prevent invalid  transactions&lt;br /&gt;Enforce referential integrity (either those actions not  supported by declarative integrity constraints or across nodes in a distributed  database)&lt;br /&gt;Enforce complex business rules&lt;br /&gt;Enforce complex security  authorizations&lt;br /&gt;Provide transparent event logging&lt;br /&gt;Automatically generate  derived column values&lt;br /&gt;Enable building complex views that are  updatable&lt;br /&gt;Track system events&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63.75pt;" height="85"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 63.75pt;" num="" width="42" height="85"&gt;12&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How do you force the optimizer to use the index for a table?&lt;span&gt;  &lt;/span&gt;a. What is Index Covering?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="you think that an index can be used to execute the query faster, you can force the optimizer to use the index by specifying the Index ID or Index name number after the table name in the query. SQL Server would use that index to satisfy the query. " width="333"&gt;you  think that an index can be used to execute the query faster, you can force the  optimizer to use the index by specifying the Index ID or Index name number after  the table name in the query. SQL Server would use that index to satisfy the  query.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 102pt;" height="136"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 102pt;" num="" width="42" height="136"&gt;13&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the advantage of table level over row level lock?&lt;span&gt;  &lt;/span&gt;a. What is the syntax for tabel level lock?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Larger log files (much larger in some cases). Binary log will contain  data for large statements that were rolled back.&lt;br /&gt;When using row-based  replication to replicate a statement (for example, an UPDATE or DELETE  statement), each changed row must be written to the binary log&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 38.25pt;" height="51"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 38.25pt;" num="" width="42" height="51"&gt;14&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What would be the status of sp_lock in a deadlock?&lt;span&gt; &lt;/span&gt;a.  What are the Transaction properties?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Transaction is aborted when a deadlock occurs,any locking information  that could be returned by sp_lock no longer is available for that  transaction.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 25.5pt;" height="34"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 25.5pt;" num="" width="42" height="34"&gt;15&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How would you transfer 1000 rows from 10000 rows using BCP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Using options -F and -L&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 216pt;" height="288"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 216pt;" num="" width="42" height="288"&gt;16&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is dirty read ?&lt;span&gt; &lt;/span&gt;How it is deffered from phantom  read?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;dirty reads. Such reads occur when one transaction modifies a row, and  a second transaction reads that row before the first transaction commits the  change. If the first transaction rolls back the change, the information read by  the second transaction becomes invalid&lt;br /&gt;Phantoms occur when one transaction  reads a set of rows that satisfy a search condition, and then a second  transaction modifies the data (through an insert, delete, update, and so on). If  the first transaction repeats the read with the same search conditions, it  obtains a different set&lt;br /&gt;of rows.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 25.5pt;" height="34"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 25.5pt;" num="" width="42" height="34"&gt;17&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What does deffered in the output of the show plan ?&lt;span&gt; &lt;/span&gt;a.  What is the defered Update?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" str="It means the optimizer goes for deffered update " width="333"&gt;It means the  optimizer goes for deffered update&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 38.25pt;" height="51"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 38.25pt;" num="" width="42" height="51"&gt;18&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;If you have to begin,commit and rollback tran in your query ,can you  create the temp table in that transaction?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 255pt;" height="340"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 255pt;" num="" width="42" height="340"&gt;19&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is Normalization?&lt;span&gt; &lt;/span&gt;a.Explain all the Rules?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;A database is said to be normalized if it complies with a set of  formal rules, referred to as normal forms. These formal rules define how data  that represents different entities should be organized in a database.&lt;br /&gt;First  Form:&lt;br /&gt;A table complies with the first normal form if no columns define  similar attributes and if no column contains multiple values.&lt;br /&gt;second  form:&lt;br /&gt;A table complies with the second normal form if it complies with the  first normal form, and if each column that is not part of the primary key  depends on all of the columns that are covered by the primary key in the table  and not on a subset of the columns that are covered by the primary key.&lt;br /&gt;Third  form:&lt;br /&gt;A database complies with the third normal form if it complies with the  second normal form and if, in each table, columns that are not covered by the  primary key do not depend on each other.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 51pt;" height="68"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 51pt;" num="" width="42" height="68"&gt;20&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the difference between stuff and Substring()?&lt;span&gt;  &lt;/span&gt;What is str()?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;stuff is used to replace one string inside the another string and  Index value start with 1,Substring is used for get some part of character from  the String and Index value start with 0.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 38.25pt;" height="51"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 38.25pt;" num="" width="42" height="51"&gt;21&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the performance issue on the following query,select  name,id,age,salary from emp where salary&lt;&gt;300 ,I have indexed the salary  column?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;since we have negative logic it goes for table scan,we have avoid this  by Index covering..&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 38.25pt;" height="51"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 38.25pt;" num="" width="42" height="51"&gt;22&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How will I get 2000 rows from 50000 rows from one database and put it  in another database&lt;span&gt; &lt;/span&gt;What is -T option in bcp?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;using BCP&lt;span&gt; &lt;/span&gt;instead of using select into command&lt;span&gt;  &lt;/span&gt;This is the size of text or image data,default size is 32KB&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 51pt;" height="68"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 51pt;" num="" width="42" height="68"&gt;23&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;You have table customer and order with cusid and ordid respectively  and cusid is also present in order table ,write a query to get all the customer  without order?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;select&lt;span&gt; &lt;/span&gt;name from customer where cusid not in(select cusid  from order)&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 124.5pt;" height="166"&gt; &lt;td class="xl22" style="border-top: medium none; width: 32pt; height: 124.5pt;" num="" width="42" height="166"&gt;24&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the Advantage of&lt;span&gt; &lt;/span&gt;System Procedures?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;To change data dictionary properties or manipulate data dictionary  objects (e.g., Tables, Referential Integrity, Advantage Extended Procedures,  etc.),System Procedures that can be used to manipulate data dictionary objects  using SQL&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_21.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T22:56:00-07:00"&gt;10:56  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=2852594074529235399"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=2852594074529235399"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="8133665968048153424"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers.html"&gt;Sybase  Interview Questions and Answers II&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 548pt; border-collapse: collapse;" str="" width="731" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 35pt;" width="47"&gt; &lt;col style="width: 255pt;" width="340"&gt; &lt;col style="width: 258pt;" width="344"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 21pt;" height="28"&gt; &lt;td class="xl25" style="width: 35pt; height: 21pt;" width="47" height="28"&gt;Sl.No&lt;/td&gt; &lt;td class="xl26" style="border-left: medium none; width: 255pt;" width="340"&gt;Questions&lt;/td&gt; &lt;td class="xl26" style="border-left: medium none; width: 258pt;" width="344"&gt;Answers&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl27" style="width: 35pt; height: 15.75pt;" width="47" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl28" style="border-left: medium none; width: 255pt;" width="340"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl28" style="border-left: medium none; width: 258pt;" width="344"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 126pt;" height="168"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 126pt;" num="" width="47" height="168"&gt;1&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Subquery and Correlated Subquery?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="Sub query : A select statement that is nested inside another select, insert, update or delete statement, or inside another subquery. Correlated subquery: A subquery that cannot be evaluated independently, but that depends on the outer query for its results. Also called a repeating subquery, since  the subquery is executed once for each row that might be selected by the    outer query. " width="344"&gt;Sub  query : A select statement that is nested inside another select, insert, update  or delete statement, or inside another subquery.&lt;br /&gt;Correlated subquery: A  subquery that cannot be evaluated independently, but that depends on the outer  query for its results. Also called a repeating subquery, since&lt;span&gt; &lt;/span&gt;the  subquery is executed once for each row that might be selected by the&lt;span&gt;  &lt;/span&gt;outer query.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;2&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is the use of creating view with check option?&lt;span&gt; &lt;/span&gt;B)  Can I drop a View?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria&lt;span&gt; &lt;/span&gt;B)yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;3&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)Explain about @@sqlstatus?&lt;span&gt; &lt;/span&gt;B)What are possiable value  of @@sqlstatus?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)It returns the status of the pervious fetch statement in a cursor  B)0,1,2&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;4&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is the performance issue on&lt;span&gt; &lt;/span&gt;CURSOR?&lt;span&gt;  &lt;/span&gt;B)What are the steps involed in creating the cursor?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)Each time you fetch a row from the cursor,it results in a network  roundtrip, where as a normal SELECT query makes only one rowundtrip, however  large the resultset is. Cursors are also costly because they require more  resources and temporary storage (results in more IO operations). Furthere, there  are restrictions on the SELECT statements that can be used with some types of  cursors.Most of the times, set based operations can be used instead of  cursors.&lt;br /&gt;B)Declaring cursors,declaring variables,opening cursors,fetching  rows,main loop,closing the cursor,deallocating cursors&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;5&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What are the Properties of Transaction?&lt;span&gt; &lt;/span&gt;B)What&lt;span&gt;  &lt;/span&gt;are the modes of transaction ?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)server maintain transaction log,server locks table pages during  transaction,server performs automatic recovery upon restart ,transaction control  statement B)Chained and Unchained&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;6&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How will bcp out the Identity column?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;-E&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;7&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A) What are the two modes in BCP?&lt;span&gt; &lt;/span&gt;B)Explain&lt;span&gt;  &lt;/span&gt;about how to achive fast BCP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;B)Table does'nt have indexes and trigger and we have to set select  into bulk copy&lt;span&gt; &lt;/span&gt;option for the particular database&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;8&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Can I transfer table syntax from database to flat file using  defncopy?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="No ,It can be done using isql " width="344"&gt;No ,It can be done using  isql&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;9&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is lock escalation?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Lock escalation is the process of converting a lot of low level locks  (like row locks, page locks) into higher level locks (like table  locks).&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;10&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is optimistic locking?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Optimistic index locking does not acquire an address lock on the root  page of an index during normal data manipulation language operations (DML). If  your updates and inserts can cause modifications to the root page of the  accessed index, optimistic index locking restarts the search and acquires an  exclusive table lock, not an address lock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;11&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Checkpoint?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;The point at which all data pages that have been changed are  guaranteed to have been written to the database device.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 135pt;" height="180"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 135pt;" num="" width="47" height="180"&gt;12&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" str="There's a performance issue What will be your very first step towards the solution? " width="340"&gt;There's  a performance issue What will be your very first step towards the  solution?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;I will run the Update Sataiscis and&lt;span&gt; &lt;/span&gt;you need to identify  which query is creating the problem and than to identify where the problem lies  in that query. Query that is taking maximum time is the first you want to  consider for the optimization. To check which query is taking maximum time to  execute place getdate() both before and after the query. Identity the type of  the query whether it is a data look-up query, or data modification  query.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 189pt;" num="" width="47" height="252"&gt;13&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" str="A)What is Phantom Reads?                                                                 " width="340"&gt;A)What  is Phantom Reads?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)when one transaction reads a set of rows that satisfy a search  condition, and then a second transaction modifies the data (through an insert,  delete, update, and so on). If the first transaction repeats the read with the  same search conditions, it obtains a different set of rows.&lt;br /&gt;B) Such reads  occur when one transaction reads a row and a second transaction modifies that  row. If the second transaction commits its change, subsequent reads by the first  transaction yield different results than the original read.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 176.25pt;" height="235"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 176.25pt;" num="" width="47" height="235"&gt;14&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Join and SubQuery in performance?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Generally Join queries consume more memory than sub query. Sub query  in turn involve intermediate table creation so affects performance, because of  high I/Os fetches need for processing. If the RAM memory is more, then the Joins  can be used instead of sub queries. Under memory constraints we can go for sub  queries.Sometimes sub queries are flattened to join to improve the performance.  Also making the outer query to compare inner query with equality option can  materialize the subquery.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;15&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is datediff?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="return the date difference accordding to the  datapart " width="344"&gt;return  the date difference accordding to the&lt;span&gt; &lt;/span&gt;datapart&lt;span&gt;  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;16&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is the system procedure to view current lock and processes  respectively?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;sp_lock and sp_who&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;17&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare not IN and not EXISTS?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;IN allow duplicate values and sub query have one column,EXISTS not  allow duplicates and inner query can have multi columns&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;18&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What is Rollback trigger ?&lt;span&gt; &lt;/span&gt;B) how it is differ from  Rollback transaction?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;You can roll back triggers using either the rollback trigger statement  or the rollback transaction statement (if the trigger is fired as part of a  transaction). However, rollback trigger rolls back only the effect of the  trigger and the statement that caused the trigger to fire; rollback transaction  rolls back the entire transaction&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 78.75pt;" height="105"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 78.75pt;" num="" width="47" height="105"&gt;19&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A)What happen when we delete the table using Trigger?&lt;span&gt; &lt;/span&gt;B)  What are the limitation of Trigger?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A)The delete row will&lt;span&gt; &lt;/span&gt;entered into the Deleted table  inside the trigger&lt;span&gt; &lt;/span&gt;B ) any create commond,drop command,alter  table,grant,revoke,select into,truncate,update statistics are not permitted in  trigger&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 206.25pt;" height="275"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 206.25pt;" num="" width="47" height="275"&gt;20&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is the Drawbacks of Normalization?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Although most successful databases are normalized to some degree,  there is one substantial drawback of a normalized database: reduced database  performance. The acceptance of reduced performance requires the knowledge that  when a query or transaction request is sent to the database, there are factors  involved, such as CPU usage, memory usage, and input/output (I/O). To make a  long story short, a normalized database requires much more CPU, memory, and I/O  to process transactions and database queries than does a denormalized database.  A normalized database must locate the requested tables and then join the data  from the tables to either get the requested information or to process the  desired data.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;21&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do you call the remote SP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;severname.database.owner.Spname&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;22&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Compare Truncate and Delete?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;DELETE TABLE is a logged operation, so the deletion of each row gets  logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes  all the rows in a table, but it won't log the deletion of each row, instead it  logs the deallocation of the data pages of the table, which makes it faster. Of  course, TRUNCATE TABLE can be rolled back.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;23&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Explain&lt;span&gt; &lt;/span&gt;sp_recompile?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Sp_recompile is used when updated statistics have been updated on the  table and when an index has been added to a table that you want the optimizer to  consider to generate new query plan for the SP&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;24&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Sp_dboption?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;It is used to enable or diable option for database&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;25&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Write a query for selecting all persons with lastname like  'smith'(anycase)from a table?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;select lastname from table where lastname like&lt;span&gt;  &lt;/span&gt;'%[Ss][Mm][Ii][Tt][Hh]%'&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;26&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;Given two tables A and B having 3 and 2 columns respectively,If I run  select * from A,B what will be the number of rows?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;Cartiesan product&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 31.5pt;" num="" width="47" height="42"&gt;27&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is&lt;span&gt; &lt;/span&gt;money and smallmoney?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;it is exact datatye with four digit decimal precision ,money with 8  bytes and small money with 4 bytes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 63pt;" num="" width="47" height="84"&gt;28&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is recursive SP?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" str="you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. " width="344"&gt;you  can write stored procedures that call themselves. Recursion can be defined as a  method of problem solving wherein the solution is arrived at by repetitively  applying it to subsets of the problem.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;29&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is system procedure related with syskeys?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;sp_primarykey,sp_commonkey&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;30&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do you list out all the indexes in a database?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;sp_helpindexes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 15.75pt;" num="" width="47" height="21"&gt;31&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;How do I get the current database name?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;db_name()&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 110.25pt;" height="147"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 110.25pt;" num="" width="47" height="147"&gt;32&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;What is Demand lock and Dead lock?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A deadlock occurs when there is a cyclic dependency between two or  more transactions for the same set of resources.&lt;span&gt; &lt;/span&gt;Demand Lock:A  demand lock prevents any more shared locks from being set on a data resource  (table or data page). Any new shared lock request has to wait for the demand  lock request to finish.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 257.25pt;" height="343"&gt; &lt;td class="xl22" style="border-top: medium none; width: 35pt; height: 257.25pt;" num="" width="47" height="343"&gt;33&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 255pt;" width="340"&gt;A) What are two types of Index?&lt;span&gt; &lt;/span&gt;B)Explain Index and  Performance?&lt;/td&gt; &lt;td class="xl23" style="border-top: medium none; border-left: medium none; width: 258pt;" width="344"&gt;A) Clustered and Non Clustered Index&lt;span&gt; &lt;/span&gt;B)Clustered index  not reusing available space on preceding pages which makes pages grow longer and  the search takes long time to complete. It is better to use cluster index for  data value that is somewhat randomly distributed throughout the  table.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;In non-cluster point of view, first check the impact on  the performance of OLTP environment for addition of non-clustered index. It is  better to use non-cluster where low number of duplicates are present. It is good  for large number of duplicate values. It is more effective if less than 10 to  20% of data is to be accessed through non clustered. Non-clustered is useful for  single row lookups, joins, queries on columns that are highly selective and for  queries with small range retrievals&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl30" style="border-top: medium none; width: 35pt; height: 47.25pt;" num="" width="47" height="63"&gt;34&lt;/td&gt; &lt;td class="xl31" style="border-top: medium none; border-left: medium none; width: 255pt;" str="What is bit datatype ? " width="340"&gt;What is bit datatype ?&lt;span&gt;  &lt;/span&gt;&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 258pt;" str="Bit datatype is used to store boolean information like 1 or 0 (true or false). and there was no support for NULL. " width="344"&gt;Bit  datatype is used to store boolean information like 1 or 0 (true or false). and  there was no support for NULL.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/sybase-interview-questions-and-answers.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T22:53:00-07:00"&gt;10:53  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=8133665968048153424"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=8133665968048153424"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="1105077650129418095"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/cybase-interview-questions-and-answers.html"&gt;Cybase  Interview Questions and Answers&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;table style="width: 622pt; border-collapse: collapse;" str="" width="828" border="0" cellpadding="0" cellspacing="0"&gt; &lt;colgroup&gt; &lt;col style="width: 32pt;" width="42"&gt; &lt;col style="width: 250pt;" width="333"&gt; &lt;col style="width: 340pt;" width="453"&gt; &lt;/colgroup&gt;&lt;tbody&gt; &lt;tr style="height: 22.5pt;" height="30"&gt; &lt;td class="xl25" style="width: 32pt; height: 22.5pt;" width="42" height="30"&gt;S.No&lt;/td&gt; &lt;td class="xl26" style="border-left: medium none; width: 250pt;" width="333"&gt;Questions&lt;/td&gt; &lt;td class="xl27" style="border-left: medium none; width: 340pt;" width="453"&gt;Answer&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 15.75pt;" width="42" height="21"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 15.75pt;" height="21"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 15.75pt;" num="" width="42" height="21"&gt;1&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" str="Display the name starts with small letters?                                 " width="333"&gt;Display  the name starts with small letters?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl30" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;2&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Does datatypes listed in sysobjects?&lt;span&gt; &lt;/span&gt;a. Where it will be  stored?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 129.75pt;" height="173"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 129.75pt;" num="" width="42" height="173"&gt;3&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" str="What is cascade delete in sybase?                                           a.What is the referential Integrity? " width="333"&gt;What  is cascade delete in sybase?&lt;span&gt; &lt;/span&gt;a.What is the referential  Integrity?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;In Sybase 11, triggers are needed to complement the declarative  referential integrity constraints (foreign key) specifications only for  referential integrity constraints associated with cascades, nullifies or  multi-target delete rules. Sybase 11 trigger procedures generated from the OPM  schema .SYB11; we show below only part of this file, namely the procedures  associated with the relations representing object class&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;4&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;Comapre exists and like?&lt;span&gt; &lt;/span&gt;a. What is the difference  between IN and Exists?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Like is used for Wildcards and it support the subqueries return single  value,Exists supports for subqueries return multi value as well as subqueries  can have multi column selection in it.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 63pt;" num="" width="42" height="84"&gt;5&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the difference between select into and insert?&lt;span&gt;  &lt;/span&gt;a.How do you create empty copy of an existing table ?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;select into used to create a new table dynamically and insert the rows  into the new table ,where insert used to insert the values into already exixting  table and it will log the details. Select&lt;span&gt; &lt;/span&gt;* into table1 from table2  where 1=2&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 63pt;" num="" width="42" height="84"&gt;6&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the use of creating view with check option?&lt;span&gt; &lt;/span&gt;a.  can I update view?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Check flag prevent insertion or updation of a rows that will  subsequently not meet the view criteria yes,but view had created using only one  table&lt;span&gt; &lt;/span&gt;than update is possiable,If it is more than one we can update  with some restrictions.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 283.5pt;" height="378"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 283.5pt;" num="" width="42" height="378"&gt;7&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is stored procedures?&lt;span&gt; &lt;/span&gt;a. Why should I use stored  procedures?&lt;/td&gt; &lt;td class="xl30" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Security - you can revoke access to the base tables and only allow  users to access and manipulate the data via the stored  procedures.&lt;br /&gt;Performance - stored procedures are parsed and a query plan is  compiled. This information is stored in the system tables and it only has to be  done once.&lt;br /&gt;Network - if you have users who are on a WAN (slow connection)  having stored procedures will improve throughput because less bytes need to flow  down the wire from the client to ASE.&lt;br /&gt;Tuning - if you have all your SQL code  housed in the database, then it's easy to tune the stored procedure without  affecting the clients (unless of course the parameter change).&lt;br /&gt;Modularity -  during application development, the application designer can concentrate on the  front-end and the DB designer can concentrate on the ASE.&lt;br /&gt;Network latency -  a client on a LAN may seem slower if it is sending large numbers of separate  requests to a database server, bundling them into one procedure call may improve  responsiveness. Also, servers handling large numbers of small requests can spend  a surprising amount of CPU time performing network IO.&lt;br /&gt;Minimise blocks and  deadlocks - it is a lot easier to handle a deadlock if the entire transaction is  performed in one database request, also locks will be held for a shorter time,  improving concurrency and potentially reducing the number of deadlocks. Further,  it is easier to ensure that all tables are accessed in a consistent order if  code is stored centrally rather than dispersed among a number of  apps.&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;8&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is recursive SP ?&lt;span&gt; &lt;/span&gt;a. how it is differ from Nested  SP?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Recursive Sp is Sp call by itself,Nested Sp is Sp call the another  SP&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;9&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How do you display the information on a current login ?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;10&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;For cursor what is the possible values of @@sqlstatus?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;0-successful,1-error,2-no more rows to fetch&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 189pt;" height="252"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 189pt;" num="" width="42" height="252"&gt;11&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" str="Why we need Trigger?                                                                 a. Why would we use stored procedures over triggers for optimizing queries?                                                          " width="333"&gt;Why  we need Trigger?&lt;span&gt; &lt;/span&gt;a. Why would we use stored procedures over  triggers for optimizing queries?&lt;span&gt; &lt;/span&gt;&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Provide sophisticated auditing&lt;br /&gt;Prevent invalid  transactions&lt;br /&gt;Enforce referential integrity (either those actions not  supported by declarative integrity constraints or across nodes in a distributed  database)&lt;br /&gt;Enforce complex business rules&lt;br /&gt;Enforce complex security  authorizations&lt;br /&gt;Provide transparent event logging&lt;br /&gt;Automatically generate  derived column values&lt;br /&gt;Enable building complex views that are  updatable&lt;br /&gt;Track system events&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 63pt;" num="" width="42" height="84"&gt;12&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How do you force the optimizer to use the index for a table?&lt;span&gt;  &lt;/span&gt;a. What is Index Covering?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" str="you think that an index can be used to execute the query faster, you can force the optimizer to use the index by specifying the Index ID or Index name number after the table name in the query. SQL Server would use that index to satisfy the query. " width="453"&gt;you  think that an index can be used to execute the query faster, you can force the  optimizer to use the index by specifying the Index ID or Index name number after  the table name in the query. SQL Server would use that index to satisfy the  query.&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 94.5pt;" height="126"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 94.5pt;" num="" width="42" height="126"&gt;13&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the advantage of table level over row level lock?&lt;span&gt;  &lt;/span&gt;a. What is the syntax for tabel level lock?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Larger log files (much larger in some cases). Binary log will contain  data for large statements that were rolled back.&lt;br /&gt;When using row-based  replication to replicate a statement (for example, an UPDATE or DELETE  statement), each changed row must be written to the binary log&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;14&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What would be the status of sp_lock in a deadlock?&lt;span&gt; &lt;/span&gt;a.  What are the Transaction properties?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Transaction is aborted when a deadlock occurs,any locking information  that could be returned by sp_lock no longer is available for that  transaction.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;15&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How would you transfer 1000 rows from 10000 rows using BCP?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;Using options -F and -L&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 216pt;" height="288"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 216pt;" num="" width="42" height="288"&gt;16&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is dirty read ?&lt;span&gt; &lt;/span&gt;How it is deffered from phantom  read?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;dirty reads. Such reads occur when one transaction modifies a row, and  a second transaction reads that row before the first transaction commits the  change. If the first transaction rolls back the change, the information read by  the second transaction becomes invalid&lt;br /&gt;Phantoms occur when one transaction  reads a set of rows that satisfy a search condition, and then a second  transaction modifies the data (through an insert, delete, update, and so on). If  the first transaction repeats the read with the same search conditions, it  obtains a different set&lt;br /&gt;of rows.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 31.5pt;" height="42"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 31.5pt;" num="" width="42" height="42"&gt;17&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What does deffered in the output of the show plan ?&lt;span&gt; &lt;/span&gt;a.  What is the defered Update?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" str="It means the optimizer goes for deffered update " width="453"&gt;It means the  optimizer goes for deffered update&lt;span&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;18&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;If you have to begin,commit and rollback tran in your query ,can you  create the temp table in that transaction?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;yes&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 252pt;" height="336"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 252pt;" num="" width="42" height="336"&gt;19&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is Normalization?&lt;span&gt; &lt;/span&gt;a.Explain all the Rules?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;A database is said to be normalized if it complies with a set of  formal rules, referred to as normal forms. These formal rules define how data  that represents different entities should be organized in a database.&lt;br /&gt;First  Form:&lt;br /&gt;A table complies with the first normal form if no columns define  similar attributes and if no column contains multiple values.&lt;br /&gt;second  form:&lt;br /&gt;A table complies with the second normal form if it complies with the  first normal form, and if each column that is not part of the primary key  depends on all of the columns that are covered by the primary key in the table  and not on a subset of the columns that are covered by the primary key.&lt;br /&gt;Third  form:&lt;br /&gt;A database complies with the third normal form if it complies with the  second normal form and if, in each table, columns that are not covered by the  primary key do not depend on each other.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;20&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the difference between stuff and Substring()?&lt;span&gt;  &lt;/span&gt;What is str()?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;stuff is used to replace one string inside the another string and  Index value start with 1,Substring is used for get some part of character from  the String and Index value start with 0.&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;21&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the performance issue on the following query,select  name,id,age,salary from emp where salary&lt;&gt;300 ,I have indexed the salary  column?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;other than 300&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 47.25pt;" height="63"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 47.25pt;" num="" width="42" height="63"&gt;22&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;How will I get 2000 rows from 50000 rows from one database and put it  in another database&lt;span&gt; &lt;/span&gt;What is -T option in bcp?&lt;/td&gt; &lt;td class="xl29" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;using BCP&lt;span&gt; &lt;/span&gt;instead of using select into command&lt;span&gt;  &lt;/span&gt;This is the size of text or image data,default size is 32KB&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 63pt;" height="84"&gt; &lt;td class="xl28" style="border-top: medium none; width: 32pt; height: 63pt;" num="" width="42" height="84"&gt;23&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;You have table customer and order with cusid and ordid respectively  and cusid is also present in order table ,write a query to get all the customer  without order?&lt;/td&gt; &lt;td class="xl24" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;select&lt;span&gt; &lt;/span&gt;name from customer where cusid not in(select cusid  from order)&lt;/td&gt;&lt;/tr&gt; &lt;tr style="height: 124.5pt;" height="166"&gt; &lt;td class="xl31" style="border-top: medium none; width: 32pt; height: 124.5pt;" num="" width="42" height="166"&gt;24&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 250pt;" width="333"&gt;What is the Advantage of&lt;span&gt; &lt;/span&gt;System Procedures?&lt;/td&gt; &lt;td class="xl32" style="border-top: medium none; border-left: medium none; width: 340pt;" width="453"&gt;To change data dictionary properties or manipulate data dictionary  objects (e.g., Tables, Referential Integrity, Advantage Extended Procedures,  etc.),System Procedures that can be used to manipulate data dictionary objects  using SQL&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="post-footer"&gt; &lt;div class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-author vcard"&gt;Posted by &lt;span class="fn"&gt;blogguru&lt;/span&gt; &lt;/span&gt;&lt;span class="post-timestamp"&gt;at &lt;a class="timestamp-link" title="permanent link" href="http://all-faqs.blogspot.com/2008/07/cybase-interview-questions-and-answers.html" rel="bookmark"&gt;&lt;abbr class="published" title="2008-07-21T22:51:00-07:00"&gt;10:51  PM&lt;/abbr&gt;&lt;/a&gt; &lt;/span&gt;&lt;span class="post-comment-link"&gt;&lt;a class="comment-link" onclick="" href="comment.g?blogID=1189550843890972872&amp;amp;postID=1105077650129418095"&gt;0  comments&lt;/a&gt; &lt;/span&gt;&lt;span class="post-icons"&gt;&lt;span class="item-control blog-admin pid-1676471902"&gt;&lt;a title="Edit Post" href="post-edit.g?blogID=1189550843890972872&amp;amp;postID=1105077650129418095"&gt;&lt;img class="icon-action" alt="" src="img/icon18_edit_allbkg.gif" /&gt;  &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="post hentry"&gt;&lt;a name="5000502730053460617"&gt;&lt;/a&gt; &lt;h3 class="post-title entry-title"&gt;&lt;a href="http://all-faqs.blogspot.com/2008/07/soap-simple-object-access-protocol.html"&gt;SOAP  (Simple Object Access Protocol) Interview Questions and FAQ's&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; &lt;meta content="text/html; charset=utf-8" equiv="Content-Type"&gt; &lt;meta content="Word.Document" name="ProgId"&gt; &lt;meta content="Microsoft Word 11" name="Generator"&gt; &lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;o:smarttagtype name="City" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt; &lt;object id="ieooui" classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt;  &lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:ËÎÌå; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-alt:Verdana; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:536871559 0 0 0 415 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} @page Section1 	{size:8.5in 11.0in; 	margin:.6in .6in .6in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;br /&gt;SOAP was originally developed  by Microsoft, IBM, DevelopMentor and Userland Software and was then submitted to  the Internet Engineering Task Force (IETF), who eventually made it an official  recommendation. Though Microsoft camp seem to have played a major role in  defining the specification of SOAP.&lt;br /&gt;&lt;br /&gt;The motivation of developing this  protocol was the widely used inter-application communication protocols like  Microsoft’s DCOM protocol or Java’s RMI or OMG’s IIOP protocols which have till  recent times fulfilled the needs of giving component services over an  interconnected network .The richness of these protocols helped them gain a  strong hold over distributed computing over controlled environment. Almost all  these protocols need a smart client able to run the proxies of the server  components; moreover, these protocols reveal their limitations when it comes to  &lt;b&gt;INTERNET&lt;/b&gt;. Internet cannot guarantee what kind of client and server will  be operating at either end of the connection — it can only guarantee that they  are both communicating via HTTP.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SOAP (Simple Object Access  Protocol)&lt;/b&gt; is a simple solution for interaction of different applications  built in different languages and running on different platforms as it uses HTTP  as its transport and XML as its payload for sending and receiving messages. It’s  a lightweight and a loosely coupled protocol for exchange of information in a  decentralized and a distributed environment.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What’s so light in  SOAP?&lt;/b&gt;&lt;br /&gt;Soap relies on HTTP as a transport mechanism to send XML based  messages, the messages are packed in what is called a SOAP envelop and send to  the server to process in a Request/Response fashion. SOAP unlike proprietary  protocols like DCOM or RMI does not require strong connection between client and  the server and the SOAP messages are sting based messages passed from the Client  to Server and vice versa in the form of SOAP envelops.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What makes  SOAP loosely coupled?&lt;/b&gt;&lt;br /&gt;Most proprietary protocols require the  applications of the same breed to be running on both the ends, what if the  server is implemented in a different programming language. The ability to access  service of a component in a language/location and platform transparent manner  reduces the tight coupling between the client and the server. SOAP enables  “incompatible” systems to interoperate.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;How does SOAP Message look  like and How is it different from a method invoked on a Object?&lt;/b&gt;&lt;br /&gt;To  demonstrate how SOAP messages are different from method invocation on an  component Let’s take a look at this ActiveX component, which accepts two  integers and returns the total, as a return value would look something like  this,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Server ActiveX Component (MyComponent.MathComponent)&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;Public Function Add (Num1 as integer, Num2 as integer)&lt;br /&gt;Add = Num1 +  Num2&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;The Client would create an instance of this  component and would invoke the method to get the total.&lt;br /&gt;&lt;br /&gt;Sub  Button1_click()&lt;br /&gt;Dim objAdd as new MyComponent.MathComponent&lt;br /&gt;Dim  intResult as integer&lt;br /&gt;intResult = objAdd.Add(10,20)&lt;br /&gt;end sub&lt;br /&gt;&lt;br /&gt;This  MyComponent.MathComponent would get instantiated and serve the request from the  client application.&lt;br /&gt;At a higher level a SOAP request to fulfill this request  would look something like this&lt;br /&gt;&lt;add&gt;&lt;br /&gt;&lt;num1&gt;100&lt;/num1&gt; &lt;br /&gt;&lt;num2&gt;400&lt;/num2&gt;&lt;br /&gt;&lt;/add&gt;&lt;br /&gt;&lt;br /&gt;In order to ensure that server can  correctly identify the method call it is wrapped up in a SOAP envelop &lt;br /&gt;&lt;br /&gt;&lt;soap:envelop soap="”urn:schemas-xmlsoap-org-soap.v1”"&gt;&lt;br /&gt;&lt;soap:header&gt;&lt;/soap:header&gt;&lt;br /&gt;&lt;soap:body&gt;&lt;br /&gt;&lt;add&gt;&lt;br /&gt;&lt;num1&gt;100&lt;/num1&gt; &lt;br /&gt;&lt;num2&gt;400&lt;/num2&gt;&lt;br /&gt;&lt;/add&gt;&lt;br /&gt;&lt;soap:body&gt;&lt;br /&gt;&lt;/soap:body&gt;&lt;br /&gt;&lt;br /&gt;This is  just an abstract example to give you a gist of the SOAP message.&lt;br /&gt;The real  SOAP message will contain more information like the component name and stuff. &lt;br /&gt;This message is sent to a SOAP listener through HTTP in a Request/Response  fashion.&lt;br /&gt;The SOAP Listener accepts this SOAP message and does the processing  on the component and returns the SOAP message back for the client.&lt;br /&gt;&lt;br /&gt;In  the Server you will need to implement a SOAP listener, wsdlgen.exe is a tool  which comes with the SOAP Toolkit will create a SOAP listener and a WSDL (Web  Service description Language) file for a given COM Component. For more  information on WSDL visit http://www.msdn.microsoft.com/xml/general/wsdl.asp &lt;br /&gt;&lt;br /&gt;&lt;b&gt;OH GODDDDDDDD, do I need to &lt;st1:place st="on"&gt;&lt;st1:city st="on"&gt;Marshall&lt;/st1:city&gt;&lt;/st1:place&gt; and UN-Marshall the XML messages  myself?&lt;/b&gt;&lt;br /&gt;The answer is NO, The Microsoft SOAP Toolkit 2 will take care of  the marshaling and UN-marshaling of the XML messages behind the scene for you. &lt;br /&gt;The SOAP Toolkit also comes with a set of COM Component to access SOAP Web  Services easily, Visual Basic SOAP client&lt;br /&gt;Sub Button1_click()&lt;br /&gt;Dim  objSOAPClient As Object&lt;br /&gt;Set objSOAPClient =  CreateObject("MSSOAP.SoapClient")&lt;br /&gt;objSOAPClient.mssoapinit  "http://ServerName/VirtualDirectory/wsdlfile.WSDL"&lt;br /&gt;MsgBox  objSOAPClient.Add(100,400)&lt;br /&gt;End sub&lt;br /&gt;That’s it, the SOAP message  marshaling and UN-marshaling will taken care by the SOAP client and what you  will get is the result.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SOAP and Security&lt;/b&gt;&lt;br /&gt;SOAP as it works on  HTTP get the benefits of all the security that are currently available to HTTP,  a SOAP message can pass through the firewall of the web server normally from  port 80.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Limitations of SOAP&lt;/b&gt;&lt;br /&gt;Though SOAP is evolving, and has  a number of striking features, which are important in development of,  distributed applications but still there are certain things which SOAP cannot  support which I would like to address&lt;br /&gt;SOAP is a simple protocol: As the name  suggests it’s a simple protocol and works on HTTP, we cannot expect all the  functionality’s offered by other protocols like DCOM or RMI.&lt;br /&gt;SOAP may turn  out to be slower compared to other proprietary protocols as it requires  additional XML processing.&lt;br /&gt;Still SOAP fares well in most areas compared to  other wire protocol. As per the specifications, SOAP can also use other  transport carrier like SMTP to transmit SOAP messages. Still lot of information  on this topic in not available.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br /&gt;SOAP is a compelling  and innovative use of available technologies that are not tied to a specific  vendor. SOAP will play a major role in Microsoft’s “.NET” platform for building  WebService. And Microsoft is expecting huge revenue to be generated from  WebService&lt;/soap:body&gt;&lt;/soap:envelop&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-1658946498699821874?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/1658946498699821874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=1658946498699821874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1658946498699821874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/1658946498699821874'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/07/sybase-interview-questions-and-answers_23.html' title='Sybase Interview Questions and Answers '/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-7910855389576726440</id><published>2008-07-23T01:29:00.001-07:00</published><updated>2008-12-22T20:21:59.689-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview Question&apos;s'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Sybase Questions set</title><content type='html'>&lt;table str="" style="border-collapse: collapse; width: 421pt;" width="561" border="0" cellpadding="0" cellspacing="0"&gt;&lt;col style="width: 421pt;" width="561"&gt;  &lt;tbody&gt;&lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl28" style="height: 12.75pt; width: 421pt;" width="561" height="17"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 36.75pt;" height="49"&gt;   &lt;td class="xl22" style="height: 36.75pt; width: 421pt;" width="561" height="49"&gt;Questions&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;What happens to data when a clustered index is created? What   happens if non-clustered index is created?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 47.25pt;" height="63"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 47.25pt; width: 421pt;" width="561" height="63"&gt;There is non-clustered index on a table.I create a clustred   index on the same table without dropping the non-clustred index.what will   happen to the data?Wether one index affect the other?why?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you force the omptimizer to use the index for a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the difference between clustered and Non clustered   index?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Can you tell me the scenarios when you used the two types of   index ?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the different types of Indexes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;There is an index on lname and another index on(lname,fname) in   a table .if we write a query to select lname like 'smith' which index will be   used if it is used?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you add an index to a column?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the difference between primary key and indexes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How many clustered and non clustered index on a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to sort data in a table in a table without using order by   and without using indexes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How many indexes can you have in a table and in a column?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Can you create indexes on temporary tables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;Consider in table1 -empid has numeric value and table2 -empid   have int value&lt;span style=""&gt;  &lt;/span&gt;if there is query that   joins the two tables which indexes will be used and why?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the use of clustered and non clustered index?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you list out all the indexes on a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;Suppose an index has a composite key(a,b,c,d) and we do a select   on b and c will it use the index?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How many index a table can have?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is pros and cons of indexes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Give me the advantage and disadvantage of forcing the index?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Why index are used in select query what is the reasons?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;If you have an index on five column do you have to specify all   the five in where clause?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;I have a query using 'like' to search on a column ,The table   having 10 million rows ,which index should I have on that column to optimise   my search?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 47.25pt;" height="63"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 47.25pt; width: 421pt;" width="561" height="63"&gt;A table contains EmpId ,name,dept and gender there are two   indexes namely on(dept,gender) and (gender,dept) now you write a query select   * from table where dept=" " and gender="" which index   would it take and when?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;You have table with column just contain value like 'male' or   'female' ,what index would you apply and why?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 29.25pt;" height="39"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 29.25pt; width: 421pt;" width="561" height="39"&gt;How would you implement a merge sort in indexes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="border-top: medium none; height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Trigger&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt; &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is a Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How many trigger can you have on a table? What are they?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;You are inserting a million rows into a table having an insert   trigger .will the trigger execute a million times?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are magic table and where are they accesiable?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you create a Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the different types of Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Why we need Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How Trigger checks for a particular data update?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the Trigger advantage and disadvantage?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do find how many rows are deleted using delete command?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Explain the Trigger in a Update scenario?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What happen if you create delete trigger on a table which have   aleady delete trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to find out trigger on tables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to get program listing of trigger on a tables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Why do we need Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Compare truncate and trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are he trigger upper limits on a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Which one will fire first trigger or Referential integrity?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the difference between Trigger and Cursors?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the limitation on Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="border-top: medium none; height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Global Variables&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt; &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the different global variables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;For cursor what is the possible values of @@sqlstatus?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you get the version of the sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you view only top 30 rows of the table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is @@identity?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl26" style="border-top: medium none; height: 20.25pt;" height="27"&gt;System Stored   Procedures&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is sp_helpdb,sp_helpindex?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is sp_who?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl27" style="border-top: medium none; height: 15.75pt;" height="21"&gt;How do you   check the text of the SP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl27" style="border-top: medium none; height: 15.75pt;" height="21"&gt;How do you   find the size of the database in sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl27" style="border-top: medium none; height: 15.75pt;" height="21"&gt;What is   sp_dboption?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl28" style="height: 12.75pt;" height="17"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Sybase   Tools&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the types of BCP?Explain their difference?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;How can I select the first 500 rows from a table having million   rows &amp;amp; generate a flat file?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Is the trigger fires during BCP in?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;There is delete trigger on a table and there is no indexes   wether server use fastbcp or slowbcp?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Is it possible to lookup the missing data before loading&lt;span style=""&gt;  &lt;/span&gt;it into sybase tables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What sort of checks can be done in BCP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do handle error in BCP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you upload the data?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How would you transfer certain number of rows from table to   file?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How data validation works before bcp?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;In which case fast bcp occurs?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;which one of the following gets fired when you do a bcp into a   table from a file?defaults,rules,trigger,constraints?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the option for identity column in bcp?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What steps did you take to tune the BCP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;When should we use BCP and Insert statements to modify table ?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you send a selected rows into a file?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;In bcp how would I specify that only one error is allowed?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;In bcp how would I specify that commit size?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How would you transfer 1000 rows from 10000 rows using BCP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you do fast bcp with trigger and indexes on the table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you copy output to a file using isql?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the default field delimeter in bcp?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How does the following command know host and port number of the   server isql -S?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What does -E mean in BCP?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you handle error in bcp?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How can you bcp only selected set of rows from a table to file   with some conditions?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you write an sql from sybase server to os file?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is interface file?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;How do you do bcp in to table from a file which has 2 columns   seperated by a comma and one of the column has values with in quotes?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the latest tools that can be used to improve the   performance?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="border-top: medium none; height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Locks&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt; &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the different locks in sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;How to detect deadlock,how do you avoid the deadlock,What will   sybase do when deadlock occurs?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you trace the deadlock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;what is lock escalation?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;what is row level and page level locking?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is lock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is row level,page level and table level locking which is   better and why?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you avoid Deadlock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How many types of locks are there in sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are Locks?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What kind of lock will be put on data while performing   insert,update or delete?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you determine the different locks aquired on a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How can you force the lock on a table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the locking level in sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you move from page level to table level lock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to see the types of locks on all tables?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What would be the status of sp_lock in a deadlock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to see deadlock information in sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is demand locks?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the advantage of table level over row level lock?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Compare deadlock and Blocking?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="border-top: medium none; height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Performance Tunning&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;You have a UpdateTrigger on a table containing a million rows, I   update all rows in the table.What will be the performance issues?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;If one of my updations fail what is your solution towards it?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Explain the steps involed in Tunning the Databases?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you Tune a SP ? Explain all steps?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is your first steps towards Query optimizing?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How did you know index was the cause of the perfomance   degration?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is show plane used for?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Ghost Record?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is optimization?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Why denormailzation is needed?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Normailzation?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;If we are joining two tables and what matter join is not working   propely suggest some efficient manner to solve it?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the performance issues in cursor?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you force the join order?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is index covering?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Update Statistics?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;where do you use update statistics and why?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the reasons for a query to run slow?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;When is subquery used or avoided?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the techniquies followed in denormailzation?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What does set rowcount do?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;How do you restrict multiple users from using a particular table   to avoid discrepencies/overlapping of table values?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What Indexing will be better for larger master table?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Which one we prefer joins or subqueries?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is distribution page?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What does reformatting mean in the output of the showplan   output?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What does deffered in the output of the show plan ?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;When we use set statistics time on ,what are the different times   we see?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;I have two tables item and order are newly created without any   rules,constraints etc. and I run a query involing both tables it run s very   slow what can I do about it?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is proactive Tunning?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is reactive Tunning?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Whan would you prefer to do use a stored procedure than a   Trigger?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What happen when you are deleting 100 rows?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Explain about dbcc 3604 and dbcc 3605?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl28" style="height: 12.75pt;" height="17"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Isolation   Levels&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the Isolation levels?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Can you set the isolation level for single query?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is different between level 2 and level 3 in Isolation?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How shall I stimulate from level0 to level3?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is dirty read and how it is deferred from phantom read?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Isolation level 3?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl28" style="height: 12.75pt;" height="17"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Built   In Function&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Name some of the Buit in functions?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Tell me about what are the different String functions in Sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How will you find the pattern in a string on sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;When you execute the query select xx(G,'ABCDEFGHI'),what is xx?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you calculate last month's day?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl24" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How to get the yesterday's date?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl28" style="height: 12.75pt;" height="17"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;" height="27"&gt;   &lt;td class="xl25" style="height: 20.25pt; width: 421pt;" width="561" height="27"&gt;Transaction&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;How does sybase know to what extent a transaction has to be   rolledback?how do you check wether the rollback was correct or not?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;During updating the table can you access the previsoly held   data?How is it internally stored in Sybase?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;There are million rows to be inserted &amp;amp; the transaction log   gets filled up soon . How do you avoid this situation?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Transaction?What happen internally when a transaction   take places?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Transaction Blocks?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do take care of transaction while updating tables in   batches?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;If you have to rollback when a batch updation fails,how would   you determine to what extent you have to rollback?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;What is the use of checkpoint?what happen internally when a   checkpoint is used?how does sybase rollback a transaction to the checkpoint ?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you truncate transaction log?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;A situation aries where two user are updating a table   Simultaneously,How do you maintain the data consistency?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is savepoint?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What happens if the last record is having an error how many   records would be updated?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Compare chain and unchain mode in Transaction?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you know who are the user logged in the database?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the way to figure out that transaction log is full?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is commit?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is Transaction log and how is it maintained in syabse?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What are the different modes of transaction?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;In Transaction table1 has unique values,table2 has id which has   duplicate rows .begin tran insert into table1(id) select id from table2   commit ,what will happen?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Explain about transaction save points and check points?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is transaction management?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the default transaction level?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;I am doing an update on table and a trigger is fired which fails   then is the update rolled back?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How does sybase handle rollback?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;If you have to begin,commit and rollback tran in your query ,can   you create the temp table in that transaction?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;Why the transaction log is called write a head log?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;what is the difference between log segment and data segment?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;How do you find out that transactio log is full?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15.75pt;" height="21"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 15.75pt; width: 421pt;" width="561" height="21"&gt;What is the default transaction level?&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 31.5pt;" height="42"&gt;   &lt;td class="xl23" style="border-top: medium none; height: 31.5pt; width: 421pt;" width="561" height="42"&gt;I am doing an update on table and a trigger is fired which fails   then is the update rolled back?&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-7910855389576726440?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/7910855389576726440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=7910855389576726440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7910855389576726440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/7910855389576726440'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/07/sybase-questions-set.html' title='Sybase Questions set'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-3061032023491495183</id><published>2008-07-23T01:20:00.000-07:00</published><updated>2008-12-22T20:21:59.689-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Sybase Query Optimization</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link style="font-family: trebuchet ms;" rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:ËÎÌå; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Nimbus Roman No9 L"; 	mso-font-alt:"Times New Roman"; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:"HG Mincho Light J"; 	mso-font-charset:0; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:"Luxi Mono"; 	mso-font-alt:Arial; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:auto; 	mso-font-signature:0 0 0 0 0 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:none; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	mso-bidi-font-family:"Times New Roman"; 	color:black; 	mso-fareast-language:#0400;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1; 	mso-footnote-position:beneath-text;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;      &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;                         &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;The goal is to optimize a set of queries to run faster, improve performance. By knowing the meaning of data you can help query optimizer to develop a better query plan and in some cases you can override the query optimizer to follow a certain query plan.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Suppose you have a batch of queries, which you want to optimize. First you need to identify which query is creating the problem and than to identify where the problem lies in that query. Query that is taking maximum time is the first you want to consider for the optimization. To check which query is taking maximum time to execute place getdate() both before and after the query. Identity the type of the query whether it is a data look-up query or data modification query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Use ‘set showplan on’ to see what query plan is executed by the SQL Server? If query is taking a lot of time to execute it is not possible to execute it again and again. Use ‘set noexec on’ to just build the query plan and not to execute it. When these two options are set SQL Server will parse the query, optimize it and develop a query plan, but will not submit it to execute.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;As SQL server uses cost based query optimizer,it’s always better to turn on the following options to check the statistics of the query:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;set statistics io on: gives actual logical and physical page reads incurred by the query&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;set statistics time on: gives total CPU and elapsed time to execute a query and the time to parse and compile the query&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;---------INDEX------------ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Look at the query plan that is generated by the optimizer. Check whether the optimizer is picking up proper indexes for the SARG, OR clauses and Join operations. See whether it is using indexes to execute the query or not, and if yes which indexes are used. If there is an index on the table and optimizer is not using that index to resolve the query, try to figure out why optimizer is not using the index.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;---------UPDATE STATISTICS-------------------&lt;span style=""&gt;                                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;As a general advice, once the table gets 20% updated, we have to run the update statistics for the table. Update statistics for a table updates the distribution page[server keeps distribution information for each index on a separate page in the datebase](so distribution statistics) for the indexes used in the table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Use ‘update statistics’ command to update the statistics for all indexes on a table, using following commands:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;To update the statistics of all the indexes related to the table:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;update statistics &lt;table-name&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;To update the statistics of a particular index on the table:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;update statistics &lt;table-name&gt;.&lt;index-name&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Run dbcc traceon 302 for getting the meta-information to know how the query optimizer is handling the index selection and OR clauses. Run dbcc traceon 310 for getting the meta-information to know how query optimizer is picking up the join order (the permutation details).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Again run that query and see if it using the indexes or not. If the query is still not using any indexes, and you think that an index can be used to execute the query faster, you can force the optimizer to use the index by specifying the index ID number after the table name in the query. SQL Server would use that index to satisfy the query. You can always use ‘set statistics io’ option to verify whether there was an I/O savings over the optimizers choice or not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Identify which indexes to use to resolve the query: clustered or non-clustered. Clustered index is better for range queries, if data is in sorted order, column has number of duplicate values, and column is frequently referenced in the order by clause. Non-clustered index is better for single row lookups, queries containing joins, queries with small range retrieval.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Keep following things in mind for the indexes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Unless the OR strategy is applied, SQL server uses only one index per table to satisfy the query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Sometimes a table scan may be cheaper than a candidate index in terms of total I/O. e.g. large range retrievals on a non-clustered-index column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·A non-clustered index that covers a query will be faster than a similarly defined clustered index.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;----------JOIN AND SUBQUERY--------------- &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;If the query contains any joins, look what is the join order selected by the optimizer. Joins are performed as a set of nested loops. Generally Join queries consume more memory than sub query, Subquery involves the table creation so affects performance, because of I/O fetches need for processing. Subquery is always better than join if we have hardware bottleneck (memory constraints). Check if you can replace join with the subquery. But if you can scale up your hardware (nowadays it is not a big deal) than go with join.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Order in which the join is performed has effect on the total number of I/O performed. By knowing the meaning of data you can select a particular join order and check if it improves performance. You can force join order with the ‘ set forceplan’ option:&lt;span style=""&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;set forceplan {on / off}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;It might be possible that optimizer was using different indexes before forcing the join order, as certain indexes may not be useful for certain join orders. As the number of table increases, query optimizer takes more time to determine the join order. If the optimizer is picking the proper join order but taking a lot of time in determining the join order, you can force that particular join order and save time. One another reason query not picking up proper indexes may be “ set table count value” is set to lower number but the number of tables involved in the join operations is relatively higher.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;&lt;span style=""&gt;                                                &lt;/span&gt;-------------DML------------- &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Another factor while optimizing the query is to avoid the transaction log in data modification queries. In the following cases we can avoid the transaction to be logged.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Use fast BCP instead of slow BCP to avoid the data to be logged.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Use truncate table instead of delete.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Use select_into instead of creating temporary table to avoid the transaction log.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;A table having indexes and triggers takes long time to perform data modification queries. Depending on how important the query is, you can think of dropping the indexes during the daytime and rebuilding the indexes at end of the day. For these types of queries, in many cases index usage is discouraged, because the update statements .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;If you need to perform large data modification its better to drop indexes and rebuild indexes after the data modification operation is performed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Another factor you want to consider is whether query is using any worktable/temporary table to resolve the query. Creating the worktable to solve the query always take much time to process. Queries containing ‘order by’, ‘group by’, ‘distinct’ always uses a worktable. Check if you can satisfy the query by avoiding these clauses. Probable solutions to avoid these clauses are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·If column has a unique/primary key, than there is no need to specify the ‘distinct’ clause.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·If you have more than four tables to joins, it will definitely use a worktable to resolve the query. Try to keep the number of tables to join to minimum. Try to create subquery to avoid join of more than four tables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·If there is an index on a column, which keeps the column sorted, you don’t need to specify ‘order by’ clause in the query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·If you know that data is unique, than there is no need to specify the ‘group by’ clause in the query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Check for the following scenarios in the where clause of the query:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Negative Logic (!=, &lt;&gt;): negative logic always results in the table scan unless index covering is applied.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Calculated comparison: if right side of an expression needs to be calculated first, it will not be evaluated until it reaches the execution stage.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·If a query is frequently using computed expressions, insert a column of the computed expression in the table. You need to write a trigger to maintain that column. e.g. suppose a query always calculates discounted price from a table, its better to insert a column of discounted price in the table.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;A trigger gets fired for every transaction. It is another overhead in the query. Depending on how important the query is you can drop triggers and write a store procedure for that. And at end of the day you can run that stored procedure to perform the operations performed by the trigger. e.g. During the day you need to handle a lot of queries for OLTP, at that time you can consider to drop the trigger and run stored procedure at end of the day.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;Depending upon the type of queries you can think of de-normalizing the tables. Following are the options to de-normalize the data depending upon the importance of the queries:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Inserting calculated columns: it incurs another overhead to maintain the calculated column value. When a data row is inserted, you need to calculate the value of that column. Depending upon the importance of the query you can insert a calculated column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Vertical merge of tables: If a query always performs the join of two or more tables. Its better to merge the tables and build a new table to satisfy that query faster. Again it depends on how much important the query is and how you are going to manage the duplicate data. Duplicating the data improves the query to run faster but it incurs another overhead to maintain the duplicate data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Vertical split of tables: If query always select certain columns from the table, its better to separate the columns from the table and perform the query to improve the performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Horizontal merge of tables: Merge the data horizontally. e.g. If a query shows the transaction done by the customer in the current month only and if the user wants to see the record for certain months, you can horizontally combine data from old transactions table and recent transactions table to give the result.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;·Horizontal split of tables: Split the data horizontally. e.g. in a online banking scenario, split the data in most recent transactions and old transactions. You can just show the most recent transactions, instead of showing the whole transactions.&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;  &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5005148102632656774-3061032023491495183?l=sybasefaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sybasefaqs.blogspot.com/feeds/3061032023491495183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5005148102632656774&amp;postID=3061032023491495183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3061032023491495183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5005148102632656774/posts/default/3061032023491495183'/><link rel='alternate' type='text/html' href='http://sybasefaqs.blogspot.com/2008/07/sybase-query-optimization.html' title='Sybase Query Optimization'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5005148102632656774.post-4741785438454460738</id><published>2008-07-23T01:19:00.000-07:00</published><updated>2008-12-22T20:21:59.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Sybase'/><title type='text'>Normalization</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C02%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:ËÎÌå; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Nimbus Roman No9 L"; 	mso-font-alt:"Times New Roman"; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:"HG Mincho Light J"; 	mso-font-charset:0; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:"Luxi Mono"; 	mso-font-alt:Arial; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:auto; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:StarSymbol; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:auto; 	mso-font-signature:0 0 0 0 0 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:none; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	mso-bidi-font-family:"Times New Roman"; 	color:black; 	mso-fareast-language:#0400;} h1 	{mso-style-next:"Body Text"; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:14.15pt; 	margin-left:0in; 	mso-pagination:none; 	page-break-after:avoid; 	mso-outline-level:1; 	mso-hyphenate:none; 	font-size:24.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	color:black; 	mso-font-kerning:0pt; 	mso-fareast-language:#0400; 	mso-bidi-font-weight:normal;} h4 	{mso-style-next:"Body Text"; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:14.15pt; 	margin-left:0in; 	mso-pagination:none; 	page-break-after:avoid; 	mso-outline-level:4; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	color:black; 	mso-fareast-language:#0400; 	mso-bidi-font-weight:normal;} p.MsoBodyText, li.MsoBodyText, div.MsoBodyText 	{margin-top:0in; 	margin-right:0in; 	margin-bottom:14.15pt; 	margin-left:0in; 	mso-pagination:none; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	mso-bidi-font-family:"Times New Roman"; 	color:black; 	mso-fareast-language:#0400;} a:link, span.MsoHyperlink 	{mso-style-parent:""; 	color:navy; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:#606420; 	text-decoration:underline; 	text-underline:single;} p.TableContents, li.TableContents, div.TableContents 	{mso-style-name:"Table Contents"; 	mso-style-parent:"Body Text"; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:14.15pt; 	margin-left:0in; 	mso-pagination:no-line-numbers; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	mso-bidi-font-family:"Times New Roman"; 	color:black; 	mso-fareast-language:#0400;} p.Quotations, li.Quotations, div.Quotations 	{mso-style-name:Quotations; 	margin-top:0in; 	margin-right:28.35pt; 	margin-bottom:14.15pt; 	margin-left:28.35pt; 	mso-pagination:none; 	mso-hyphenate:none; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Nimbus Roman No9 L"; 	mso-fareast-font-family:"HG Mincho Light J"; 	mso-bidi-font-family:"Times New Roman"; 	color:black; 	mso-fareast-language:#0400;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1; 	mso-footnote-position:beneath-text;}  /* List Definitions */  @list l0 	{mso-list-id:3; 	mso-list-template-ids:3;} @list l0:level1 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:35.35pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level2 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:70.7pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level3 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:106.05pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level4 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:141.4pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level5 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:176.75pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level6 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:212.1pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level7 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:247.45pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level8 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:282.8pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} @list l0:level9 	{mso-level-number-format:bullet; 	mso-level-suffix:none; 	mso-level-text:•; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:318.15pt; 	text-indent:-14.15pt; 	mso-ansi-font-size:9.0pt; 	mso-ascii-font-family:StarSymbol; 	mso-fareast-font-family:StarSymbol; 	mso-hansi-font-family:StarSymbol;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;    &lt;h1 style="text-align: justify;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;What is normalization?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Normalization is the process of designing a data model to efficiently store data in a database. The end result is that redundant data is eliminated, and only data related to the attribute is stored within the table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;For example, let's say we store City, State and ZipCode data for Customers in the same table as Other Customer data. With this approach, we keep repeating the City, State and ZipCode data for all Customers in the same area. Instead of storing the same data again and again, we could normalize the data and create a related table called City. The "City" table could then store City, State and ZipCode along with IDs that relate back to the Customer table, and we can eliminate those three columns from the Customer table and add the new ID column. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Normalization rules have been broken down into several forms. People often refer to the third normal form (3NF) when talking about database design. This is what most database designers try to achieve: In the conceptual stages, data is segmented and normalized as much as possible, but for practical purposes those segments are changed during the evolution of the data model. Various normal forms may be introduced for different parts of the data model to handle the unique situations you may face. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Whether you have heard about normalization or not, your database most likely follows some of the rules, unless all of your data is stored in one giant table. We will take a look at the first three normal forms and the rules for determining the different forms here. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Rules for First &lt;st1:place st="on"&gt;Normal&lt;/st1:place&gt; Form (1NF) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Eliminate repeating groups. This table contains repeating groups of data in the Software column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="margin-left: 35.35pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 135.9pt;" width="181"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Computer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 260.75pt;" width="348"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Software&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 135.9pt;" width="181"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 260.75pt;" width="348"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Word &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 135.9pt;" width="181"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 260.75pt;" width="348"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Access, Word, Excel&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 135.9pt;" width="181"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;3 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 260.75pt;" width="348"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Word, Excel&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;To follow the First Normal Form, we store one type of software for each record. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="margin-left: 35.35pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Computer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Software&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Word &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Access&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Word&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Excel&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Word&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" width="274"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in; width: 191.15pt;" width="255"&gt;   &lt;p class="TableContents" style="margin-bottom: 0.0001pt;"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Excel&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoBodyText"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Rules for second &lt;st1:place st="on"&gt;Normal&lt;/st1:place&gt; Form (2NF) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;i style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;Eliminate redundant data plus 1NF. This table contains the name of the software which is redundant data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="margin-left: 35.35pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0in; width: 205.5pt;" widt
