Search This Blog

societe generale Sybase unix interview telephonic round

Hi All,

Telephonic ROUND

Interview was taken by Mr. Lakshmi and Mr. Rahul on 4th Oct 2013 It went for 1 hour 10 Min. It was mix of case studies and direct question.

1) can you tell me how to connect to database

2) how to get last month last date.. like september month 30 day.??
1> select dateadd(dd,-day(getdate()),getdate())
2> go

 --------------------------
        Sep 30 2013  7:56PM

(1 row affected)

3) how to check is there any data changes happened to table

datachange(It is available only in ASE 15.0)

Description

Measures the amount of change in the data distribution since update statistics last ran. Specifically, it measures the number of inserts, updates, and deletes that have occurred on the given object, partition, or column, and helps you determine if invoking update statistics would benefit the query plan.
e.g.
select datachange("authors", "author_ptn", "au_id")

4)what is with check option in view?

it will not let any update or insert which will let data to go out from view.

5) there is a word xyz. how to find out that which all procedure are using this word xyz?

By searching in syscomments text column and then combine with sysobjects.

6)how to print from line 15 to 17 in a file?

7)what is tail +n?

8)  what is usage in unix?

9)what is force plan?

10)what is difference between ASE 12.5 and ASE 15.0

11)There are thousand of application user connecting to database. how will control their login and data integrity?

using isolation level

12)In sybase a job should not run on one friday(due to some holiday) how will you manage this? job is not running on the weekend as well?

13)a temp table created in first parent procedure will child procedure will be able to use the same temp table.

Yes it will be able to use

14) how do you manage identity gaps.

by using small blocks of size by saying identity_gap... 

once the maximum identity is reached then you can increase by below methods,

1) by increasing the identity column's value.

alter table my_titles
(title_id, numeric(10,0))

2)create a new table with larger precision

3) using bcp out and then bcp in same with -N option to another simialr table(T1) and then drop original table(O1) and then rename T1 to O1

-N will cause to stop bcping out/in identity column.

15)proxy table

This example creates a proxy table named t1 that is mapped to the remote table t1. Component Integration Services derives the column list from the remote table:

create proxy_table t1 
at "SERVER_A.db1.joe.t1"

Using the CREATE TABLE statement
The CREATE TABLE statement creates a new table on the remote server, and defines the proxy table for that table when you use the AT option. You enter the CREATE TABLE statement using Adaptive Server Anywhere data types. Adaptive Server Anywhere automatically converts the data into the remote server's native types.

Example 

The following statement creates a table named members on the remote server asademo1, and creates a proxy table named employee that maps to the remote location:

CREATE TABLE members
( membership_id INTEGER NOT NULL,
member_name CHAR(30) NOT NULL,
office_held CHAR( 20 ) NULL)
AT 'asademo1..dba.employee'

17) how you will find out top 10 process in unix.

TOPAS

FACE TO FACE ROUND

face to face round was taken by the Mr. Phani and Mr Jess. It went for 1 hour. Find below scenarios.

1) Write one procedure which will purge the base on the dates to a different tables. table size is around 10 Million and while purging either whole data should purge or nothing should purge.

create procedure housekeep
@date datetime
as
begin
declare @rc int,
@err1 int,
@err2 int,
@batchsize int
select @batchsize=5000
set rowcount @batchsize

select @rc=@batchsize

while @rc=@batchsize
begin
begin tran a
insert into <table_purged> select * from <maintable> where log_date<@date
select @err1=@@error
delete <maintable> where log_date<@date
select @err2=@@error

if @err1 <> 0 and @err2 <> 0
begin
begin tran b
set rowcount 0
insert into <maintable> select * from <table_purged> 
delete from <table_purged> 
commit tran b
rollback tran a
        return
end
else commit tran a
select @err=@@error
end

end

2)how to run for loop in unix 

3) i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. 


No comments:

Post a Comment