0

So I have these tables:

Student(Rollno,name,address)
Subject(sub_code,sub_name)
Marks(Rollno,sub_code, marks)

I want to display average of marks roll no wise with name too. I used this query to find average of marks:

SELECT Rollno,avg(marks) FROM MARKS GROUP BY Rollno;

How do I get name of respective roll numbers ?

1

1 Answer 1

2

Try using a join:

SELECT M.Rollno, S.NAME, avg(M.marks) 
FROM Marks AS M  
JOIN Students AS S ON M.rollno = S.rollno 
GROUP BY M.Rollno, S.NAME,;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.