i have three table
1. student (stuid,name)
2. subject (subid,sname,studid)
3. marks (subid,studentid,marks)
i want the reslut of how as got max marks in each subject

sudentname,max(marks), name
abc,70,nikitha



i have three table 1. student (stuid,name) 2. subject (subid,sname,studid) 3. marks (subid,stude..

Answer / somnath banerjee

select (select studentname from student where stuid=a.studentid) as studentname,marks,(select sname from subject where subid=a.subid) as name from (select subid,studentid,max(marks) from marks group by subid,studentid) a;

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Postgre Interview Questions

How many columns can a postgres table have?

0 Answers  


How do I add another column in postgresql?

0 Answers  


List some of the features of postgresql ?

0 Answers  


Is postgresql faster than mysql?

0 Answers  


What is the difference between oracle and postgresql?

0 Answers  






How do I install postgresql?

0 Answers  


What is foreign key in postgresql?

0 Answers  


Explain about the command enable debug?

1 Answers  


What are foreign key constraints?

0 Answers  


How to created a database?

1 Answers  


Compare ‘postgresql’ with ‘nosql’?

0 Answers  


Is postgresql secure?

0 Answers  


Categories