Beruflich Dokumente
Kultur Dokumente
(d) What will be displayed in jTextArea1 after the following code is executed: 1
int i;
for(i=10;i<50;i=i+30)
{
i=i+15;
jTextArea1.append(""+i);
}
jTextArea1.append("\n"+i);
If there are 10 rows in ‘Emp’ table and 5 rows in ‘Department’ table, How many rows 1
will be displayed by the following query?
SELECT * FROM Emp, Department;
Write the term used for the Join being used on the two tables mentionedabove.
(e) Given below is HTML code. Rewrite the correct code underlining all the corrections 2
done.
<ol type = “A” start="D">
<li>Bake in oven for an hour
<li>Remove from oven
<li>Serve
2 (a) What is the purpose of SQL? 1
(b) Mr. Manav, a database administrator in “Global Educational and Training Institute” has 4
created following table named “Training” for the upcoming training schedule:
i. To display SID, Names along with Salaries increased by 500. (Increase of Rs.500 is
only to be displayed and not to be updated in the table),
ii. Display names of Salespersons and their Salaries who have salaries in the range
30000.00 to 40000.00.
iii. To list names, phone numbers and DOB (Date of Birth) of Salespersons who were
born before 1 st November, 1992.
iv. To display names and salaries of salespersons in descending order of salary.
v. To display areas in which Salespersons are working. Duplicate areas should not be
displayed.
(b) Consider the tables given below and answer the question that follows. 8
(e) 1
(f) 2
(c) Anju, a beginner in java programming has written following code with some 2
mistakes:
int k=0;
string s="Save Earth";
int l=s.length;
for(int i=0;k<l;i++)
{
jTextArea1.append(s+\n);
k++;
};
Help her in identifying and correcting the errors.
Convert the correct code into do while looping statement.
(d) Rewrite the following code using while loop: 2
int i,j;
for(i=1,j=2;i<=6;i++,j+=2)
System.out.println(i++);
System.out.println(“Finished!!!”);
(e) Explain the purpose of pow() method with the help of suitable java code. Also 2
mention that pow() method belongs to which class?
(f) Distinguish between isSelected( ) and setSelected( ) methods of java with the help of 4
example.
G What will be displayed in jTextField1 and jTextField2 when the following code is
executed?
Int x,y,z,t;
X=3;
Y=8;
Z=x+y/8;
T=z++;
jTextField1.setText(“”+z);
jTextField2.setText(“”+t;)
What will be displayed in jTextField1 and jTextField2 when the following code is
executed?
Int x,y,z,t;
T=3;
Z=0;
Do{
Z=z+1;
}
While(t>3)
jTextField1.setText(“”+z);
jTextField2.setText(“”+t;)
Write the output that will be displayed on jlabel1 and jlabel2.
Stirng a,b,c,d,x;
A=”Keep”;
B=”your”;
C=”surroundings”;
D=”clean”;
Int e=b.length()/4+d.length()*2;
X=b+c+d;
X=a.concat(x);
Jlabel1.setText(“The value of e =”+e);
jLabel2.setText(x.toUpperCase());
Table student has the column RNO and Score.It has 3 rows init.Following two SQL
statement were entered that produced the output ( AVG(SCORE) AS 45 AND
COUNT(SCORE) AS 2):
DATA is SCORE column is same in two rows. What data is present in the SCORE
coloumn in the rows?
What will displayed in jtextField1 when the following code is executed?
Int x=3,y=6,z=0;
If(x>3)
Z=z+1;
Z=z+3;
If(x<3 | y>6)
Z=z+4;
jTextField1.setText(“ “+z);
Write the output in jTextField1 when the following code is executed
Int k,n,sum=0;
For(k=2; k<=5; k++)
{
N=k-2*3;
Sum=sum+n;
}
jTextField.setText( “ “+sum);