Академический Документы
Профессиональный Документы
Культура Документы
NO
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Queries
Questions
How do you get the second max date in the date column?
There are two tables ,A(id,name),B(id,cellphone).write a query to find all employees have
cellphones ?
You have table A(id,Mgrid).Given an id ,write a query to get mgrid?
How do you identify the duplicate record in your table?
Table1 (name,id) ,Table 2( id, book) write query to get name and books with given id
How to add column
How do you select Not Null values from a table
Find out the second Max value in a Table
What will the query returns select a,sum(b) from table group by a
There are three tables A(col1,col2),B(col1,col2),C(col1,col2,col3) what will be the result
Select A.col1,B.col1 from A,B,C where A.col1=B.col1
Delete 500,000 row from a table how do you achive this?
There are two tables one with 100 rows and other with 10000 rows How to join this two
tables?
In person table which has fname,lname,age,address . write a query to get all the duplicate
fname and lname
What are the different ways in which we create Temp table?
We feed 500000 row with data for 90 days each day new data is feed with old data purged,
how would you do it?
Stundent(sname,sid) and courses(cname,cid,sid) are two table,find what are all the courses a
specific student has taken?
How will you insert 10000 row into a table?
You have Table1(id,name),Table2(id,class) select all matching rows from both the table
If there are table with fname,lname and group and first two column have duplicates,write a
query that provides the duplicates in the first two columns and their corresponding count(no fo
times they are duplicated)
Table given A and B select all rows from both tables and matching rows only once such that
final result set will have id,class,name and should display null for empty values.
How do you select next 100 row in a table?
In a table1(name,address,mark) write a query that select name if mark in positive and address
if marks are negative
How will I get 2000 rows from 50000 rows from one database and put it in another database
Suppose there is table with 3000000 records and I have to delete record that are 20 days old
how will I do that?
A table have 3 columns A,B,C values are 1131152312231523293412345434563445 write a
query to get the 1st occurance of repeating patterns in first two cloumns(no cursors)
I have 1 million rows in a table and I want to delete the first ten thousand rows of the table but
I do not want to log it?
The table Emp with (name,dept,id,salary) find max salary among all the emp in dept wise.
Find the name from EMP which strats with a or b or c.
How do write a query to eliminate the redundant rows in a table?
How do you select 3 & 4 from tables that already has an identity column?
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?
Employee table contain id,name,depid,managerid write a query to select
id,name,deptid,mangerid,mangername. Manager also an employee
Table has a column varchar(10) that contain numeric and alphanumeric values ,I want alpha
numeric value how shall I get it?
How to get top 10 empname and salary
How to find 10th max in a table
A table contains 2 column deptid and empid write a query to select all deptid which has more
than 25 empid?
In a table one million rows and one column are in sequence order (1 to million) and there is
one row was missing in that sequence how do I find it?
In a table with column accountid,orderno,order ,managername asked to find the total number
of order placed by a particular manager(accountid,orderno) is a composite key
I have two table A and B ,In both a tables contain the same number of columns and rows
however table A has one extra row ,how will I get that row from table A.
Suppose you have two tables ,how to get the unique rows from both the tables?
In a table A have Id and deposit and table B have id and withdrawal ,write a query to retrive
the final amount I.e deposit-withdrawal
There are two tables emp1(all employees working last year) and emp2 (all current
employees).Now some employees from last year could have left the company and no longer
there in emp2 and some employees are recent hires who are not in emp1 but in emp2 ,How
will you find all the employees who worked in both years.
There are two tables emp1(all employees working last year) and emp2 (all current
employees).Now some employees from last year could have left the company and no longer
there in emp2 and some employees are recent hires who are not in emp1 but in emp2 ,How
would you find all the employees who not present in both tables(ie both newly hired or fired)
How will you delete two row from two tables at same time.
There two tables ABC and PQR,ABC has column A,B,C and Table PQR has P,Q,R. I want
to display A,B,C,P,Q and statisfying the condition that the column A matches column P.
How do you find the(1/2) intersection between two tables (emp1,emp2) or something to that
effect?
I have two tables A and B ,A has id and name ,B has id and marks,Display name and print '0'
for no matching id in table 2 else print 1
How do you find 5th max salary from the emp table?
How do you insert 10 rows at a time to a table?
Write a query for selecting all persons with lastname like'smith'(anycase)from a table?
How do you match particular numbers in a integer column?
How do you find rows that are not common in two similar tables?
There are 10 rows in a table and you want to duplicate the rows into the same table and the
keys of the duplicate rows is unique?
Display the name starts with small letters?
If I have 1000 rows in a table of emp and want to retrive max salary of the emp what query
can I write?
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?
You have two tables A and B with column C1 In A column C1 has value like 1,2,3 and Table
B column C1 has value like 3,4,5 ,How many rows would the following query return 'select *
from A,B where A.C1<>B.C1
We have two table security and type wich has no primary key and foreign key,I need one of
the columns(with only specific rows) from the second table.
Datatypes
S.No Questions
S.No Questions
S.No Questions
S.No Questions
S.No Questions
Why did you use SP to update your main server?Didn’t you any other techinque or
1 tool to do that?
2 What is SP & how it is different from a trigger?
3 What is Stored procedure?
4 What are the types of parameter a SP can accept?
5 How do you create a SP?
A table contain 3 columns & SP has select * from table .If I add a new column to
6 that table & run the SP what will be the output?
I have 200 SP having a select * from table query.I have changed the table coulmns.
7 How do I update the Sp to handle the new/deleted columns?
8 What are the SP advantage and disadvantage?
We have two SP within Transaction and one SP wants to access the Temp table
9 present in the first SP and also has insert statement within it?
10 How to handle error in SP?
11 Compare sp_recompile and with recompile?
12 How many input parameters you can pass through the SP?
13 How would you call/pass arguments in SP?
14 Compare Sp and function in sybase?
15 What is the limitation of the SP?
16 What is the use of SP?
17 What is extented Stored procedures?
A SP calls another .If a #table is created in the first SP can it be accessed in the
18 other SP?
19 Which is more advantage trigger or SP?
20 Advantage of SP?
21 Disadvantage of SP?
22 Compare batch and SP?
23 How do pass parameter in SP?
24 What is nesting levels in SP?
What is the difference between a return (0) and a return(X) ,X being any integer in
25 a SP?
26 How do you declare the local variables in SP?
27 What are the ways to communicate SP from application?
If there are three Transaction inside a SP is first and last was commited but middle
28 was failed what will be the return status?
29 How would you update SP if the tables are modified?
30 Can we access table from different database using SP?
31 How do you read the text of the SP?
32 Trigger or SP which one remain in the cache?
33 What is recursive SP?
S.No
1
2
3
4
5
System Stored Procedures
Questions
What is sp_helpdb,sp_helpindex?
What is sp_who?
How do you check the text of the SP?
How do you find the size of the database in sybase?
What is sp_dboption?
Global Variables
S.No Questions
S.No Questions
1 What is a Trigger?
2 How many trigger can you have on a table? What are they?
You are inserting a million rows into a table having an insert trigger .will the
3 trigger execute a million times?
4 What are magic table and where are they accesiable?
5 How do you create a Trigger?
6 What are the different types of Trigger?
7 Why we need Trigger?
8 How Trigger checks for a particular data update?
9 What are the Trigger advantage and disadvantage?
10 How do find how many rows are deleted using delete command?
11 Explain the Trigger in a Update scenario?
What happen if you create delete trigger on a table which have aleady delete
12 trigger?
13 How to find out trigger on tables?
14 How to get program listing of trigger on a tables?
15 Why do we need Trigger?
16 Compare truncate and trigger?
17 What are he trigger upper limits on a table?
18 Which one will fire first trigger or Referential integrity?
19 What is the difference between Trigger and Cursors?
20 What are the limitation on Trigger?
S.No
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index
Questions
What happens to data when a clustered index is created? What happens if non-clustered
index is created?
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?
How do you force the omptimizer to use the index for a table?
What are the difference between clustered and Non clustered index?
Can you tell me the scenarios when you used the two types of index ?
What are the different types of Indexes?
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?
How do you add an index to a column?
What is the difference between primary key and indexes?
How many clustered and non clustered index on a table?
How to sort data in a table in a table without using order by and without using indexes?
How many indexes can you have in a table and in a column?
Can you create indexes on temporary tables?
Consider in table1 -empid has numeric value and table2 -empid have int value if there is
query that joins the two tables which indexes will be used and why?
What is the use of clustered and non clustered index?
How do you list out all the indexes on a table?
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?
How many index a table can have?
What is pros and cons of indexes?
Give me the advantage and disadvantage of forcing the index?
Why index are used in select query what is the reasons?
If you have an index on five column do you have to specify all the five in where clause?
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?
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?
You have table with column just contain value like 'male' or 'female' ,what index would you
apply and why?
How would you implement a merge sort in indexes?
Locks
S.No Questions
S.No Questions
23 How does the following command know host and port number of the server isql -S?
24 What does -E mean in BCP?
25 How do you handle error in bcp?
How can you bcp only selected set of rows from a table to file with some
26 conditions?
27 How do you write an sql from sybase server to os file?
28 What is interface file?
How do you do bcp in to table from a file which has 2 columns seperated by a
29 comma and one of the column has values with in quotes?
30 What is the latest tools that can be used to improve the performance?
Isolation Levels
S.No Questions
S.No Questions
You have a UpdateTrigger on a table containing a million rows, I update all rows
1 in the table.What will be the performance issues?
2 If one of my updations fail what is your solution towards it?
3 Explain the steps involed in Tunning the Databases?
4 How do you Tune a SP ? Explain all steps?
5 What is your first steps towards Query optimizing?
6 How did you know index was the cause of the perfomance degration?
7 What is show plane used for?
8 What is Ghost Record?
9 What is optimization?
10 Why denormailzation is needed?
11 What is Normailzation?
If we are joining two tables and what matter join is not working propely suggest
12 some efficient manner to solve it?
13 What are the performance issues in cursor?
14 How do you force the join order?
15 What is index covering?
16 What is Update Statistics?
17 where do you use update statistics and why?
18 What are the reasons for a query to run slow?
19 When is subquery used or avoided?
20 What are the techniquies followed in denormailzation?
21 What does set rowcount do?
How do you restrict multiple users from using a particular table to avoid
22 discrepencies/overlapping of table values?
23 What Indexing will be better for larger master table?
24 Which one we prefer joins or subqueries?
25 What is distribution page?
26 What does reformatting mean in the output of the showplan output?
27 What does deffered in the output of the show plan ?
28 When we use set statistics time on ,what are the different times we see?
I have two tables item and order are newly created without any rules,constraints
29 etc. and I run a query involing both tables it run s very slow what can I do about it?
30 What is proactive Tunning?
31 What is reactive Tunning?
32 Whan would you prefer to do use a stored procedure than a Trigger?
33 What happen when you are deleting 100 rows?
34 Explain about dbcc 3604 and dbcc 3605?
Transaction
S.No Questions
S.No Questions