Custom Search

Thursday, September 13, 2007

Does PL/SQL support "overloading"? Explain

          The concept of overloading in PL/SQL relates to the idea that you can define procedures and functions with the same name. PL/SQL does not look only at the referenced name, however, to resolve a procedure or function call. The count and data types of formal parameters are also considered.

PL/SQL also attempts to resolve any procedure or function calls in locally defined packages before looking at globally defined packages or internal functions. To further ensure calling the proper procedure, you can use the dot notation. Prefacing a procedure or function name with the package name fully qualifies any procedure or function reference.

 

Tables derived from the ERD

          a) Are totally unnormalised

          b) Are always in 1NF

          c) Can be further denormalised

          d) May have multi-valued attributes

 

 (b) Are always in 1NF

 

Spurious tuples may occur due to

       i. Bad normalization 

      ii. Theta joins

     iii. Updating tables from join

          a) i & ii                            b) ii & iii

          c) i & iii                            d) ii & iii

 

  (a) i & iii  because  theta joins are joins made on keys that are not primary keys.

 

A B C is a set of attributes. The functional dependency is as follows

      AB  ->   B

      AC ->    C

         C ->    B

          a) is in 1NF

          b) is in 2NF

          c) is in 3NF

          d) is in BCNF

 

 (a) is in 1NF since (AC)+ = { A, B, C} hence AC is the primary key. Since          C       B is a FD given, where neither C is a Key nor B is a prime attribute, this it is not in 3NF. Further B is not functionally dependent on key AC thus it is not in 2NF.   Thus the given FDs is in 1NF.

 

In mapping of ERD to DFD

          a) entities in ERD should correspond to an existing entity/store in DFD

          b) entity in DFD is converted to attributes of an entity in ERD

          c) relations in ERD has 1 to 1 correspondence to processes in DFD

          d) relationships in ERD has 1 to 1 correspondence to flows in DFD

 

  (a) entities in ERD should correspond to an existing entity/store in DFD

 

A dominant entity is the entity

          a) on the N side in a 1 : N relationship

          b) on the 1 side in a 1 : N relationship

          c) on either side in a 1 : 1 relationship

          d) nothing to do with 1 : 1 or 1 : N relationship

 

(b) on the 1 side in a 1 : N relationship

 

Select  'NORTH', CUSTOMER From CUST_DTLS Where REGION = 'N' Order By

CUSTOMER Union Select  'EAST', CUSTOMER From CUST_DTLS Where REGION = 'E' Order By CUSTOMER

The above is

          a) Not an error

          b) Error - the string in single quotes 'NORTH' and 'SOUTH'

          c) Error - the string should be in double quotes

          d) Error -  ORDER BY clause

 

(d)  Error - the ORDER BY clause. Since ORDER BY clause cannot be used in UNIONS



--
RDBMS

No comments: