SQL Server Interview Questions
Questions Answers Views Company eMail

what is the output for this query select * from employee where 1=1;

4 8021

table:employee EID ENAME MID(manager ids) 101 rama null 102 sita 101 103 siva 101 104 ganesh 103 . . . . . . for 103 ID the manager ID is 101(RAMA) and for 104 manager is SIVA if i give employee id (EID) you have to tell the manager for that EID write query? eample:if i give 102 .The query output should be manager for 102 ID that it should print RAMA as output

7 4701

Table student containing 2 columns,Join date,Employee name. Under join date 4 rows r ter =1-jan-2008,2-feb-2008,3-mar- 2008,4-feb-2008.Under Employee name 4 difeerent names jaison,robin,binoy,rahul Result set is, Table containing 4-column name=jan,feb,mar,april,,beneath these months count is given as 1,2,1,0 means these counts representing number of emplooyees joined in a month(january 1employee,february 2 employee,march 1 employee,april 0 employee) Can you give me the required sql query

Wipro, RND Soft,

3 4328




What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

TCS,

950

how to replace double quotes by single quotes in sql server

CAC,

2 9931

hi, i have a table called names and field name select * from names name a b c d i want to display like this name a,b,c,d how it is possible Regards Baiju

4 3435

what is for foreign key ??

Sabic, CarrizalSoft Technologies,

4 4251

How can count the string ? for ex: If i have string like 'bhaskar' then i need like b:1 h:1 a:2 s:1 k:1 r:1 please give any idea on that

TCS,

9 6105




What is SQL Profiler what is the use of it?

247Customer, Steria,

2 10362

What are the advantages of using views. Why do we need views when we have SPs?

247Customer,

4 11693

How many types of cursors are there in SQL Server?

247Customer, CarrizalSoft Technologies,

5 16855

What is the difference between the following two sql statements select count(*) from select count(col_name) from

247Customer,

5 5547

What are the advantages of using stored procedures? Please don't simply say compilation time will be saved as they are already complied. Please specify some other advantages.

247Customer,

3 3475

Differences between functions and stored procedures?

247Customer, Accenture,

8 9130

Can we have more than one NULL in a column having unique constraint?

247Customer,

12 8368


Post New SQL Server Questions






Un-Answered Questions { SQL Server }

how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

433


How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.

2736


How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?

1315


Which is the best place or learning center for MS SQL?????In Bangladesh?????

933


What is the difference between NOROW and LOCKROW?

1367






Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?

1362


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

1305


Tell about MOM Tool(Microsoft Operator Manager)?

741


How do you Implement SSIS Packages in your Project?

889


how to take backup bcp out for a column in table in sql server?

908


in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it

366


System variable and temporary variables

1036


what are the Prerequisites for Replication?

8670


Can we make the the chages By Using the Sql if u know any function or process please inform me Actuall result: BRK1 Break 1 Part 1 00:01:00:00 60 BRK1 Break 1 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 BRK2 Break 2 Part 2 00:01:00:00 60 BRK2 Break 2 Part 3 00:01:00:00 60 BRK3 Break 3 Part 1 00:01:00:00 60 BRK3 Break 3 Part 2 00:01:00:00 60 Desired O/P: BRK1 Break 1 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 Part 3 00:01:00:00 60

989


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

2813