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

Table - Products has number of products as below Productid ProductName 1 iPhone 2 iPad 3 BlackBerry Table - SalesPersonProduct has the below records Salespersonid productid S1 1 S1 2 S1 3 S2 1 S3 2 Write a SQL query that returns the number of sales for each product

2 Answers  


Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

0 Answers  


New concepts of sql server 2005 use in your project.

0 Answers   TCS,


What is raid, and how it can influence database performance?

0 Answers  


What is the difference between SQL notification and SQL invalidation?

0 Answers   MindCracker,






How to delete the duplicate rows from a table in SQL Server ??

3 Answers  


when you create a database how is it stored? : Sql server database administration

0 Answers  


What are the steps need to be take improve the speed of a SQLDATA Server?

2 Answers   IBM,


What is inner join in sql server joins?

0 Answers  


What are the types of subquery?

0 Answers  


Explain how to use linked server?

0 Answers  


What is difference between temp table and cte?

0 Answers  


Categories