Computer Science, asked by lokeshkuyyamudi, 11 months ago

Write a query to display list of students name and their marks in Theory of Computation. Sort the result based on student name​

Answers

Answered by samikshak
20

Answer:

select student_name,value

from student inner join mark

on student.student_id=mark.student_id

inner join subject

on mark.subject_id=subject.subject_id

where subject_name='Theory of Computation'

Explanation:

We need to have 2 nested inner join to join student, mark and subject table

Answered by geetanidoni5
0

Answer:

SELECT ST.STUDENT_NAME, M.VALUE

FROM STUDENT ST

INNER JOIN MARK M

ON ST.STUDENT_ID=M.STUDENT_ID

INNER JOIN SUBJECT SU

ON M.SUBJECT_ID=SU.SUBJECT_ID

WHERE SU.SUBJECT_NAME='Theory of Computation'

ORDER BY ST.STUDENT_NAME;

Explanation:

WE HAVE TO JOIN THE THREE TABLES, HENCE WE HAVE TO USE TWO INNER JOINS

Similar questions