90 Informatics Practices
90 Informatics Practices
INFORMATICS PRACTICES
Instructions :
(iv) Q.3, Q.5 and Q.6 have to be answered with respect to MySQL.
90 1 P.T.O.
1. (a) (i) Out of the following Networks, which one is LEAST likely to
be a WAN (Wide Area Network) ?
Internet, Branches of a Bank, Network within a School
(ii) Name one Communication Media used in WAN. 2
(b) A College has a network that has to be used by the management
only. Explain 2 methods used to ensure that only a few authorized
people are allowed access to that network. 2
(c) Name the unique address consisting of a 12-digit hexadecimal
notation, assigned to a network card that identifies the Network
Card. What are the two main components of this address ? 2
(d) Explain in brief any two freedoms offered by open source software. 2
(e) Write one point of similarity and one point of difference between
ASCII and Unicode. 2
90 2
(e) What will be displayed in jTextField1 and jTextField2 ? 2
int x,y,z,t;
x = 7;
y = 10;
z = x+y*6;
t = x + y;
jTextField1.setText(""+z);
jTextField2.setText(""+t);
(f) Write the output that will be displayed on jLabel1 and jLabel2. 2
String a,b,c,d,x;
a="Computers";
b="are";
c="really";
d="interesting";
int e = a.length()/3+b.length()*2;
x=b+c+d;
x=a.concat(x);
jLabel1.setText("The value of e ="+ e);
jLabel2.setText(x.toUpperCase());
90 3 P.T.O.
(c) (i) Name any 2 Group/Aggregate functions used in MySQL.
Abhay wants to know the number of Students who took the test. He
writes the following SQL statement to count Studentid without
duplicates. However the statement has error(s). Rewrite the correct
statement. 2
(e) Naman is using the following SQL statement to delete the row for
ROOMID = 15 from the table ‘‘ROOM’’
90 4
(f) Consider the following table ‘Student’ 2
Table : Student
RNO NAME PHONE AGE CITY
1 Ramesh Kumar 934578912 18 Bengaluru
2 Amit Singh 980452317 18 Mumbai
3 Niharika Yadav 934512367 20 Delhi
4 Timi Anand 911984334 18 Mumbai
5 Shoaib Khan 876534902 20 Bengaluru
6 Aman Malik 981178655 18 Delhi
Write SQL queries to
(i) Create a point SP1 in a transaction such that you can roll the
transaction back to SP1 without rolling back the entire
transaction in case of failure.
(ii) Increase AGE in every row by 2.
OR
Insert a new row in the table with appropriate values.
(iii) Undo (Cancel) the changes made in the table, that is, Roll the
transaction back to SP1.
int z;
z = 0;
char code;
code = ‘w’;
switch (code)
{
case ‘w’ : z = z+1;
case ‘r’ : z = z+2;
break;
case ‘s’ : z=z +3;
break;
default : z = z+4;
}
OR
What happens if break statement is omitted with a case in switch
statement ?
int K = 7;
int I = -2;
while (I <= K) {
I = I + 2;
K=K-1;
}
OR
What different values will the variable I take when the ‘while’ loop
is executed ?
90 6
(d) The following code has error(s). Rewrite the correct code underlining
all the corrections made : 2
int A assigned 3;
int I, sum = 0;
for {I = 1, I<=5, I=I+1}
{
A = A-2
sum = sum +2;
}
(e) Write the output that will be displayed in jTextField1 : 2
int i,j,k;
i = 30;
j = 10;
k = 0;
do
{
i = i - 5;
k = k + i;
}
while (i > j);
jTextField1.setText(""+k);
(f) Ms. Priya works for a school. She is motivating the students of her
school to drink more water daily. She has created an interface. A
screenshot of the same is shown below :
90 7 P.T.O.
The student has to enter weight in kg and how much exercise
(No/Less/Moderate/Heavy) is done by him/her.
90 8
5. Consider the table given below. Write SQL queries for (i) to (viii) and
output for (ix) and (x)
Table : Gym
REGID NAME PREWEIGHT CURRWEIGHT DOJ GENDER BRANCH
Table : DRIVER
DRIVERID DRIVERNAME DRIVERGRADE PHONE
(i) Can the column ‘PHONE’ be set as the primary key of the
table DRIVER ? Give reason(s). 1
OR
Identify the Primary key in the table ‘DRIVER’. Give
reason(s) for your choice.
(ii) In the PHONE column of ‘‘DRIVER’’ table, each phone
number is taking same number of bytes (being padded with
spaces to specified length) irrespective of the number of
characters actually stored in that column. Which data type
has been used for PHONE column ? 1
OR
Identify data type and size to be used for column DRIVERID.
90 10
(c) With reference to the above given tables (in Q6 b), write commands
in SQL for (i) to (iii) :
(i) To display OrderId, Item being transported, DriverId and
names of Drivers for all the orders that are being transported
by drivers with ‘A’ grade. 2
(ii) To display DriverId, Names of drivers and Travel dates for
drivers who are travelling after 1st March, 2019. 2
OR
How many rows will be there in Cartesian product of the two
tables in consideration here ?
(iii) To display OrderId, DriverId and names of Drivers for all the
orders that are transporting TELEVISION. 2
S.No. Function
90 11 P.T.O.