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

What is reorg in database?

1 Answers  


What is ibm db2 database?

0 Answers  


How to execute stored procedures?

0 Answers  


I have 1000 rows in a db2 table.I want to update first 100 records,How do I do it?

4 Answers   CTS,


if there is a table with huge number of records and if i want to extract only first 3 records from the table, what query i have to provide to retreive first 3 records

4 Answers   UST,






Is db2 a mainframe database?

0 Answers  


Before you give the explain statement, what are the prerogatives?

0 Answers  


what is parm utility

2 Answers   IBM,


What is the function of the Data Manager?

2 Answers  


Explain the contents that are a part of dclgen.

0 Answers  


B37 abend during spufi?

0 Answers   IBM,


how to resolve -805. give clear explination for that

2 Answers   IBM,


Categories