Consider the following relational database schema:
parts(PNO,pname,color)
suppliers(SNO,sname,city)
supply(SNO,PNO,qty)
Write queries in Domain Relational Calculus (DRC) for the following:
- Find supplier number of suppliers who supply ALL "red" parts.
- Find supplier number of suppliers who supply ONLY "red" parts.
Just for your reference, the query "Find supplier name of suppliers who supply "red" parts'
in DRC is:
{ N | (Exists S,C)(suppliers(S,N,C) and (Exists P,Q)(supply(S,P,Q) and (Exists T)(parts(P,T,"red")))) }
or in a more flat form:
{ N | (Exists S,C,P,Q,T)(suppliers(S,N,C) and supply(S,P,Q) and parts(P,T,"red")) }