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:

Software Engineering Concepts Software Maintenance Pre-Quiz

  Software Engineering Concepts       Software Maintenance            Pre-Quiz

Mock 3 Slot3 - Quiz - 21st July Quiz Quiz

Mock 3 Slot3        Quiz - 21st July          Important Questions

Software Engineering Concepts Requirement Analysis Post-Quiz

 Software Engineering Concepts       Requirement Analysis            Post-Quiz  Software Engineering Concepts  Requirement Analysis  Post-Quiz Software Engineering Concepts  Requirement Analysis  Test Your Understanding Software Engineering Concepts  Requirement Analysis  Pre-Quiz Software Engineering Concepts  Software Maintenance  Test Your Understanding Software Engineering Concepts  Software Maintenance  Post-Quiz Software Engineering Concepts  Software Maintenance  Pre-Quiz Software Engineering Concepts  Software Engineering Fundamentals  Post-Quiz Software Engineering Concepts  Software Engineering Fundamentals  Pre-Quiz Algorithm Analysis and Design Concepts  Data Structure and Algorithms  Post-Quiz Software Engineering Concepts  Configuration Management And Version Control  Configuration Management And Version Contro...

Software Engineering Concepts Requirement Analysis Pre-Quiz

  Software Engineering Concepts       Requirement Analysis            Pre-Quiz

Cars and Bikes Problem Code: TYRES | CodeChef

Problem: Chef opened a company which manufactures cars and bikes. Each car requires   4 4  tyres while each bike requires  2 2  tyres. Chef has a total of  N N  tyres ( N N  is even). He wants to manufacture maximum number of cars from these tyres and then manufacture bikes from the remaining tyres. Chef's friend went to Chef to purchase a bike. If Chef's company has manufactured even a single bike then Chef's friend will be able to purchase it. Determine whether he will be able to purchase the bike or not. Input Format The first line contains an integer  T T  denoting the number of test cases. The  T T  test cases then follow. The first line of each test case contains an integer  N N  denoting the number of tyres. Output Format For each test case, output  YES  or  NO  depending on whether Chef's friend will be able to purchase the bike or not. Output is case insensitive. Constraints 1 ≤ T ≤ 100 1 ≤ T ≤...

Climb Stairs With Variable Jumps

 1. You are given a number n, representing the number of stairs in a staircase. 2. You are on the 0th step and are required to climb to the top. 3. You are given n numbers, where ith element's value represents - till how far from the step you       could jump to in a single move.        You can of course jump fewer number of steps in the move. 4. You are required to print the number of different paths via which you can climb to the top. Input Format A number n .. n more elements Output Format A number representing the number of ways to climb the stairs from 0 to top. Constraints 0 <= n <= 20 0 <= n1, n2, .. <= 20 Sample Input 10 3 3 0 2 1 2 4 2 0 0 Sample Output 5 Solution: import java.io.*; import java.util.*; public class Main {     public static void main(String[] args) throws Exception {         // write your code here         Scanner sc = new Scanner(System.in);   ...

Unbounded Knapsack

1. You are given a number n, representing the count of items. 2. You are given n numbers, representing the values of n items. 3. You are given n numbers, representing the weights of n items. 3. You are given a number "cap", which is the capacity of a bag you've. 4. You are required to calculate and print the maximum value that can be created in the bag without      overflowing it's capacity. Note: Each item can be taken any number of times. You are allowed to put the same item again                    and again. Input Format A number n v1 v2 .. n number of elements w1 w2 .. n number of elements A number cap Output Format A number representing the maximum value that can be created in the bag without overflowing it's capacity Constraints 1 <= n <= 20 0 <= v1, v2, .. n elements <= 50 0 < w1, w2, .. n elements <= 10 0 < cap <= 10 Sample Input 5 15 14 10 45 30 2 5 1 3 4 7 Sample Output 100 Solution: im...

Coin Change Combination

1. You are given a number n, representing the count of coins. 2. You are given n numbers, representing the denominations of n coins. 3. You are given a number "amt". 4. You are required to calculate and print the number of combinations of the n coins using which the       amount "amt" can be paid. Note 1: You have an infinite supply of each coin denomination i.e. same coin denomination can be                    used for many installments in payment of "amt" Note 2: You are required to find the count of combinations and not permutations i.e.                   2 + 2 + 3 = 7 and 2 + 3 + 2 = 7 and 3 + 2 + 2 = 7 are different permutations of same                    combination. You should treat them as 1 and not 3. Input Format A number n n1 n2 .. n number of elements A number amt Output Format A number representing the count of ...

Subscribe to Get's Answer by Email