DBA > Job Interview Questions > COBOL SQL Interview Questions

We have a table with a CHARACTER data type field

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

We have a table with a CHARACTER data type field

Q: We have a table with a CHARACTER data type field. We apply a ">" row comparison between this field and another CHARACTER field in another table. What will be the results for records with field value of NULL ? (Check one that applies the best )
A) TRUE
B) FALSE
C) UNKNOWN
D) Error
E) Those records will be ignored


AN:
C) NULL in a row when compared will give an UNKNOWN result.

break_

Any database needs to go through a nprmalization process to make sure that data is represented only once ...

Q: Any database needs to go through a nprmalization process to make sure that data is represented only once. This will eliminate problems with creating or destroying data in the database. The normalization process is done usually in three steps which results in first, second and third normal forms. Which best describes the process to obtain the third normal form ? (Check one that applies the best)
A) Each table should have related columns
B) Each separate table should have a primary key
C) We have a table with multi-valued key. All columns that are dependent on only one or on some of the keys should be moved in a different table
D) If a table has columns not dependent on the primary keys, they need to be moved in a separate table.
E) Primary key is always UNIQUE and NOT NULL.


An:
D) All columns in a table should be dependent on the primary key. This will eliminate transitive dependencies in which A depends on B, and B depends on C, but we are not sure how C depends on A.

break_

SQL can be embeded in a host program that uses a relational database as a persistent data repository...

Q: SQL can be embeded in a host program that uses a relational database as a persistent data repository. Some of the most important pre-defined structures for this mechanism are SQLDA ("SQL Descriptor Area") and SQLCA ("SQL Communications Area") SQLCA contains two structures - SQLCODE and SQLSTATE. SQLSTATE is a standard set of error messages and warnings in which the first two characters defines the class and the last three defines the subclass of the error. Which of the following SQLSTATE codes is interpreted as "No data returned"? (Chech one that applies the best)
A) 00xxx
B) 01xxx
C) 02xxx
D) 22xxx
E) 2Axxx


An:
C) 00 - is successful completion, 01 - warnings, 22 - is data exception and 2A is syntax error. The SQLSTATE code format returned for "No data returned" is "02xxx".

break_

What are common SQL abend codes ?

Q: What are common SQL abend codes ? (e.g. : 0, 100 etc..,)

AN:
-818 time stamp mismatch
-180 wrong data moved into date field

break_

What is meant by dynamic SQL ?

Dynamic SQL are SQL statements that are prepared and executed within a program while the program is executing.
The SQL source is contained in host variables rather than being hard coded into the program. The SQL statement may change from execution to execution.

break_

What is meant by embedded SQL ?

They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed. After it is prepared, the statement itself does not change ( although values of host variables specified within the statement might change ).

break_

What is meant by entity integrity ?

Entity integrity is when the primary key is in fact unique and not null.

break_

What will EXPLAIN do?

EXPLAIN obtains information (which indexes are used, whether sorting is necessary, which level of locking is applied ) about how SQL statements in the DBRM will be executed, inserting this information into the "X", PLAN.TABLE where the "X" is the authorization ID of the owner of the plan.

break_

What is the foreign key?

A foreign key is a column (or combination of columns) in a table whose values are required to match those of the primary key in some other table.

break_

What will GRANT option do?

It will grant privileges to a list of one or more users. If the GRANT option is used in conjunction with the "PUBLIC" option. then all users will be granted privileges. Also you can grant privileges by objects and types.

(Continued on next question...)

Other Job Interview Questions