1.
Which of the following relational algebra operations do not require the participating tables to be union-compatible?
Correct Answer
D. Join
Explanation
The join operation in relational algebra does not require the participating tables to be union-compatible. Join combines rows from two or more tables based on a common attribute and creates a new table. It matches the values of the common attribute in the tables and combines the rows that have matching values. Unlike union, intersection, and difference operations, join does not require the tables to have the same number or types of columns.
2.
Which of the following is not a property of transactions?
Correct Answer
B. Concurrency
Explanation
Concurrency is not a property of transactions. Transactions ensure atomicity, which means that they are either executed in their entirety or not at all. Isolation ensures that transactions are executed independently and do not interfere with each other. Durability ensures that once a transaction is committed, its changes are permanent. However, concurrency refers to the ability of multiple transactions to execute simultaneously without interfering with each other, which is not a property of transactions.
3.
Relational Algebra does not have
Correct Answer
C. Aggregation operators
Explanation
The correct answer is "Aggregation operators." Relational Algebra is a formal language used to query and manipulate relational databases. It includes various operators such as selection, projection, and division, which are used to perform specific operations on the data. However, aggregation operators are not part of the Relational Algebra. Aggregation operators are typically used in SQL queries to perform calculations on groups of data, such as finding the sum, average, or maximum value.
4.
Checkpoints are a part of
Correct Answer
A. Recovery measures
Explanation
Checkpoints are a part of recovery measures. In computer systems, a checkpoint refers to a specific point in time where the system's state is saved. This allows for the system to be restored to that point in case of a failure or error. Recovery measures are put in place to ensure the system can recover from such failures and continue functioning properly. Checkpoints play a crucial role in this process by providing a reference point for restoring the system to a known, stable state.
5.
Tree structures are used to store data in
Correct Answer
C. Hierarchical model
Explanation
Tree structures are used to store data in a hierarchical model. In a hierarchical model, data is organized in a tree-like structure with parent-child relationships. Each parent can have multiple children, but each child can have only one parent. This model is commonly used in systems where data has a one-to-many relationship, such as an organizational chart or a file system. In a hierarchical model, data can be accessed quickly and efficiently by following the parent-child relationships.
6.
The language that requires a user to specify the data to be retrieved without specifying exactly how to get it is
Correct Answer
B. Non-Procedural DML
Explanation
Non-Procedural DML is the correct answer because it allows the user to specify the data to be retrieved without specifying exactly how to get it. Non-Procedural DML focuses on what data is needed, rather than how to retrieve it. This type of language is often used in high-level programming languages and query languages, where the user only needs to specify the desired outcome and the system takes care of the implementation details.
7.
Precedence graphs help to find a AC14/AT11 Database Management Systems 2
Correct Answer
A. Serializable schedule
Explanation
Precedence graphs help to find a Serializable schedule. A Serializable schedule is a schedule in which the outcome is the same as if the transactions were executed one at a time in some order. Precedence graphs are used to determine if a schedule is serializable by representing the transactions as nodes and the dependencies between them as edges. If the graph is acyclic, then the schedule is serializable. If there is a cycle in the graph, then the schedule is not serializable. Therefore, precedence graphs are a useful tool for analyzing and determining the serializability of schedules in database management systems.
8.
The rule that a value of a foreign key must appear as a value of some specific table is called
Correct Answer
A. Referential constraint
Explanation
A referential constraint is a rule that ensures that the value of a foreign key in a table must appear as a value in another specific table. It is used to maintain the integrity and consistency of data in a relational database by enforcing relationships between tables. This constraint helps to prevent orphaned records and ensures that data remains accurate and valid.
9.
The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is
Correct Answer
B. Order by
Explanation
The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is "Order by". This clause is used to sort the result set in either ascending (default) or descending order. It allows the user to specify one or more columns to sort by, and the sorting is done based on the values in those columns.
10.
What is a disjoint less constraint?
Correct Answer
A. It requires that an entity belongs to no more than one level entity set.
Explanation
A disjoint less constraint is a requirement that an entity can only belong to one level entity set. This means that the same entity cannot be associated with multiple levels. For example, if we have a database with different levels of employees (e.g., junior, senior, manager), a disjoint less constraint would ensure that an employee can only be part of one level, such as either junior or senior, but not both. This constraint helps maintain data integrity and avoids confusion in the database.
11.
According to the levels of abstraction, the schema at the intermediate level is called
Correct Answer
D. None of the above
Explanation
The question is asking for the term used to describe the schema at the intermediate level according to the levels of abstraction. However, none of the given options (Logical schema, Physical schema, Subschema) accurately describe the schema at the intermediate level. Therefore, the correct answer is "None of the above".
12.
It is an abstraction through which relationships are treated as higher level entities
Correct Answer
C. Aggregation
Explanation
Aggregation is the correct answer because it refers to the concept of treating relationships between objects as higher-level entities. In aggregation, objects can be composed of other objects, forming a whole-part relationship. This allows for a more abstract representation of relationships, where the focus is on the overall structure or composition rather than the specific details of individual objects. Generalization and specialization are related to inheritance, which involves creating subclasses based on a superclass. While inheritance is a form of abstraction, it is not directly related to treating relationships as higher-level entities.
13.
A relation is in ____________ if an attribute of a composite key is dependent on an attribute of other composite key.
Correct Answer
B. 3NF
Explanation
In 3NF (Third Normal Form), an attribute of a composite key is dependent on an attribute of another composite key. This means that the relation has been normalized to eliminate any transitive dependencies, ensuring that each non-key attribute is functionally dependent on the primary key. This level of normalization helps to minimize redundancy and improve data integrity in the database.
14.
What is data integrity?
Correct Answer
B. It is the data contained in database that is accurate and consistent.
Explanation
Data integrity refers to the reliability and consistency of data stored in a database. It ensures that the data is accurate, complete, and consistent throughout its lifecycle. This means that the data is free from errors, duplications, and inconsistencies. Maintaining data integrity is crucial for ensuring the quality and reliability of information in a database, as it allows users to trust the data and make informed decisions based on it.
15.
What are the desirable properties of a decomposition
Correct Answer
B. Dependency preservation
Explanation
Dependency preservation is a desirable property of a decomposition because it ensures that the functional dependencies present in the original relation are preserved in the decomposed relations. This means that any dependencies that existed between attributes in the original relation will still hold true in the decomposed relations. This property is important because it ensures that the integrity and consistency of the data is maintained during the decomposition process.
16.
In an E-R diagram double lines indicate
Correct Answer
A. Total participation
Explanation
Double lines in an E-R diagram indicate total participation. Total participation means that every entity in one entity set must participate in a relationship with entities in another entity set. In other words, it ensures that every instance of an entity set is associated with at least one instance of another entity set. Double lines are used to represent this constraint in the E-R diagram.
17.
The operation which is not considered a basic operation of relational algebra is
Correct Answer
A. Join
Explanation
The basic operations of relational algebra include Selection, Projection, Union, Difference, Intersection, and Cartesian Product. Join is not considered a basic operation because it combines two relations based on a common attribute, creating a new relation. It is a more complex operation that requires the comparison of values in the common attribute and the merging of tuples from both relations.
18.
Fifth Normal form is concerned with
Correct Answer
C. Join dependency
Explanation
Fifth Normal form (5NF) is concerned with join dependency. Join dependency occurs when a relation can be decomposed into multiple smaller relations, and the original relation can be reconstructed by joining these smaller relations. In 5NF, all join dependencies are eliminated, resulting in a more efficient and flexible database design. This normalization form ensures that the database schema is free from redundancy and anomalies, leading to improved data integrity and maintainability.
19.
Block-interleaved distributed parity is RAID level
Correct Answer
D. 5
Explanation
Block-interleaved distributed parity is a RAID level where data is divided into blocks and distributed across multiple drives, along with parity information. This allows for improved fault tolerance and data protection. In this RAID level, each block of data is striped across multiple drives, and parity information is calculated and distributed across the drives as well. This ensures that if a drive fails, the data can be reconstructed using the parity information from the remaining drives. Therefore, the correct answer is 5.
20.
Immediate database modification technique uses
Correct Answer
A. Both undo and redo
Explanation
The immediate database modification technique uses both undo and redo. Undo is used to reverse the changes made to the database in case of a rollback or an error, while redo is used to reapply the changes made to the database in case of a commit or a crash. By using both undo and redo, the database can maintain consistency and ensure that any changes made to the database are properly recorded and can be reversed if necessary.
21.
What will be output if you will compile and execute the following c code?
#define message "union is\
power of c"
void main()
{
clrscr();
printf("%s",message);
getch();
}
Correct Answer
B. Union is power of c
Explanation
The code defines a macro "message" using the "#define" directive. The macro is defined as "union is power of c". In the main function, the code clears the screen using the "clrscr()" function, then prints the value of the "message" macro using the "printf()" function. Finally, it waits for a key to be pressed using the "getch()" function. Therefore, when the code is compiled and executed, it will output "union is power of c".
22.
What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf("%s",call(c/c++));
}
Correct Answer
D. C/c++
Explanation
The code is using the # operator in the macro definition. The # operator is used to convert the argument into a string literal. In this case, the argument is "c/c++". So when the code is executed, the printf statement will print the string "c/c++" as the output.
23.
What will be output if you will compile and execute the following c code?
converted by Web2PDFConvert.com
void main()
{
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
Correct Answer
C. cquestionbankI know c
Explanation
The code will output "cquestionbankI know c". This is because the printf() function in the if statement will print "cquestionbank" and return the number of characters printed, which is not zero. Therefore, the if statement evaluates to true and the code inside the if block will be executed, printing "I know c".
24.
Int y[4] = {6, 7, 8, 9};
int *ptr = y + 2; printf("%d\n", ptr[ 1 ] );
What isprinted when the sample code above is executed?
a) 6
b) 7
c) 8
d) 9
Ans: d
27. int i = 4;
switch (i)
{
default: ;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9) break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %d\n", i);
What will the output of the sample code above be?
Correct Answer
A. i = 5
Explanation
The code starts with the value of i being 4. It enters the switch statement and since there is no case for 4, it goes to the default case. In the default case, i is incremented by 5, making it 9. Then it enters the if statement and since i is not equal to 9, it multiplies i by 2, making it 18. Then it subtracts 4 from i, making it 14. Finally, it breaks out of the switch statement and prints the value of i, which is 14. Therefore, the correct answer is "i = 14".
25.
What will be the value of `a` after the following code is executed
#define square(x) x*x
a = square(2+3)
Correct Answer
C. 11
Explanation
The code defines a macro `square(x)` that squares its input. The value of `a` is then assigned the result of `square(2+3)`, which is `2+3*2+3`. Following the order of operations, the multiplication is performed first, resulting in `2+6+3`. Finally, the addition is performed, resulting in `11`.
26.
What would be the output of the following program?
#include
main()
{
char str[]="S\065AB";
printf("\n%d", sizeof(str));
}
Correct Answer
B. 6
Explanation
The output of the program would be 6. The program declares a character array named "str" and initializes it with the string "S\065AB". The escape sequence "\065" represents the ASCII value for the character '5'. Therefore, the string "S\065AB" is equivalent to "S5AB". The sizeof() function returns the size of the character array, which is 6 (including the null character at the end of the string). The printf() function is used to print the result.
27.
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
Correct Answer
C. The program may crash if some important data gets overwritten
Explanation
If a value is assigned to an array element whose subscript exceeds the size of the array, it may lead to overwriting important data in the program. This can cause the program to crash as it tries to access memory that it is not supposed to. Therefore, the correct answer is that the program may crash if some important data gets overwritten.
28.
Main()
{
struct
{
int i;
}xyz;
(*xyz)->i=10;
printf("%d",xyz.i);
}
What is the output of thisprogram?
Correct Answer
B. 10
Explanation
The program will output 10. This is because the program defines a structure called xyz with a member variable i. It then assigns the value 10 to the member variable i using the pointer to the structure. Finally, it prints the value of xyz.i, which is 10.
29.
What is the output of the following code?
#include
void main()
{
int s=0;
while(s++
# define a 10
converted by Web2PDFConvert.com
main()
{
printf("%d..",a);
foo();
printf("%d",a);
}
void foo()
{
#undef a
#define a 50
}
Correct Answer
C. Error
Explanation
The code will result in an error because the variable "a" is undefined when it is called in the printf statement in the main function. This is because the "#undef a" statement in the foo function removes the definition of "a" and the subsequent "#define a 50" statement only applies within the foo function. Therefore, when "a" is called in the main function, it is not recognized and an error occurs.
30.
What will be the output of the following statements?
int i = 3;
printf("%d%d",i,i++);
Correct Answer
B. 43
Explanation
The output of the given statements will be 43. This is because the printf function first evaluates the format string and then evaluates the arguments in order from left to right. In this case, the format string "%d%d" expects two integer arguments. When the first argument i is encountered, its value is 3. Then, the second argument i++ is encountered. The post-increment operator increments the value of i to 4, but the value used in the printf function is still the original value of i, which is 3. Therefore, the output is 43.
31.
What will be the output of the following statements?
int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d);
Correct Answer
D. Error
Explanation
The given code has a syntax error. There is an extra closing parenthesis ")" after the ternary operator. The correct code should be: d=(a>c?1:2):(c>b?6:8); printf("%d",d); This code will result in a compilation error.
32.
What will be the output of the following statement ? printf( 3 + "goodbye");
Correct Answer
D. dbye
Explanation
The given statement printf(3 + "goodbye") is adding the integer 3 to the string "goodbye". In C programming, when a number is added to a string, it results in a pointer to a character in the string. In this case, adding 3 to "goodbye" will result in a pointer to the fourth character of the string, which is 'd'. Therefore, the output of the statement will be "dbye".
33.
What will be the output of the following statement ?
printf("%X%x%ci%x",11,10,'s',12);
Correct Answer
B. Basc
Explanation
The output of the given statement will be "basc". This is because the statement uses the printf function to print a series of values. %X is used to print the hexadecimal representation of the number 11, which is B. %x is used to print the hexadecimal representation of the number 10, which is a. %c is used to print the character 's'. %x is used again to print the hexadecimal representation of the number 12, which is c. Therefore, the output will be "basc".
34.
What will be the output of the following statement ? int a=10; printf("%d &i",a,10);
Correct Answer
D. none of these
Explanation
The output of the given statement will be "10 &i". This is because the printf() function is used to print the value of the variable "a" followed by the string "&i". The "%d" format specifier is used to print the value of the integer variable, which in this case is 10. The "&i" is simply a string that will be printed as it is.
35.
What will be the output of the following arithmetic expression ? 5+3*2%10-8*6
Correct Answer
A. -37
Explanation
The given arithmetic expression follows the order of operations, which is parentheses, exponents, multiplication and division (from left to right), and addition and subtraction (from left to right). First, the multiplication operation is performed, resulting in 3*2 = 6. Then, the modulo operation is performed, resulting in 6%10 = 6. Next, the addition operation is performed, resulting in 5+6 = 11. Finally, the subtraction operation is performed, resulting in 11-8 = 3. Since there are no parentheses or exponents in the expression, the final result is 3, which does not match any of the given answer choices. Therefore, the correct answer is not available.
36.
What isDequeue?
Correct Answer
B. Elements can be added to or removed from either the front or rear
Explanation
A Dequeue (Double Ended Queue) is a data structure in which elements can be added to or removed from either the front or rear. This means that elements can be added or removed from both ends of the queue, providing flexibility in accessing and manipulating the elements. This makes Dequeue a versatile data structure for various applications that require efficient insertion and deletion operations at both ends.
37.
Number of binary trees formed with 5 nodes are
Correct Answer
D. 42
Explanation
The number of binary trees that can be formed with 5 nodes is 42. This can be determined using the formula for the number of binary trees with n nodes, which is given by the Catalan number C(n) = (2n)! / ((n+1)! * n!). Plugging in n=5, we get C(5) = (2*5)! / ((5+1)! * 5!) = 10! / (6! * 5!) = 42. Therefore, the correct answer is 42.
38.
The _______ memory allocation function modifies the previous allocated space.
Correct Answer
D. realloc
Explanation
The realloc memory allocation function is used to modify the previously allocated space. It allows for resizing the memory block that was previously allocated using malloc, calloc, or realloc itself. The function takes the pointer to the previously allocated block, the new size of the block, and returns a pointer to the modified block. This function is useful when there is a need to change the size of the allocated memory dynamically, such as when adding or removing elements from an array.
39.
The statement printf("%c", 100); will print?
Correct Answer
C. prints ASCII equivalent of 100
Explanation
The statement printf("%c", 100); will print the ASCII equivalent of the number 100, which is the character 'd'.
40.
When determining the efficiency of algorithm, the space factor is measured by
Correct Answer
A. Counting the maximum memory needed by the algorithm
Explanation
The efficiency of an algorithm is determined by measuring the space factor, which refers to the amount of memory needed by the algorithm. In this case, the correct answer is counting the maximum memory needed by the algorithm. This means that we consider the highest amount of memory that the algorithm requires during its execution. By counting the maximum memory usage, we can evaluate the algorithm's efficiency in terms of space utilization and make comparisons with other algorithms.
41.
The complexity of Bubble sort algorithm is
Correct Answer
B. O(log n)
42.
Linked lists are best suited
Correct Answer
B. for the size of the structure and the data in the structure are constantly changing
Explanation
Linked lists are best suited for situations where the size of the structure and the data in the structure are constantly changing. This is because linked lists allow for efficient insertion and deletion of elements at any position in the list, without the need to shift or resize the entire structure. The dynamic nature of linked lists makes them ideal for situations where the collection of data is frequently modified, as they can easily accommodate changes in size and content without incurring significant overhead.
43.
If the values of a variable in one module is indirectly changed by another module, this situation is called
Correct Answer
C. side effect
Explanation
When the values of a variable in one module are indirectly changed by another module, it is referred to as a "side effect." This means that the second module has an impact on the state or behavior of the first module, even though it may not be the intended or expected outcome. Side effects can occur when modules interact with each other and can sometimes lead to unexpected bugs or behavior in a program.
44.
In linear search algorithm the Worst case occurs when
Correct Answer
D. The item is the last element in the array or is not there at all
Explanation
In linear search algorithm, the worst case occurs when the item is the last element in the array or is not there at all. This is because in linear search, we iterate through each element of the array sequentially until we find the desired item or reach the end of the array. Therefore, if the item is the last element, we have to iterate through the entire array before finding it. Similarly, if the item is not present in the array, we have to iterate through the entire array to confirm its absence.
45.
For an algorithm the complexity of the average case is
Correct Answer
A. Much more complicated to analyze than that of worst case
Explanation
The complexity of the average case for an algorithm is much more complicated to analyze than that of the worst case. This is because the worst case scenario represents the maximum amount of time or resources that the algorithm can take, while the average case takes into account the distribution of inputs and their likelihood of occurring. Analyzing the average case requires considering all possible inputs and their probabilities, making it a more complex task compared to analyzing the worst case.
46.
The complexity of merge sort algorithm is
Correct Answer
D. O(n log n)
Explanation
The complexity of the merge sort algorithm is O(n log n). This means that the time it takes to sort a list of n elements using merge sort grows at a rate that is proportional to n multiplied by the logarithm of n. This is considered to be an efficient sorting algorithm as it has a better time complexity compared to other sorting algorithms like bubble sort or insertion sort, which have a time complexity of O(n2).
47.
The complexity of linear search algorithm is
Correct Answer
A. O(n)
Explanation
The complexity of the linear search algorithm is O(n) because it has to iterate through each element in the worst case scenario. This means that the time it takes to find the desired element increases linearly with the size of the input. It does not have any logarithmic or quadratic components, which are represented by O(log n) and O(n^2) respectively. O(n log n) is the complexity of certain sorting algorithms, but it is not applicable to linear search.
48.
When determining the efficiency of algorithm the time factor is measured by
Correct Answer
B. Counting the number of key operations
Explanation
The efficiency of an algorithm is measured by counting the number of key operations. Key operations refer to the fundamental operations or steps performed in the algorithm that directly contribute to its execution time. By counting these key operations, we can analyze and compare the efficiency of different algorithms in terms of their time complexity. Counting microseconds, the number of statements, or the kilobytes of the algorithm are not accurate measures of time factor in determining efficiency.
49.
Which of the following data structure is linear data structure?
Correct Answer
C. Arrays
Explanation
Arrays are a linear data structure because they store data elements in a contiguous memory location. Each element in an array can be accessed by its index, which is a linear sequence of integers starting from 0. Arrays have a fixed size and can store elements of the same data type. They are efficient for accessing and retrieving elements, but not for inserting or deleting elements in the middle of the array.
50.
The elements of an array are stored successively in memory cells because
Correct Answer
A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
Explanation
The elements of an array are stored successively in memory cells because by this way, the computer can keep track of only the address of the first element. The addresses of other elements can be calculated by adding the appropriate offset to the address of the first element. This allows for efficient memory management and access to array elements.