Questions | Database Index | Database Transaction

S.

NO 1 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 .

Mgrid).Queries Questions How do you get the second max date in the date column? There are two tables . 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.B(col1.B(id.B.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.C(col1.lname.cellphone).write a query to find all employees have cellphones ? You have table A(id.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.Table 2( id.find what are all the courses a specific student has taken? How will you insert 10000 row into a table? You have Table1(id.col1 from A.col1 Delete 500.class. How do you select next 100 row in a table? In a table1(name.col2).cid.name).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.name).B.col3) what will be the result Select A.B.col1=B.sid) are two table.sid) and courses(cname.sum(b) from table group by a There are three tables A(col1.Given an id .name and should display null for empty values.write a query to get mgrid? How do you identify the duplicate record in your table? Table1 (name.id) .col1.class) select all matching rows from both the table If there are table with fname.Table2(id.lname and group and first two column have duplicates.A(id.col2.address.col2).C values are 1131152312231523293412345434563445 write a query to get the 1st occurance of repeating patterns in first two cloumns(no cursors) .C where A.age. how would you do it? Stundent(sname.address . 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.

B. There two tables ABC and PQR.Q and statisfying the condition that the column A matches column P.depid.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 . How do you find the(1/2) intersection between two tables (emp1.B. I want to display A.ABC has column A.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. Suppose you have two tables .In both a tables contain the same number of columns and rows however table A has one extra row .mangername.write a query to retrive the final amount I. 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 .salary) find max salary among all the emp in dept wise.emp2) or something to that effect? I have two tables A and B .C.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 .managerid write a query to select id. There are two tables emp1(all employees working last year) and emp2 (all current employees).deptid.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? . Find the name from EMP which strats with a or b or c.Q.order .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 .mangerid.e deposit-withdrawal There are two tables emp1(all employees working last year) and emp2 (all current employees).write a query to get all the customer without order? Employee table contain id.name.orderno.dept.id. Manager also an employee Table has a column varchar(10) that contain numeric and alphanumeric values .how will I get that row from table A.A has id and name .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.C and Table PQR has P.name.R.managername asked to find the total number of order placed by a particular manager(accountid.P.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.orderno) is a composite key I have two table A and B .B has id and marks.How will you find all the employees who worked in both years.

C1 We have two table security and type wich has no primary key and foreign key.If I run select * from A.3 and Table B column C1 has value like 3.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.5 .4.2.C1<>B.How many rows would the following query return '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.I need one of the columns(with only specific rows) from the second table. .B where A.

No 1 2 3 4 5 6 7 8 9 10 11 Questions What is the use of Timestamp? What are the datatypes available in sybase? How will you change the datatypes of an existing column? What are user definrd datatypes why do we need it? Does datatypes listed in sysobjects? Compare char and varchar datatypes? How do you delete the identity gaps in identity columns? If you change the datatype of a particular column. Compare money and smallmoney? What is the differnce between Decimal and Float datatype? What is Bit datatype? .Datatypes S.how will you know that it is working in case of a large table .

No 1 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 Questions What problem we face when we updating our tables? Write an algorithm to update the tables in batches? What will be the condition in your while loop to update the table in batches? How do you come out of this loop? How do you delete duplicates rows in a table? What happen if we use a function in a where clause in a query?will the indexes be applied? What is the restriction for a table that is used in a outer join? What loop constructs does sybase support? How do you avoid divide by 0 in select query? Create a table in sybase? Write a query using group by ? What is Null? What are Temporary table? What is a left Outer join and Right outer join? Compare drop and Truncate? What is the Syntax to change table structure? Compare delete and truncate? In query which is better not In or not Exists? What is the difference in creating Temp table using select into and create command? Is there any alternative to Identity column? How can you transfer table from one server to another? What is compute and compute by? Is there any specfic order fo tables in from clause while joining the tables? Is sybase support cross tab query? What is federated schema? Explain the snow flake schema? How many nested subquery is possible on a table? What is cascade delete in sybase? Can you truncate table on Foreign key? Compare primary key and Unique key? Compare where clause and having clause? What is table Partitioning? what are the different types of Temp table? Compare having and group by? .Tables S.

delete and insert .How do you implement them? Explain Referencial integrity? How do you insert row into the tables? Explain about Identity column? What is IN and NOT IN? Give me the syntax for left outer join? What is group by ? How do you extract data from tables? How can you avoid distinct and data is not unique? Compare T-sql and Sql? If two tables are given we need to convert row information to column information ? How will you organise data for different kinds of account into sybase tables so that minimum amount of space is used? What is correlated subquery? Compare in and exists? When the table scan is useful? Why is multiple tempdb in version 12X useful? What is the difference between select into and insert? What is temp table and hash table? Name few system tables? .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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 Compare selfjoin and outerjoin? Compare use and require? What are the types of joins? What is replication server in sybase? How to get the third max value in a table using self join? What creates a worktable? When is 'not in' preffered to 'not exists'? Whan do you use a table scan? How do you trace changes to a work table in sybase? Compare union and union all? Comapre exists and like? What is cross join? What are the difference types of System databases in sybase 11 ? How do find No of rows in a table ? Compare count() and Count(*)? Which is faster 'select into' or 'insert' statement? How to set max rows per page? What are trace flags? What are Joins and why join order is importance? How do you set the join order? What are cascade update.

b is smaller than A and if we use outer join what join order will sybase use? How will you use sybase to execute a query only on month ends? How do you set the number of tables to join? What are the risk in using Temp tables? What is intersect Query? How to update a table but using a join condition with other tables? What are all the problem when you use group by only on some non aggregates in select clause? If you have to begin.commit and rollback tran in your query .can you create the temp table in that transaction? What is revoke permission? What is check constraints? What is the advantage and disadvantage of #table? How do you check the query for syntax? How to detemine what permissions user have like the read.write or execute? How do you handle error in sybase? How do you change your login password in sybase and will user have the rights or only admin can do it? What is the difference between Sybase and Oracle? What is the use of wildcards? What are the different types of Aggregate functions? Insert .73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 What is sybase replication? What is difference between having and group by? Compare TSQL and ANSISQL? How do I delete particular column without using alter command? What is session table in sybase? Can you use having without group by? What are the difference between outer and inner joins? How do you select only limited portion of table ? What is the difference between sybase12 and sybase11? What are the priviliges you as a table owner can grant someone on your table? Why do you use trigger rather than Referntial integrity? You have table A and table B .Delete is better or update is better? .

No 1 2 3 4 5 Questions What is the use of view ? What is View? What are the limitation on view while creating it? Can I update a View? What is the use of creating view with check option? .View S.

Cursor S.No 1 2 3 4 5 6 7 8 9 10 Questions What are the cursor advantage and disadvantage? Compare cursor and setbased? Which one is better using cursor or other method? How do you write cursor inside the SP? How do we deallocate the cursor? How shall we overcome the disadvantage of cursor? How will you access row by row in sybase? What are steps involed in creating cursor? Explain cursor and performance? What is @@sqlstatus? .

I have changed the table coulmns.If a #table is created in the first SP can it be accessed in the other SP? Which is more advantage trigger or SP? Advantage of SP? Disadvantage of SP? Compare batch and SP? How do pass parameter in SP? What is nesting levels in SP? What is the difference between a return (0) and a return(X) . How do I update the Sp to handle the new/deleted columns? What are the SP advantage and disadvantage? We have two SP within Transaction and one SP wants to access the Temp table present in the first SP and also has insert statement within it? How to handle error in SP? Compare sp_recompile and with recompile? How many input parameters you can pass through the SP? How would you call/pass arguments in SP? Compare Sp and function in sybase? What is the limitation of the SP? What is the use of SP? What is extented Stored procedures? A SP calls another .No Questions Why did you use SP to update your main server?Didn’t you any other techinque or tool to do that? What is SP & how it is different from a trigger? What is Stored procedure? What are the types of parameter a SP can accept? How do you create a SP? A table contain 3 columns & SP has select * from table .X being any integer in a SP? How do you declare the local variables in SP? 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 was failed what will be the return status? How would you update SP if the tables are modified? Can we access table from different database using SP? 1 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 .Stored Procedures S.If I add a new column to that table & run the SP what will be the output? I have 200 SP having a select * from table query.

31 32 33 How do you read the text of the SP? Trigger or SP which one remain in the cache? 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? .

No 1 2 3 4 5 Questions What are the different global variables? For cursor what is the possible values of @@sqlstatus? How do you get the version of the sybase? How do you view only top 30 rows of the table? What is @@identity? .Global Variables S.

No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Questions What is a Trigger? 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 .Trigger S.will the trigger execute a million times? What are magic table and where are they accesiable? How do you create a Trigger? What are the different types of Trigger? Why we need Trigger? How Trigger checks for a particular data update? What are the Trigger advantage and disadvantage? How do find how many rows are deleted using delete command? Explain the Trigger in a Update scenario? What happen if you create delete trigger on a table which have aleady delete trigger? How to find out trigger on tables? How to get program listing of trigger on a tables? Why do we need Trigger? Compare truncate and trigger? What are he trigger upper limits on a table? Which one will fire first trigger or Referential integrity? What is the difference between Trigger and Cursors? What are the limitation on Trigger? .

No 1 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 .S.

I create a clustred index on the same table without dropping the non-clustred index.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' .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.c.fname) in a table .b.what index would you apply and why? How would you implement a merge sort in indexes? .dept and gender there are two indexes namely on(dept.The table having 10 million rows .name.gender) and (gender.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.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 .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.which index should I have on that column to optimise my search? A table contains EmpId .

how do you avoid the deadlock.No Questions 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 What are the different locks in sybase? How to detect deadlock.What will sybase do when deadlock occurs? How do you trace the deadlock? what is lock escalation? what is row level and page level locking? What is lock? What is row level.update or delete? How do you determine the different locks aquired on a table? How can you force the lock on a table? What is the locking level in sybase? How do you move from page level to table level lock? How to see the types of locks on all tables? What would be the status of sp_lock in a deadlock? How to see deadlock information in sybase? What is demand locks? What is the advantage of table level over row level lock? Compare deadlock and Blocking? .page level and table level locking which is better and why? How do you avoid Deadlock? How many types of locks are there in sybase? What are Locks? What kind of lock will be put on data while performing insert.Locks S.

Sybase Tools S.constraints? What is the option for identity column in bcp? What steps did you take to tune the BCP? When should we use BCP and Insert statements to modify table ? How do you send a selected rows into a file? In bcp how would I specify that only one error is allowed? In bcp how would I specify that commit size? How would you transfer 1000 rows from 10000 rows using BCP? How do you do fast bcp with trigger and indexes on the table? How do you copy output to a file using isql? What is the default field delimeter in bcp? How does the following command know host and port number of the server isql -S? What does -E mean in BCP? How do you handle error in bcp? How can you bcp only selected set of rows from a table to file with some conditions? How do you write an sql from sybase server to os file? What is interface file? 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? What is the latest tools that can be used to improve the performance? .rules.trigger.No 1 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 Questions What are the types of BCP?Explain their difference? How can I select the first 500 rows from a table having million rows & generate a flat file? Is the trigger fires during BCP in? There is delete trigger on a table and there is no indexes wether server use fastbcp or slowbcp? Is it possible to lookup the missing data before loading it into sybase tables? What sort of checks can be done in BCP? How do handle error in BCP? How do you upload the data? How would you transfer certain number of rows from table to file? How data validation works before bcp? In which case fast bcp occurs? which one of the following gets fired when you do a bcp into a table from a file? defaults.

No Questions 1 2 3 4 5 6 What are the Isolation levels? Can you set the isolation level for single query? What is different between level 2 and level 3 in Isolation? How shall I stimulate from level0 to level3? What is dirty read and how it is deferred from phantom read? What is Isolation level 3? .Isolation Levels S.

I update all rows in the table.constraints etc.what are the different times we see? I have two tables item and order are newly created without any rules.What will be the performance issues? If one of my updations fail what is your solution towards it? Explain the steps involed in Tunning the Databases? How do you Tune a SP ? Explain all steps? What is your first steps towards Query optimizing? How did you know index was the cause of the perfomance degration? What is show plane used for? What is Ghost Record? What is optimization? Why denormailzation is needed? What is Normailzation? If we are joining two tables and what matter join is not working propely suggest some efficient manner to solve it? What are the performance issues in cursor? How do you force the join order? What is index covering? What is Update Statistics? where do you use update statistics and why? What are the reasons for a query to run slow? When is subquery used or avoided? What are the techniquies followed in denormailzation? What does set rowcount do? How do you restrict multiple users from using a particular table to avoid discrepencies/overlapping of table values? What Indexing will be better for larger master table? Which one we prefer joins or subqueries? What is distribution page? What does reformatting mean in the output of the showplan output? What does deffered in the output of the show plan ? When we use set statistics time on .Performance Tunning S. and I run a query involing both tables it run s very slow what can I do about it? What is proactive Tunning? What is reactive Tunning? 29 30 31 .No Questions 1 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 You have a UpdateTrigger on a table containing a million rows.

32 33 34 Whan would you prefer to do use a stored procedure than a Trigger? What happen when you are deleting 100 rows? Explain about dbcc 3604 and dbcc 3605? .

how would you determine to what extent you have to rollback? What is the use of checkpoint?what happen internally when a checkpoint is used? how does sybase rollback a transaction to the checkpoint ? How do you truncate transaction log? A situation aries where two user are updating a table Simultaneously.Transaction S.what will happen? Explain about transaction save points and check points? What is transaction management? What is the default transaction level? I am doing an update on table and a trigger is fired which fails then is the update rolled back? How does sybase handle rollback? If you have to begin.How do you maintain the data consistency? What is savepoint? What happens if the last record is having an error how many records would be updated? Compare chain and unchain mode in Transaction? How do you know who are the user logged in the database? What are the way to figure out that transaction log is full? What is commit? What is Transaction log and how is it maintained in syabse? What are the different modes of transaction? In Transaction table1 has unique values.No Questions 1 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 How does sybase know to what extent a transaction has to be rolledback?how do you check wether the rollback was correct or not? During updating the table can you access the previsoly held data?How is it internally stored in Sybase? There are million rows to be inserted & the transaction log gets filled up soon . How do you avoid this situation? What is Transaction?What happen internally when a transaction take places? What is Transaction Blocks? How do take care of transaction while updating tables in batches? If you have to rollback when a batch updation fails.commit and rollback tran in your query .table2 has id which has duplicate rows .can you create the temp table in that transaction? Why the transaction log is called write a head log? .begin tran insert into table1(id) select id from table2 commit .

27 28 29 30 what is the difference between log segment and data segment? How do you find out that transactio log is full? What is the default transaction level? I am doing an update on table and a trigger is fired which fails then is the update rolled back? .

No Questions 1 2 3 4 5 6 Name some of the Buit in functions? Tell me about what are the different String functions in Sybase? How will you find the pattern in a string on sybase? When you execute the query select xx(G.Built In Function S.'ABCDEFGHI').what is xx? How do you calculate last month's day? How to get the yesterday's date? .

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.