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

Must Read:

Programming using Java Hands On - Control Structures | Bill Generation

Bill Generation Tom went to a movie with his friends in a multiplex theatre and during break time he bought pizzas, puffs and cool drinks.  Consider   the following prices :  Rs.100/pizza Rs.20/puffs Rs.10/cooldrink Generate a bill for What Tom has bought. Sample Input 1: Enter the no of pizzas bought:10 Enter the no of puffs bought:12 Enter the no of cool drinks bought:5 Sample Output 1: Bill Details No of pizzas:10 No of puffs:12 No of cooldrinks:5 Total price=1290 ENJOY THE SHOW!!! Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 6 tests run/ 6 tests passed | +------------------------------+

Programming using Java Hands On - Control Structures | Print Customer Details

Print Customer Details Help Mr.Ben who is a programmer, in developing a registration form on console. Customers will not just input data, but also view the details once he/she finishes the registration.  Sample Input 1: Enter your name:Jany Enter age:25 Enter gender:Female Hailing from:Mexico Sample Output 1: Welcome, Jany Age:25 Gender:Female City:Mexico Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 5 tests run/ 5 tests passed | +------------------------------+

Accenture TFA Quiz | Part 2

  Question  26 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[] array = {11,22,33,44,55,11}; int searchNumber = 11, position=999; for(int index=0; index < array.length; index++) { if(searchNumber == array[index]) { position = index; } } System.out.println(position); } } Choose the most appropriate option. Select one: a.  0 b.  5   c.  1 d.  6 Feedback The correct answer is: 5 Question  27 Incorrect Marked out of 1 Flag question Question text Predict the line of code Abstract class Base1 { protected void getDetails() { System.out.println("Base method"); } public Abstract void demomethod(); } Abstract class Base2 extends Base1 { public Abstract void samplemethod(); } class Derived extends Base2 { //Line1 } Select one: ...

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD 2

  Generate XSD 2 Generate XSD for the following XML document <?xml version="1.0" encoding="UTF-8"?> <!--  <!DOCTYPE  hotels  SYSTEM "hotel.dtd"> --> <hotels> <hotel> <ID>1</ID> <Name> TAJ GANJ </Name> <Stars>3</Stars> <Facilities>Restaurant,Parking,Internet</Facilities> <Address>Taj Ganj,FFatehabad Road Agra Uttar Pradesh 282001</Address> <Type>budget</Type> <Available>true</Available> </hotel> <hotel> <ID>2</ID> <Name> TAJ EXOTICA </Name> <Stars>5</Stars> <Facilities>Indian therapies,Yoga and meditation,Spaindulges,Parking</Facilities> <Address>CalwaddoBenaulim, Salcete Goa 403716</Address> <Type>luxury</Type> <Available>false</Available> </hotel> <hotel> <ID>3</ID> <Name> VIVANTA by TAJ </Name> <Stars>3<...

Software Engineering Concepts Configuration Management And Version Control Configuration Management And Version Control Quiz 1

 

Web Technology HTML 5 HTML 2 | Quiz 1

 Web Technology       HTML 5            HTML 2               Quiz 1  

UNIX Introduction to Unix | Post-Quiz

 UNIX  Introduction to Unix  Post-Quiz  Feedback Congratulations! You have passed by securing more that 80%. Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text  What is the default maximum number of processes that can exist in Unix? Select one: a.  unlimited b.   32768           c.   4096        d.  1024          Feedback Your answer is correct. The correct answer is:  32768         Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text Single user mode shell has _____ prompt.  Select one: a.   $ Normal user  b.  % Admin user c.  ~ Home user d.  # Root user    Feedback Your answer is correct. The correct answer is: # Root user  Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text Predict the output for the following...

Min Cost In Maze Traversal

1. You are given a number n, representing the number of rows. 2. You are given a number m, representing the number of columns. 3. You are given n*m numbers, representing elements of 2d array a, which represents a maze. 4. You are standing in top-left cell and are required to move to bottom-right cell. 5. You are allowed to move 1 cell right (h move) or 1 cell down (v move) in 1 motion. 6. Each cell has a value that will have to be paid to enter that cell (even for the top-left and bottom-       right cell). 7. You are required to traverse through the matrix and print the cost of path which is least costly. Input Format A number n A number m e11 e12.. e21 e22.. .. n * m number of elements Output Format The cost of least costly path. Constraints 1 <= n <= 10^2 1 <= m <= 10^2 0 <= e1, e2, .. n * m elements <= 1000 Sample Input 6 6 0 1 4 2 8 2 4 3 6 5 0 4 1 2 4 1 4 6 2 0 7 3 2 2 3 1 5 9 2 4 2 7 0 8 5 1 Sample Output 23 Solution: import java.io.*; import...

Subscribe to Get's Answer by Email