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?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More SQL Server Interview Questions

What is blocking in SQL Server? If this situation occurs how to troubleshoot this issue

2 Answers   IBM,


What guidelines should be followed to help minimize deadlocks?

0 Answers  


How except clause is differs from not in clause?

0 Answers  


How to delete an attribute from the emp table

4 Answers  


i have a table #temp1(id, Name groupname ) and record like this 1 R1 S 2 R3 S 3 R2 S 4 R4 D 5 R5 D 6 R6 K 7 R7 K 8 R8 L 9 R9 L 10 R10 L 11 R11 K and i want to display record based on user defind sorting order e.g. 1 R4 D 2 R5 D 3 R6 K 4 R7 K 5 R11 K 6 R1 S 7 R3 S 8 R2 S 9 R8 L 10 R9 L 11 R10 L

8 Answers  






Can I recover a damaged SQL Server 2008 database with the undamaged .mdb and .ldf files?

3 Answers   Apple,


What do you understand by coalesce in sql server?

0 Answers  


What is the default sql server instance name?

0 Answers  


How to update multiple rows with one update statement in ms sql server?

0 Answers  


What is a deadlock and what is a live lock?

0 Answers  


How many columns can exist together per table?

0 Answers   Cap Gemini,


What causes index fragmentation?

0 Answers  


Categories