6
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:   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".

Subject: Oracle Certification
Job Role: Analyst
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 3247
Q:

Which dml command is used in conjunction with @@identity?

A) INSERT and UPDATE B) UPDATE and DELETE
C) SCOPE_IDENTITY and IDENT_CURRENT D) Commit and rollback
 
Answer & Explanation Answer: C) SCOPE_IDENTITY and IDENT_CURRENT

Explanation:

Using automatically incrementing IDENTITY columns is very popular with database developers. You don’t need to explicitly calculate unique surrogate keys when inserting new data, the IDENTITY column functionality does that for you. The IDENTITY feature also allows you to specify useful Seed and Increment properties. When you use an INSERT statement to insert data into a table with an IDENTITY column defined, SQL Server will generate a new IDENTITY value.

 

You can use the @@IDENTITY variable and the SCOPE_IDENTITY and IDENT_CURRENT functions to return the last IDENTITY value that has been generated by SQL Server. This is very useful when you need to return the key for the row that has just been inserted, back to the caller.

Report Error

View Answer Report Error Discuss

8 5463
Q:

Why do you need common fields in a Database?

Answer

A database that contains multiple tables related through common fields.


A common field is a field of data that is shared among all forms in a database. Without them, it would be difficult and/or time-consuming to create other forms.

Report Error

View answer Workspace Report Error Discuss

6 1989
Q:

MOV extension refers usually to what kind of files?

A) Audio B) Movies or other Videos
C) Images D) Documents
 
Answer & Explanation Answer: B) Movies or other Videos

Explanation:

A .MOV file is a common multimedia container file format developed by Apple. It may contain multiple tracks that store different types of media data and is often used for saving movies and other video files.

Report Error

View Answer Report Error Discuss

3 1941
Q:

In R-DBMS, the data is organized in the form of _____.

A) Hierarchical structure B) Tabular structure
C) Linked structure D) All of the above
 
Answer & Explanation Answer: B) Tabular structure

Explanation:

Data is organized in the form of row and columns, thus it is in tabular structure.

Report Error

View Answer Report Error Discuss

Filed Under: Oracle Certification

5 2349
Q:

Insert command falls in which sub-language of SQL ?

A) DCL B) DQL
C) DML D) DDL
 
Answer & Explanation Answer: C) DML

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Oracle Certification

5 2220
Q:

What are the different types of SQL statements ?

Answer

SQL statements are broadly classified into three. They are


1. DDL – Data Definition Language


DDL is used to define the structure that holds the data. For example, Create, Alter, Drop and Truncate table.


2. DML – Data Manipulation Language


DML is used for manipulation of the data itself. Typical operations are Insert, Delete, Update and retrieving the data from the table. The Select statement is considered as a limited version of the DML, since it can't change the data in the database. But it can perform operations on data retrieved from the DBMS, before the results are returned to the calling function.


3. DCL – Data Control Language


DCL is used to control the visibility of data like granting database access and set privileges to create tables, etc. Example - Grant, Revoke access permission to the user to access data in the database.

Report Error

View answer Workspace Report Error Discuss

4 2274
Q:

Define Executive Plan in Database SQL ?

Answer

Executive plan can be defined as:


* SQL Server caches collected procedure or the plan of query execution and used thereafter by subsequent calls.


* An important feature in relation to performance enhancement.


* Data execution plan can be viewed textually or graphically.

Report Error

View answer Workspace Report Error Discuss

6 2045