Oracle Certification Questions

Q:

What is the output after compile and run the following code ?

int Output = 10;
boolean b = false;
if((b == true) && ((Output += 10) == 20))
{
System.out.println("We are equal " + Output);
}
else
{
System.out.println("Not equal! " + Output);
}

A) Compilation and output of "We are equal 10" B) Compilation and output of "Not equal! 10"
C) Compilation error, attempting to perform binary comparison on logical data type D) Compilation and output of "Not equal! 20"
 
Answer & Explanation Answer: B) Compilation and output of "Not equal! 10"

Explanation:

The output will be "Not equal! 10". Please note that && is logical AND operator. If first operand before (&&) is false then the other operand will not be evaluated. This illustrates that the Output +=10 calculation was never performed because processing stopped after the first operand was evaluated to be false. If you change the value of b1 to true, processing occurs as you would expect and the output would be "We are equal 20".

Report Error

View Answer Report Error Discuss

Filed Under: Oracle Certification
Job Role: Analyst

6 5426
Q:

Breaking of relationships is allowed once referential integrity on a database is enforced

A) TRUE B) FALSE
Answer & Explanation Answer: B) FALSE

Explanation:

Breaking of relationships is prevented once referential integrity on a database is enforced

Report Error

View Answer Workspace Report Error Discuss

0 4225
Q:

A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can't contain Nulls

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

Because a table can have only one primary key

Report Error

View Answer Workspace Report Error Discuss

1 4152
Q:

What is the default return value of a function?

A) int B) char
C) string D) None of the above
 
Answer & Explanation Answer: A) int

Explanation:

The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.

Report Error

View Answer Report Error Discuss

3 3694
Q:

Which among the following keys are used to identify each row of the table uniquely?

A) Primary key B) Unique key
C) Partial key D) None of the above
 
Answer & Explanation Answer: A) Primary key

Explanation:

Primary key helps us to identify a row uniquely in a relation

Report Error

View Answer Report Error Discuss

2 3650
Q:

Difference between Candidate key and Primary key?

Answer

Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key. 


Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.






        • One needs to be very careful in selecting the Primary Key as an incorrect selection can adversely impact the database architect and future normalization. For a Candidate Key to qualify as a Primary Key, it should be Non-NULL and unique in any domain.




Report Error

View answer Workspace Report Error Discuss

6 3542
Q:

Go command is a signal to execute the entire batch of SQL statements after previous Go

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:
Report Error

View Answer Workspace Report Error Discuss

0 3285
Q:

Multiple users can share a local temporary table

A) TRUE B) FALSE
Answer & Explanation Answer: B) FALSE

Explanation:

Multiple users can't share a local temporary table

Report Error

View Answer Workspace Report Error Discuss

0 3153