Observe the following table carefully and write the names of the most appropriate columns, which can be considered as (i) candidate keys and (ii) primary key.
Id | Product | Qty | Product | Transaction Date |
101 | Plastic Folder 12 inch | 100 | 3400 | 2014-12-14 |
104 | Pen Stand Standard | 200 | 4500 | 2015-01-31 |
105 | Stapler Medium | 250 | 1200 | 2015-02-28 |
109 | Punching Machine Big | 200 | 1400 | 2015-03-12 |
103 | Stapler Mini | 100 | 1500 | 2015-02-02 |
Consider the following DEPT and WORKER tables. Write SQL queries for (i) to(iv) and find outputs for SQL queries (v) to (viii):
Table: DEPT
DCODE | DEPARTMENT | CITY |
D01 | MEDIA | DELHI |
D02 | MARKETING | DELHI |
D03 | INFRASTRUCTURE | MUMBAI |
D05 | FINANCE | KOLKATA |
D04 | HUMAN RESOURCE | MUMBAI |
Table: WORKER
WNO | NAME | DOJ | DOB | GENDER | DCODE |
1001 | George K | 2013-09-02 | 1991-09-01 | MALE | D01 |
1002 | Ryma Sen | 2012-12-11 | 1990-12-15 | FEMALE | D03 |
1003 | Mohitesh | 2013-02-03 | 1987-09-04 | MALE | D05 |
1007 | Anil Jha | 2014-01-17 | 1984-10-19 | MALE | D04 |
1004 | Manila Sahai | 2012-12-09 | 1986-11-14 | FEMALE | D01 |
1005 | R SAHAY | 2013-11-18 | 1987-03-31 | MALE | D02 |
1006 | Jaya Priya | 2014-06-09 | 1985-06-23 | FEMALE | D05 |
Note : DOJ refers to date of joining and DOB refers to date of Birth of workers.
(i) SELECT Wno,Name,Gender FROM Worker
ORDER BY Wno DESC;
(ii) SELECT Name FROM Worker
WHERE Gender=’FEMALE;
(iii) SELECT Wno, Name FROM Worker
WHERE DOB BETWEEN ‘19870101’ AND ‘19911201;
(iv) SELECT COUNT(*) FROM Worker
WHERE GENDER=’MALE’ AND DOJ > ‘19860101;
(v)
COUNT(*) | DCODE |
2 | D01 |
2 | D05 |
(vi)
Department |
MEDIA |
MARKETING |
INFRASTRUCTURE |
FINANCE |
HUMAN RESOURCE |
(vii)
NAME | DEPARTMENT | CITY |
George K | MEDIA | DELHI |
Ryma Sen | INFRASTRUCTURE | MUMBAI |
(viii)
MAX (DOJ) | MIN (DOB) |
20140609 | 19841019 |
Derive a Canonical SOP expression for a Boolean function F, represented by the following truth table :
A | B | C | F(A,B,C) |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Reduce the following Boolean Expression to its simplest form using Kâ€Map :
F(X,Y,Z,W) = ∑(0,1,6,8,9,l0,11,12,15)
Illustrate the layout for connecting 5 computers in a Bus and a Star topology of Networks.
Out of the following, which is the fastest (i) wired and (ii) wireless medium of communication?
Infrared, Coaxial Cable, Ethernet Cable, Microwave, Optical Fiber