Q.4. Answer the following as SQL queries. Also write corresponding relational algebra expression:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (15 marks)
           a. Number of rakats prayed as Qaza by each person
           b. How many females have skipped fajar salah on 1st shawwal
           c. How many salah are missed by Mr. Noman
           d. Average time M. Noman takes for praying Isha Salah
           e. Which salah is missed mostly by M. Saleem
           f. Which salah is missed the second most by all people
a)select distinct(Person name ) from table2 where prayed rakats ="Qaza";
b) SELECT COUNT (name) from female where question1=Null
c) SELECT Count(SALAH) From SALAH WHERE follow=false
d) select AVG(time) from prayer where name ="M.Noman"
e) SELECT name from slalah where repetation=max
f) select name from salah where repetation<max
Comments
Leave a comment