Vous êtes sur la page 1sur 2

Class:XII-IIT COMPUTER SCIENCE Duration:11/2 hrs

MID-TERM III EXAMINATION Max Marks:35

1.Observe the following table and answer the parts(i) and(ii) accordingly [2]
Table:Product
Pno Name Qty PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011

(i).Write the names of most appropriate columns, which can be considered as candidate keys.
(ii).What is the degree and cardinality of the above table?
(b) Write SQL queries for (i) to (viii) and find outputs for SQL queries (ix) to (xii), which are based on the table: [10]
TRAINER :
TID TNAME CITY HIREDATE SALARY
101 SUNAINA MUMBAI 1998-10-15 90000
102 ANAMIKA DELHI 1994-12-24 80000
103 DEEPTI CHANDIGARG 2001-12-21 82000
104 MEENAKSHI DELHI 2002-12-25 78000
105 RICHA MUMBAI 1996-01-12 95000
106 MANIPRABHA CHENNAI 2001-12-12 69000
COURSE :
CID CNAME FEES STARTDATE TID
C201 AGDCA 12000 2018-07-02 101
C202 ADCA 15000 2018-07-15 103
C203 DCA 10000 2018-10-01 102
C204 DDTP 9000 2018-09-15 104
C205 DHN 20000 2018-08-01 101
C206 O LEVEL 18000 2018-07-25 105
(i)Display the Trainer Name, City & Salary in descending order of their Hiredate.
(ii)To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001.
(iii)To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE of all those courses whose
FEES is less than or equal to 10000.
(iv)To display number of Trainers from each city.
(v)To add a new column DURATION in to the table COURSE
(vi)Increase the salary of all trainers by 1000 whose city is MUMBAI OR DELHI.
(vii)To add a new row in to the table TRAINER with the values {107,’RANI’,’COCHIN’,’2000-08-12’,25000}
(viii)Display the trainer names starting with ‘M’ from the TRAINER table.
(ix) SELECT TID, TNAME, FROM TRAINER WHERE CITY NOT IN(‘DELHI’, ‘MUMBAI’);
(x) SELECT DISTINCT TID FROM COURSE;
(xi) SELECT TID, COUNT(*), MIN(FEES) FROM COURSE GROUP BY TID HAVING COUNT(*)>1;
(xii) SELECT COUNT(*), SUM(FEES) FROM COURSE WHERE STARTDATE< ‘2018-09-15’;
2(a) State Absorption Laws of Boolean Algebra and verify them using truth table [2]
(b) Draw the Logic Circuit of the following Boolean Expression using only NOR Gates : [2]
(A+B).(C+D)
(c) Reduce the following Boolean Expression to its simplest form using K-Map: [3]
E (U , V , Z , W ) =π (2 , 3 , 6 , 8 , 9 , 10 , 11 , 12 , 13 )
(d) Derive a Canonical SOP expression for a Boolean function G, represented by the following truth table : [1]
X YZ G(X,Y,Z)
0 00 0
0 01 0
0 10 1
0 11 0
1 00 1
1 01 1
1 10 0
1 11 1
3(a)Write the definition of a function Reverse(int Arr[], int N) in C++, which should reverse the entire content of the array Arr
having N elements, without using any other array. [2]
(b)Assume an array ‘S’ containing elements of a structure Student is required to be arranged in descending order of percentage.
Write a function in C++ to arrange the same with bubble sort, the array and its size be passed as parameter to the function.
Definition of structure Student is as follows: [2]
struct Student{
int sno;
float percent;};
(c)Write a user-defined function EXTRA_ELE(int A[ ], int B[ ], int N) in C++ to find and display the extra element in Array A.
Array A contains all the elements of array B but one more element extra. (Restriction: array elements are not in order)
Example If the elements of Array A is 14, 21, 5, 19, 8, 4, 23, 11 and the elements of Array B is 23, 8, 19, 4, 14, 11, 5 Then
output will be 21 [2]
(d)Write definition for a function TOPBOTTOM(int M[][5],int N,int M) in C++, which finds and displays sum of the values in
topmost row and sum of the values in bottom most row of a matrix M (Assuming the parameter N represents number of Row
and the parameter M represents number of Columns). [2]
(e)Write a function REVROW(int P[][5],int N, int M) in C++ to display the content of a two dimensional array, with each row
content in reverse order. [2]
(f)Write a user-defined function named Lower_half() which takes 2D array A, with size N rows and N columns as argument [2]
and prints the lower half of the array.
Eg: Input:
23150
71531
25781
01501
34915
Output:
2
71
257
0150
34915
(g)T[25][30] is a two dimensional array, which is stored in the memory along the row with each of its element occupying 2
bytes, find the address of the element T[10] [15], if the base address is 2500. [3]