Professional Documents
Culture Documents
Test Paper – 1
Table: GAMES
GCode GameName Number PrizeMoney ScheduleDate
101 Carom Board 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn Tennis 4 25000 19-Mar-2004
Table: PLAYER
PCode Name Gcode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
U
V
(c) Write the SOP form of a Boolean function G, which is represented in a truth table as follows:
1
P Q R G
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Fazz
Building
Jazz
Harsh Building
Building
Center to center distances between various buildings is as follows:
Harsh Building to Raj Building Raj 50 m
Raz Building to Fazz Building Building 60 m
Fazz Building to Jazz Building 25 m
Jazz Building to Harsh Building 170 m
Harsh Building to Fazz Building 125 m
Raj Building to Jazz Building 90 m
2.
TABLE : GRADUATE
S.NO NAME STIPEND SUBJECT AVERAGE DIV.
1 KARAN 400 PHYSICS 68 I
2 DIWAKAR 450 COMP. Sc. 68 I
3 DIVYA 300 CHEMISTRY 62 I
4 REKHA 350 PHYSICS 63 I
5 ARJUN 500 MATHS 70 I
6 SABINA 400 CEHMISTRY 55 II
7 JOHN 250 PHYSICS 64 I
8 ROBERT 450 MATHS 68 I
9 RUBINA 500 COMP. Sc. 62 I
10 VIKAS 400 MATHS 57 II
(a) List the names of those students who have obtained DIV 1 sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received in a year
assuming that the STIPEND is paid every month.
(c) To count the number of students who are either PHYSICS or COMPUTER SC graduates.
(d) To insert a new row in the GRADUATE table: 11,”KAJOL”, 300, “computer sc”, 75, 1
(e) Give the output of following sql statement based on table GRADUATE:
(i) Select MIN(AVERAGE) from GRADUATE where SUBJECT=”PHYSICS”;
(ii) Select SUM(STIPEND) from GRADUATE WHERE div=2;
(iii) Select AVG(STIPEND) from GRADUATE where AVERAGE>=65;
(iv) Select COUNT(distinct SUBDJECT) from GRADUATE;
(f) Assume that there is one more table GUIDE in the database as shown below:
Table: GUIDE
MAINAREA ADVISOR
PHYSICS VINOD
COMPUTER SC ALOK
CHEMISTRY RAJAN
MATHEMATICS MAHESH
g) What will be the output of the following query: SELECT NAME, ADVISOR FROM
GRADUATE,GUIDE WHERE SUBJECT= MAINAREA;
3. Write SQL command for (i) to (vii) on the basis of the table SPORTS
Table: SPORTS
Student NO Class Name Game1 Grade Game2 Grade2
10 7 Sammer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Venna Tennis C Tennis A
14 9 Archana Basketball A Cricket A
15 10 Arpit Cricket A Atheletics C
(a) Display the names of the students who have grade ‘C’ in either Game1 or Game2 or both.
(b) Display the number of students getting grade ‘A’ in Cricket.
(c) Display the names of the students who have same game for both Game1 and Game2.
(d) Display the games taken up by the students, whose name starts with ‘A’.
(e) Assign a value 200 for Marks for all those who are getting grade ‘B’ or grade ‘A’ in both Game1
and Game2.
(f) Arrange the whole table in the alphabetical order of Name.
(g) Add a new column named ‘Marks’.
4.
Employees
Empid Firstname Lastname Address City
010 Ravi Kumar Raj nagar GZB
105 Harry Waltor Gandhi nagar GZB
152 Sam Tones 33 Elm St. Paris
215 Sarah Ackerman 440 U.S. 110 Upton
244 Manila Sengupta 24 Friends street New Delhi
300 Robert Samuel 9 Fifth Cross Washington
335 Ritu Tondon Shastri Nagar GZB
400 Rachel Lee 121 Harrison St. New York
441 Peter Thompson 11 Red Road Paris
EmpSalary
1. Write the SQL commands for the i) to iv) and write the output of the (v) on the basis of table TEACHER.
Table:TEACHER
TABLE: EMPLOYEE
TABLE: SALARIES
i. Display EMPNAME of all staff who are in “ACCOUNTS” having more than 10 years experience
from the table EMPLOYEE.
ii. Display the average PAY of all staff working in “INSPECTION” department using the tables
EMPLOYEE and SALARIES. The total pay is calculated as PAY= SALARY +INCENTIVE+
ALLOWANCE.
iii. Display the minimum INCENTIVE of female staff.
iv. Display the highest ALLOWANCE among all male staff.
v. SELECT count (*) from EMPLOYEE where SEX = “F”.
vi. SELECT EMPNAME, SECTION, ALLOWANCE from EMPLOYEE, SALARIES where SECTION
= “ACCOUNTS” and EMPLOYEE.EMPID = SALARIES.EMPID.
vii. SELECT EMPNAME from EMPLOYEE where SECTION= INSPECTION and SEX=’M’
viii. Select count (distinct SECTION) from EMPLOYEE
COURSES
C_ID F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer 8000
Security
C24 106 Human Biology 15000
C25 102 Computer 20000
Network
C26 105 Visual Basic 6000
C27 107 Dreamweaver
4000
(i) To display details of those Faculties whose date of joining is before 31-12-2001.
(ii) To display the details of courses whose fees is in the range of 15000 to 50000
(both values included).
(iii) To increase the fees of Dreamweaver course by 500.
(iv) insert new column in a COURSES named Level with String type..
(v) Select COUNT(DISTINCT F_ID) from COURSES;
(vi) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID =FACULTY.F_ID;
(vii) Select SUM(Fees) from courses Group By F_ID having count(*) > 1;
(viii) Select Fname, Lname from FACULTY Where Lname like “M%”;
8. Consider the following relation TEACHER and SALARY. Write SQL commands for the statement (i) to (iv)
and output from (v) to (viii).
6
TABLE: TEACHER
TID FIRST_NAME LAST_NAME ADDRESS SUBJECT
010 Rohit Sharma 83, Lok Vihar English
105 Meeta Rathi 842, Rajauri Garden Physics
152 Seema Verma 33, Safdarganj Maths
215 Sarad Singh 440, Ashok Vihar Physics
244 Manish Sengupta 24, New Street Maths
300 Ram Gupta 9, Fifth Road Chemistry
355 Heena Jain 12, Friends Street Computer
400 Rachit Sharma 10, Paschim Vihar Computer
441 Punit Jain 11, Rohini Chemistry
TABLE: SALARY
Table: ISSUES
Book_ID Qty_Issued
L02 13
L04 5
L05 21
Table: BOOKS
(i) To show Book name, Author name and Price of books of ABC publisher.
(ii) To display the details of the books in descending order of their price.
(iii) To decrease the Qty_Issued from ISSUES table by 3 (all rows must decrease).
(iv) To display the Book Id, Book name, Publisher, Price, Qty, Qty_Issued from both the tables with their
matching Book ID.
(v) SELECT sum(price) FROM Books WHERE Publisher = “DEF”;
(vi)SELECT Publisher, min(price) FROM Books GROUP BY Publisher;
(vii)SELECT Price from Books, Issues where Books.Book_ID=Issues.Book_ID AND Qty_Issued=5;
(viii)SELECT Count(Distinct Publisher) FROM Books;
P Q R (G)
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 0
26. Write the equivalent Boolean expression for the following Logic Circuit:
27. Write the equivalent Boolean expression for the following Circuit
28. For the given truth table, give canonical sum-of-products(SOP) and canonical product-of- sum
(POS) expression
X Y Z F o/p
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
29. Write the principal of Duality and write the dual of the Boolean Expression:
(B` + C) + A`
a
b
32. Write the equivalent Boolean expression for the following logic circuit.
33. Express the F(X,Z)=X+X’Z into canonical SOP form.
34. Write the equivalent canonical POS expression for the following SOP expression: F(x,y,z)=Σ(0,2,5,6)
1. Knowledge Supplement Organization has set up its new centre at Manglore for its office and web
based activities. It has four buildings as shown in the diagram below:
Alpha Gamma
Lambda
Beta
UP LUCKNOW
Sales
Head
offic e
offic e
Prod
offic e
Varanasi Kanpur
offic e Saharanpur offic e
offic e
as follows :
An approximate distance between these offices as per network survey team is as follows:
Place from Place to Distance
Head office Sales office 15 KM
Head office Prod office 8 KM
Head office Varanasi Office 295 KM
Head office Kanpur Office 195 KM
Head office Saharanpur office 408 KM
Number of computers :
4. Dr. Rizvi Education Society of India is starting its new CBSE School in Mumbai (Maharashtra). The
society is already running a School in Jaunpur (UP) named Dr. Rizvi Learners’ Academy, having 3
major buildings in 2 km area campus. As a network expert you need to suggest the network plan as per
E1 to E4:
Wire Distance Between Various Buildings:
E1. Suggest the cable layout among various buildings inside school campus for connecting the
buildings.
E2. Suggest the most suitable place to house the server of the school with a suitable reason.
E3. Suggest an efficient device from the following to be installed in each of the building to connect
all the computers:
(i) Bridge (ii) Repeater (iii) Switch
E4. Suggest the most suitable service (very high speed) to provide data connectivity between Rizvi
Learners’ in Jaunpur and Mumbai CBSE School from the options
5. Knowledge Supplement Organization has set up its new center at Mangalore for its office and web
based activities. It has 4 blocks of buildings as shown in the diagram below.
Block B
Block C Block D
2. In Hyderabad, 5 ABC Bank branches are available. One is at RR Pet, other at Market, other at Ashok
Nagar, other at Fire Station and the last one at Bus Stand. Higher official want to keep a network
between these 5 branches. The branch names(A to E) and the number of computers
3.
in each branch(given inside the rectangle) is given below. Distance between
various buildings
A to B 50 Mts
B to C 30 Mts
C to D 30 Mts
D to E 35 Mts
E to C 40 Mts
D to A 120 Mts
D to B 45 Mts
E to B 65 Mts