i want to show the attendance of a student in percentage In my project attendance management system. I want to show the attendance in percentage after entering enrollment of a particular student
table in database
fsignup(name,email,password,subject)
ssignup(name,email,enrollment,semester,password,branch)
attendance(enrollment,subject,attendance,date,faculty_id)
I'm gonna assume couple of things here. For attendance column I'm gonna assume "Yes" if the student is present on that particular date, and "No" if otherwise.

SELECT f.name, f.subject, t2.attendance_percentage 
FROM fsignup f
JOIN (SELECT subject, Yes/SUM(Yes+No)*100 AS attendance_percentage FROM (SELECT subject, SUM(CASE WHEN attendance="Yes" THEN 1 ELSE 0) AS Yes, SUM(CASE WHEN attendance="No" THEN 1 ELSE 0) AS No FROM attendance GROUP BY subject)t1)t2
ON f.subject=t2.subject
GROUP BY f.name, f.subject