Page 119 - C++
P. 119

(iv) To display each subject’s details along with Total_Marks in each subject from the table SUBJECT.
        (Total_Marks = Marks_Theory + Marks_Practical).

        Ans:i) select title from subject where  marks_prac=0;
        ii) select sub_code, count(*) from teacher group by sub_code;
        iii) select name from teacher order by sub_code;
        iv) select code, title, marks_theory+marks_prac “Total Marks” from subject;

        (c) Write SQL statement to display eache teacher’s name along with his/her respective subject name from the
        tables TEACHER and SUBJECT
        Ans: select name, title from teacher, subject where teacher.sub_code = subject.code;

        d) Give output:
        i) SELECT DISTINCT(Marks_Theory) from SUBJECT;
        (ii) SELECT TCode, Name from Teacher where Sub_Code like ‘0%’;

        Ans:i)   Distinct(Marks_Theory)
                       100
                       70

        Ans ii)        TCode         Name
                       3             Supatra
                       4             Shabnam
                       5             Rashika
                       6             Vidushi
                       7             Yash


        6(a) State the dual of the absorption law X+X.Y = X and prove it algebraically.
        Ans: x+ x.Y=y
        Dual x.(x+y)=y
        Algebraic proof
        x.(x+y)  => x.x+x.y  => x+x.y  =>x(1+y)  => x .1  => x

        (b) Draw the logic diagram for the Boolean expression X.(Y’+Z) using basic logic gates.

        Ans:










        Ans:

        (c) Write the SOP form of the Boolean function F(P,Q,R) = Σ(0,2,3,5).
        Ans:           0             2             3              5
                       000           010           011            101
        F(P,Q,R)=       (p’+q’+r’) .   (p’+q+r’) .    ( p’+q+r) .   (p+q’+r)

        (d) Find the simplified expression for the following Boolean function using Karnaugh’s map: F(A, B,
        C, D) = Σ(0,1,2,4,5,6,8,9,10)

        Ans:           4 quads
                       F(A,B,C,D)=(A’+C’) .(B’+C’). (B’+D’).(A’+D’)
   114   115   116   117   118   119   120   121   122   123   124