I have a table name Table1 which contain columns Cust_no,
car_model, country, salesamt. The records are 101, Fiat,
India, 12345
2nd record is 102, Tata, USA, 98743 3rd record is 101,
indica, India, 65342 4th record is 103, Toyota, UK, 64522
5th record is 103, Maruti, USA, 98632 and so on.....

Now my question is write sql query which will give me
detail about the sum of sales amount in perticular country

Answers were Sorted based on User's Feedback



I have a table name Table1 which contain columns Cust_no, car_model, country, salesamt. The record..

Answer / satty

select country,sum(salesamt) from table1 groupby country;

but if its primary key is cust-no, then it will show error
-803 try to insert duplicates in primary key value.

Is This Answer Correct ?    4 Yes 0 No

I have a table name Table1 which contain columns Cust_no, car_model, country, salesamt. The record..

Answer / raghu

select country,sum(salesamt) from table1 where country = ind;

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

How and when does the db2 enforces the unique key?

0 Answers  


What is the purpose of the DSNC transaction ?

1 Answers  


What DB2 Catalog column tell you when an index needs table reorganized ?

1 Answers  


if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)

3 Answers  


Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?

2 Answers  






when does the SQL statement gets executed when you use cursor in the application programming ?

3 Answers   IBM,


How to solve S0C7 abend with out using DISPlay in 10 mins?

1 Answers   IBM,


what is datacom db?

2 Answers   CSC,


What are common abends

1 Answers   SPIC, Virtusa,


If I have 5 Queries in a DB2 Cobol program , while precompiling how many DBRMs will get created and How many Plans and Packages will get created while Bind Process?

8 Answers   Accenture,


What is error -818 in db2. where can you find the timestamp of the DBRM and the source code.( precompile puts the timestamp on dbrm and source code correct?)

2 Answers  


Explain db2.

0 Answers  


Categories