Skip to main content

Accenture TFA Quiz | Part 1

 

Question 1

Correct
Marked out of 1
Flag question

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.

Select one:
 

Feedback

Question 2

Correct
Marked out of 1
Flag question

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.

Select one:
 

Feedback

Question 3

Correct
Marked out of 1
Flag question

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

Select one:
 

Feedback

Question 4

Incorrect
Marked out of 1
Flag question

Question text

Which of the following statement(s) is/are TRUE?
(i) In a non-correlated(independent) subquery, the subquery is always executed only once.
(ii) In a non-correlated(independent) subquery, the inner query (sub query) references the column from the outer query (main query).
Choose most appropriate option

Select one:
 

Feedback

Question 5

Correct
Marked out of 1
Flag question

Question text

Which of the following is CORRECT about DELETE command?
a) It can delete single or multiple columns from a table
b) It can delete single or multiple records from a table
c) Records deleted can be roll backed.
Choose most appropriate option.

Select one:
 

Feedback

Question 6

Incorrect
Marked out of 1
Flag question

Question text

Which of the following about DELETE command in SQL is FALSE? Choose most appropriate option.

Select one:
 

Feedback

Question 7

Correct
Marked out of 1
Flag question

Question text

Identify the CORRECT SQL statement to create a table with composite primary key. Choose most appropriate option.

Select one:
 

Feedback

Question 8

Incorrect
Marked out of 1
Flag question

Question text

Which of the following can be created as a table level constraint?
(i) primary Key
(ii) foreign key
(iii) unique
Choose most appropriate option.

Select one:
 

Feedback

Question 9

Correct
Marked out of 1
Flag question

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.

Select one:
 

Feedback

Question 10

Correct
Marked out of 1
Flag question

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

Select one:
 

Feedback

Question 11

Correct
Marked out of 1
Flag question

Question text

Which of the following SQL commands is used to remove table "EMPLOYEE" present in the database? Choose most appropriate option.

Select one:
 

Feedback

Question 12

Correct
Marked out of 1
Flag question

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.

Select one or more:
 
 
 

Feedback

Question 13

Incorrect
Marked out of 1
Flag question

Question text

Consider table Customer(cid NUMBER(4), cname VARCHAR2(10) ) is created in the database and has no records. Refer to the below statements.  
 COMMIT; 
INSERT INTO Customer VALUES(101,’John’); 
INSERT INTO Customer VALUES(102,’James’); 
DELETE FROM Customer WHERE cid=101; 
INSERT INTO Customer VALUES(103,’Mark’); 
ROLLBACK; 
COMMIT;   
How many records will be available in the customer table if the above statements are executed in sequential order.   Choose the most appropriate option.
Select one:
 

Feedback

Question 14

Correct
Marked out of 1
Flag question

Question text

Assume that table Asset(assetId number(2)) is created and 2 records are already inserted and saved.

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;
Select one:
 

Feedback

Question 15

Incorrect
Marked out of 1
Flag question

Question text

Consider the following tables:
Vendor (VendorId, VendorName, PhoneNumber). Here VendorId is the primary key.
Item (ItemCode, UnitPrice, QuantityOnHand, VendorId) Here ItemCode is the primary key and VendorId is the foreign key referencing the VendorId in Vendor Table.
 
Which is the CORRECT SQL query to display ItemCode, UnitPrice, VendorName for all Items. It should also display the details of the Item which is not having any vendor?
Choose most appropriate option
Select one:
 

Feedback

Question 16

Incorrect
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class ApplicationTester 
{
public static void main(String[] args)
{
String s1 = "One";
String s2 = "One";
System.out.println((s1==s2) + " " + s1.equals(s2));
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 17

Correct
Marked out of 1
Flag question

Question text

Which of the following statement/s is/are TRUE?
(1) Abstract method can have body
(2) Abstract class cannot be instantiated
(3) Abstract class can have constructor
Choose the most appropriate option.

Select one:
 

Feedback

Question 18

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

 public class Rectangle 
{
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);
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 19

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class ApplicationTester 
{
public static void main(String[] args)
{
int i=10;
while(++i<15)
{
System.out.print(i + " ");
}
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 20

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

class StringSample 
{
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");
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 21

Incorrect
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class StringTester 
{
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);
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 22

Correct
Marked out of 1
Flag question

Question text

Consider the Java code given below. How many times "1" will be printed when the code is executed?

 public class ApplicationTester 
{
public static void main(String[] args)
{
int i = -1;
while( ++i <= 1)
{
System.out.println("1");
i++;
}
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 23

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

 class Event
{
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);
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 24

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following code:

public class Test 
{
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");
}
}
}
Choose most appropriate option.

Select one:
 

Feedback

Question 25

Incorrect
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class IfTester
{
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);
}
}
Choose the most appropriate option.

Select one:
 

Feedback

Comments

Popular posts from this blog

Classes and Objects | Accenture TFA

  Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text ___ and _____ are the access specifiers that can be applied to top level Class. Select one or more: public   protected default   private Feedback Your answer is correct. The correct answers are: default, public Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text class Sample{      private double num = 100;    private int square(int a){ return a*a;    } }   public class Test{    public static void main(String args[]){   Sample obj = new Sample();   System.out.println(obj.num);  System.out.println(obj.square(10));    }   } Select one: Compile time error   Run time error Executes but no output 100 Feedback Your answer is correct. The correct answer is: Compile time error Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text Choose the appropriate access specifier for the attribute value so that it can be accessed from anywhere. class Test { Choose... private protected public d

Spot Round

Never ever give up !!! “Life is a journey with up and downs” Feeling happy when everything is right is natural, but feeling sad for something gone wrong can’t be justified. Many say miracle doesn’t happen, but a miracle is something that doesn’t have logic… Do you believe in miracles? So, stop seeing logic everywhere and then you can feel miracles. I want to share something… During my counselling for Bachelor’s degree till last round, I was unable to get a seat in college I want to study in. It felt like everything has gone. Then I heard about Spot Round. I was not sure to secure a seat. But I went there to try my luck, in a hope of a miracle. So, I kept ready all my necessary documents made a DD for this round. While I was going to reporting centre my mind was full of the variety of thoughts. I made a mistake and I was little late for reporting. So, I rushed up through check-in and register myself for this special round. Then I went to a hall where everyone

Certificates Format JoSAA 2018

Certificates Format JoSAA 2018 JoSAA certificate formats  required at time of documents verification at reporting centres are released and must download them from here... Click the  JoSAA certificate formats  and you will get the certificate you want for JoSAA. You can download required formats from this page. Do check for these documents before leaving your place... Click here to get the checklist for JoSAA counselling documents verification... Know more about first-round result 2018... Certificates Format JoSAA 2018 Format for Document Verification For admission to IITs and ISM The format for Document Verification For admission to IITs and ISM is given below. You will have to follow this pattern for JoSAA document Verification, click here to download... Format for Document Verification For admission to NITs, IIITs and Other-GFTIs For admission to NITs, IIITs and Other-GFTIs candidates will have to verify their documents and here is the format