Answer:
a) SELECT COUNT(*)
FROM Supplies
WHERE sid=T OR sid=X;
b) SELECT sid
CASE
WHEN sid=IMB AND pid=T
THEN 'YES'
ELSE 'No'
END AS 'check'
FROM Supplies
c) SELECT pid
WHERE partname != computers
FROM Parts
LEFT JOIN Supplies
ON Parts.pid=Supplies.pid;
d) SELECT color
FROM Parts
WHERE pid=T;
Step-by-step explanation:
a) Here we will use aggregate function along with WHERE and operators to count for specifc part ids
b) This is a CASE query
c) This is again a case query but invloves two separate tables. So, here 1st required values from 1st table are selected and then table is joined with the other table using OUTER JOIN
d) This is again a CASE query. It can be written by calling upon the all the values in one column corresponding to values in another column