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

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 3540
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

9 5999
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 2109
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 2178
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 2520
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 2394
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 2468
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 2202