Monday, 14 May 2018

UGC NET november 2017 paper 2 computer science & application solved Q11-Q20

11. ‘ptrdata’ is a pointer to a data type. The expression *ptrdata++ is evaluated as (in C++) :
(1) *(ptrdata++)
(2) (*ptrdata)++
(3) *(ptrdata)++
(4) Depends on compiler

Answer is: (1) *(ptrdata++)
as the ++ has higher precedence than * operator.

12. The associativity of which of the following operators is Left to Right, in C++ ?
(1) Unary Operator
(2) Logical not
(3) Array element access
(4) addressof

Answer is: (3) Array element access
Unary Operator -- right to left associativity
Logical not -- right to left associativity
Array element access -- Array subscript - [ ] - Left to Right associativity addressof -- right to left associativity

13. A member function can always access the data in __________ , (in C++).
(1) the class of which it is member
(2) the object of which it is a member
(3) the public part of its class
(4) the private part of its class

Correct Answer is: (1) the class of which it is member

14. Which of the following is not correct for virtual function in C++ ?
(1) Must be declared in public section of class.
(2) Virtual function can be static.
(3) Virtual function should be accessed using pointers.
(4) Virtual function is defined in base class.

Answer is: (2) Virtual function can be static. A virtual function must be declared within public section of base class and is overridden by the derived-class. When we refer to a derived class object using a reference of the base class, you can call a virtual function for that class object.then, version of the function defines in derived class will execute.

15. Which of the following is not correct (in C++) ?
(1) Class templates and function templates are instantiated in the same way.
(2) Class templates differ from function templates in the way they are initiated.
(3) Class template is initiated by defining an object using the template argument.
(4) Class templates are generally used for storage classes.

OPTION 2, 3, 4 ARE CORRECT (as per UGC answer key)

16. Which of the following is/are true with reference to ‘view’ in DBMS ?
(a) A ‘view’ is a special stored procedure executed when certain event occurs.
(b) A ‘view’ is a virtual table, which occurs after executing a pre-compiled query.(1) Only (a) is true
(2) Only (b) is true
(3) Both (a) and (b) are true
(4) Neither (a) nor (b) are true

(2) Only (b) is true View is the table or the result of query after query execution.

17. In SQL, __________ is an Aggregate function.
(1) SELECT (2) CREATE (3) AVG (4) MODIFY

Correct Answer is: AVG function used to find the average of the particular attribute values. e.g., to find avg salary of employee of a company.

18. Match the following with respect to RDBMS :
(a) Entity integrity (i) enforces some specific business rule that do not fall into entity or domain.
(b) Domain integrity(ii) Rows can’t be deleted which are used by other records
(c) Referential integrity(iii) enforces valid entries for a column
(d) User defined integrity (iv) No duplicate rows in a table
Code :
(1) (iii) (iv) (i) (ii)
(2) (iv) (iii) (ii) (i)
(3) (iv) (ii) (iii) (i)
(4) (ii) (iii) (iv) (i)

Correct Answer is: (2) (iv) (iii) (ii) (i)
Entity integrity: No duplicate rows in a table. Every entity(row) in the table must be unique based on the primary key of the table. Table would not allow the same primary key twice.
Domain integrity:Defines the what type of values to be inserted to the particular (attribute)column of DB for an entity. If we define the salary attribute in employee class then, domain of such values are numeric (say double). This integrity enforces valid entries for a column. (not allow alpha-numeric values for the salary).
Referential integrity: is based on foreign keys (so, it referred by other referencing table, deletion of such entries causes the undefined value for referencing table). Rows can’t be deleted which are used by other records.
User defined integrity: enforces some specific business rule that do not fall into entity or domain.
For e.g., you defining the constraint over the values of the attribute. let's assume that you are inserting the values to the table such that max and minimum salary for the part-time employee must be in in range 10,000 and 100. (So, you are restricting any insert to DB outside this salary range).

19. In RDBMS, different classes of relations are created using __________ technique to prevent modification anomalies.
(1) Functional Dependencies
(2) Data integrity
(3) Referential integrity
(4) Normal Forms

Correct Answer is: (4) Normal Forms
Normal forms are used to reduce the redundancy and increase the data consistency.

20. __________ SQL command changes one or more fields in a record.
(1) LOOK-UP
(2) INSERT
(3) MODIFY
(4) CHANGE

Correct Answer is: (3) MODIFY

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts