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 rackets
from Qaza
where NAME="A";
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
Here, required data is not given so all the query is based on assumed table name.
Comments
Leave a comment