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

Display of Provisional Answer Keys and Question Paper with Recorded Responses for Answer Key Challenge | JEE (Main) 2021 Session 4 for Paper 1 (B.E./B.Tech.)

The JEE (Main) - 2021 Session - 4 was conducted throughout the country and abroad on 26, 27, 31 August and 1 September 2021 for Paper 1 (B.E./B.Tech.) in the Computer Based Test (CBT) mode. The National Testing Agency has uploaded the Provisional Answer Keys for Paper 1 (B.E./B.Tech.) along with the Question Paper with Recorded Responses on the website https://jeemain.nta.nic.in for candidates to challenge. The procedure (as enclosed) for the challenge of Answer Key may be used. The candidates, who are not satisfied with the answer key, may challenge the same by paying a fee of ₹ 200/- (Rupees Two Hundred only) per question challenged as a non-refundable processing fee. This facility is available from 06 September 2021 to 08 September 2021 (up to 10:00 A.M.). The payment of the processing fee may be made through, Debit card/Credit Card/Net Banking/Paytm upto 08 September 2021 (upto 11:00 A.M.). No challenge will be entertained without receipt of the processing fee. The Challenges will ...

Print Permutations

 1. You are given a string str. 2. Complete the body of printPermutations function - without changing signature - to calculate and print all permutations of str. Use sample input and output to take idea about permutations. Note -> The online judge can't force you to write the function recursively but that is what the spirit of question is. Write recursive and not iterative logic. The purpose of the question is to aid learning recursion and not test you. Input Format A string str Output Format Permutations of str in order hinted by Sample output Constraints 0 <= str.length <= 7 Sample Input abc Sample Output abc acb bac bca cab cba Solution: import java.io.*; import java.util.*; public class Main {     public static void main(String[] args) throws Exception {         Scanner sc = new Scanner(System.in);         String str = sc.nextLine();         printPermutations(str,"");     }     pu...

JoSAA

JoSAA- JEE counselling Read below to know about JoSAA and related procedures... Q. What is JoSAA? A. J oSAA is an acronym for “Joint Seat Allocation Authority”. It is constituted by the Ministry of HRD to oversee joint seat allocation for the IITs, NITs, IIITs and other GFTIs. It consists of representatives from the Joint Admission Board (JAB) (for IITs) and the Central Seat Allocation Board (CSAB) (for NITs, IIITs (Triple-I-Ts) and Other-GFTIs). JoSAA is the ONLY authorized agency responsible for joint seat allocation, click here to know more... Q. Is there any other agency for conducting the seat allocation to IITs and NITs? A. No agency other than JoSAA is responsible for joint seat allocation for IITs and NIT+ Institutes. Candidates seeking information/assistance from any agency/agent other than JoSAA shall be doing so at their own risk and cost. To read more... Q. What is CSAB? A. CSAB is an acronym for “Central Seat Allocation Board”. It is an agency co...