Question 1
Question text
The employee table contains EmployeeNumber, EmployeeName, Salary and DeptCode Columns. Which is the CORRECT SQL query to display DeptCode and average salary of each department? Choose most appropriate option.
Feedback
Question 2
Question text
Which is the CORRECT SQL Query to display names of employees which has only 3 letters that starts with 'A' and ends with 'e'? Choose most appropriate option.
Feedback
Question 3
Question text
Consider the table Student(StudentId, StudentName, Email, PercentageOfMarks). Which is the CORRECT query to display the details in the ascending order (lowest to highest) of PercentageOfMarks and in the descending order of StudentId in case PercentageOfMarks is the same. Choose most appropriate option
Feedback
Question 4
Question text
Feedback
Question 5
Question text
Feedback
Question 6
Question text
Which of the following about DELETE command in SQL is FALSE? Choose most appropriate option.
Feedback
Question 7
Question text
Identify the CORRECT SQL statement to create a table with composite primary key. Choose most appropriate option.
Feedback
Question 8
Question text
Feedback
Question 9
Question text
State True/False?
The names of the foreign key field and the referenced field(in parent table) may be same or different, but must have the same data type.
Feedback
Question 10
Question text
Which of the following statement(s) is/are TRUE?
(i) In a subquery, the inner query is responsible for giving result.
(ii) In a subquery, the outer query is responsible to display output.
Choose most appropriate option
Feedback
Question 11
Question text
Which of the following SQL commands is used to remove table "EMPLOYEE" present in the database? Choose most appropriate option.
Feedback
Question 12
Question text
Assume that table Project is created using the DDL statement given below and has no records.
CREATE TABLE Project( projectId VARCHAR2(4) CONSTRAINT proj_pk PRIMARY KEY, projectName VARCHAR2(10) DEFAULT 'NA' CONSTRAINT proj_nn NOT NULL);
Identify the INSERT statements which would successfully insert record into Project table. Choose two most appropriate options.
Feedback
Question 13
Question text
Feedback
Question 14
Question text
COMMIT;
DELETE FROM ASSET;
ROLLBACK;
INSERT INTO ASSET VALUES(5);
COMMIT;
What would be the output of the below SQL statement after executing the above statements sequentially.
SELECT COUNT(*) FROM Asset;
Feedback
Question 15
Question text
Feedback
Question 16
Question text
What will be the output of the following Java code?
public class ApplicationTesterChoose the most appropriate option.
{
public static void main(String[] args)
{
String s1 = "One";
String s2 = "One";
System.out.println((s1==s2) + " " + s1.equals(s2));
}
}
Feedback
Question 17
Question text
Feedback
Question 18
Question text
What will be the output of the following Java code?
public class RectangleChoose the most appropriate option.
{
private int length;
private int width;
public static void main(String[] args)
{
Rectangle rectangle1 = new Rectangle();
rectangle1.length=10;
rectangle1.width=5;
Rectangle rectangle2 = rectangle1;
System.out.println("Length : "+rectangle2.length);
System.out.println("Width : "+rectangle2.width);
}
}
Feedback
Question 19
Question text
What will be the output of the following Java code?
public class ApplicationTesterChoose the most appropriate option.
{
public static void main(String[] args)
{
int i=10;
while(++i<15)
{
System.out.print(i + " ");
}
}
}
Feedback
Question 20
Question text
What will be the output of the following Java code?
class StringSampleChoose the most appropriate option.
{
public StringSample(String string)
{
System.out.println("The string is " + string);
}
}
public class ConstructorTester1
{
public static void main(String[] args)
{
StringSample stringSample = new StringSample();
StringSample stringSample1 = new StringSample("Test String");
}
}
Feedback
Question 21
Question text
What will be the output of the following Java code?
public class StringTesterChoose the most appropriate option.
{
public static void main(String[] args)
{
String player1 = new String ("virat kohli");
String player2 = new String("GAYLE");
player1.toUpperCase();
String newPlayer=player1.substring(6);
newPlayer = newPlayer + player2.toLowerCase();
System.out.println(newPlayer);
}
}
Feedback
Question 22
Question text
Consider the Java code given below. How many times "1" will be printed when the code is executed?
public class ApplicationTesterChoose the most appropriate option.
{
public static void main(String[] args)
{
int i = -1;
while( ++i <= 1)
{
System.out.println("1");
i++;
}
}
}
Feedback
Question 23
Question text
What will be the output of the following Java code?
class EventChoose the most appropriate option.
{
static int eventId;
public static void main(String[] args)
{
Event e1=new Event();
e1.eventId=100;
Event e2=e1; e2.eventId=200;
Event e3=new Event();
System.out.println(e1.eventId+ " "+ e2.eventId + " "+ e3.eventId);
}
}
Feedback
Question 24
Question text
What will be the output of the following code:
public class TestChoose most appropriate option.
{
public static void main(String[] args)
{
int number=20;
switch(number)
{
case 10: System.out.println("10");
break;
case 20: System.out.println("20");
case 30: System.out.println("30");
break;
default:System.out.println("Not in 10, 20 or 30");
}
}
}
Feedback
Question 25
Question text
What will be the output of the following Java code?
public class IfTesterChoose the most appropriate option.
{
public static void main(String[] args)
{
int number1 = 10, number2;
if(number1 == 10)
{
number2 = 20;
}
if (number1 != 10)
{
number2 = 30;
}
System.out.println("Number2 :"+number2);
}
}
Comments
Post a Comment