A table T1 in a relational database has the following rows and columns
The following sequence of SQL statement was successfully executedon Table T1.
Update T1 set Balance = Balance + 7000;
Select AVG (Balance) from T1;
What is the output of the select statement?
-
Solution
19500
UPDATE T1 Set Balance = Balance + 7000;
This will result in following table.Select AVG (Balance) from T1.
AVG(Balance)=\(\frac{12000+17000+22000+27000}{4}=\frac{78000}{4}=19500\)
(We divide by 4 because COUNT (*) ignore NULL values in the column)
In a binary min heap containing n-numbers the largest element can be found in time
-
Solution
o find largest element in min heap it require O(n) time because it will find largest element in last.
Assume that the operators +, – and * are left associative and Λ is right associative the order of precidence from lowest to highest is –, +, * and V. The infix expression corrospond to given prefix expression abc*+defΛΛ- is
-
Solution
abc*+defΛΛ-
abc*+(deΛfΛ-)
(ab*c)+(dΛeΛf-)
a+b*c-dΛeΛf
Consider the following set of processes with the length of CPU burst given in mili second :
The processes are assumed to have arrived in the order P1,P2, P3, P4, P5 at time 0, 1, 2, 3, 4 respectively. The average waiting time of processes in priority scheduling is _____
-
Solution
Waiting time of P1 = 9 – 3 – 0 = 6
Waiting time of P2= 1 – 1 = 0
Waiting time of P3= 19 – 2 = 17
Waiting time of P4= 17 – 3 = 14
Waiting time of P5= 4 – 4 = 0Average waiting time =\(\frac{6+0+17+14+0}{5}\)= 7.4 ms
For TCP connection establishment, three way handshaking is used as shown in figure.
What will be the value of x and y,respectively?
-
Solution
Since, server has sent ACK = 4001, so client will sent next frame with sequence number = 4001, and client will ask for the next frame to the server by sending ACK = 9501.
Average time required to perform a successful sequential search for an element in an array A(1 : n) is
-
Solution
Average time required to perform a successful sequential search for an element in an array
A(1 : n) is \(\frac{(n+1)}{2}\)
Which one of the following propositional form is a tautology?
-
Solution
p ⇒ (p v q) is a tautology. As
Consider the following regular expression
R = (ab|abb)* bbab
Which of the following strings is not in the set denoted?
-
Solution
ababab is not in set denote by R as in Revery string must end with bbab.
Consider the following grammar :
S→PQ
Q→+S|∈
P→*|id
In the predictive parsing table M, the entries M[S, *] and M[Q, S] are
-
Solution
Predictive parsing table is :
Consider the alphabet ∑={0,1}, the null, empty string λ and the sets of strings X0, X1 and X2 generated by the corresponding non-terminals of regular grammar. X0, X1 and X2 are related as follows :
X0= 1X1; X1= 0X1+ 1X2; X2= 0X1+ {λ}
Which one of the following choices precisely represents the strings in X0?
-
Solution
All strings are starting with 1 with min string 11, which can be generated by 1(0* + 10)*1