Oracle Certification Questions

Q:

What is Primary Key in DBMS?

Answer

A primary key is a special relational database table column or combination of columns designated to uniquely identify all table records. That is, A primary key is a column or set of columns in a table that uniquely identifies tuples (rows) in that table.


A primary key, also called a Primary Keyword.



Main Features Primary key are ::


It must contain a unique value for each row of data.


It cannot contain null values.

Report Error

View answer Workspace Report Error Discuss

10 1946
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 5385
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 4024
Q:

In the following pieces of code, B and D will compile without any error. True or false ?

A: StringBuffer sb1 = "abcd";

B: Boolean b = new Boolean("abcd");

C: byte b = 255;

D: int x = 0x1234;

E: float fl = 1.2;

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

Explanation:

The code segments B and D will compile without any error. A is not a valid way to construct a StringBuffer, you need to create a StringBuffer object using "new". B is a valid construction of a Boolean (any string other than "true" or "false" to the Boolean constructor will result in a Boolean with a value of "false"). C will fail to compile because the valid range for a byte is -128 to +127 (i.e., 8 bits, signed). D is correct, 0x1234 is the hexadecimal representation in java. E fails to compile because the compiler interprets 1.2 as a double being assigned to a float (down-casting), which is not valid. You either need an explicit cast, as in "(float)1.2" or "1.2f", to indicate a float.

Report Error

View Answer Workspace Report Error Discuss

6 5398
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 2002
Q:

A relational database developer refers to a record as

A) a relation B) an attribute
C) a criteria D) a tuple
 
Answer & Explanation Answer: D) a tuple

Explanation:

A relational database developer refers to a record as a tuple.

Report Error

View Answer Report Error Discuss

6 10480
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 3185
Q:

What is the maximum number of triggers, can apply to a single table?

A) 8 B) 10
C) 12 D) 14
 
Answer & Explanation Answer: C) 12

Explanation:

Maximim number of triggers that can be applied to a single table is 12

Report Error

View Answer Report Error Discuss

6 5096