12 It
12 It
-1-
13) A column or a group of columns which is not selected as the primary key of a relation is
called a ______.
V State whether the statement is true or false: -
14) Select database() command displays list of databases available on the current server.
(True/False)
15) int x=9, k=0;
int y=10;
y=++x;
x+=y;
k=x;
Value of k will be 20 (True/False)
VI Very Short Answer Type questions: -
16) The following code has error(s). Rewrite the correct code underlining all the corrections
made :
int n=15,
int i=10,x=1;
do;
{
x=x*i;
i++;
while[i<=n]
jTextField1.settext(""+x);
17) Differentiate between = and == operator in JAVA
18) What is the MYSQL command to list the names of teachers in alphabetical order in the
teacher table? Write the command to see the structure of teacher table?
19) The following commands are giving errors. Write the correct MYSQL commands.
(a) alter table student delete marks; (b) select * from employee where name =‘%s%’;
20) What are variables? What are the rules to be followed while naming a variable. Give one
example.
VII Short Answer Type questions:-
21 Write a code in java using for loop to display all even numbers between 1 to 20. Is while
loop an entry controlled loop or exit control loop?
22) (a) Give any two characteristics of a relational model.
(b) Which aggregate function is used to find the average of all the values for a selected
attribute of a table.
23) State the similarity and difference between the Primary Key, Candidate Key, Alternate
Key.
24) (a) Mention at least 2 work areas which uses Database Management Systems.
(b) Jatin has given the following query from the table Student but he is unable to
execute it successfully. Write the correct query after rectifying the error
Select Name, Marks From student Table Where Name =P%
VIII Long Answer Type questions:-
25) Write the MySQL commands for the following queries :-
TABLE – SCHOOL
REG. NO NAME CLASS AVERAGE
1001 ANKIT 12A 87.6
1002 ISHAN 12C 76.8
1003 BABITA 12J 54.0
1004 SUPARNA 12F 53.4
i) Display record of student studying in class 12A.
ii) Display names of students whose name starts with alphabet ‘B’.
iii) To count distinct class from the table school.
(iv) To update marks of all the students by 5%.
(v) Display details of students who scored between 60 and 80.
26) Define all users of DBMS.
-2-
27) Consider the following table and write SQL statements
Table Menu
ID Item Description Price
P001 Sambar Vada South Indian 40
P002 Dal Makhani North Indian 150
P003 Noodles Chinese 100
P004 Idli Sambar South Indian 50
P006 Sarson Saag North Indian 170
P007 Dosa South Indian 120
P008 Pizza Italian 200
i. To display items of the menu description wise
ii. Display details of all Menu items in the descending order of Price
iii. Display Item and Description of those Items whose price is between 100 and 150
iv. To count no. Of items of each description
28) Write a program in java using while loop, do while and for loop to display square of every alternate
number from 20 to 1.
29) Draw and label diagram of motherboard and its components, also list functions of each component.
30) Create a GUI application to obtain principal amount, time and rate from the user in the
appropriate text fields and then calculates the simple interest as per the following
specifications:
(If principal amount is greater than 25000, then rate of interest is 8% otherwise it is 6%).
*****************
-3-