GATE 2005
203 questions
MCQ 2031-mark 203
Questions 156–160 of 203
Increasing the RAM of a computer typically improves performance because:
Answer: (C)
When a computer has more RAM, it can keep more pages of the running programs in memory. Because of this, fewer page faults occur. A page fault means a slow trip to the disk.
Answer: Fewer page faults occur
Answer: Fewer page faults occur
A student wishes to create symbolic links in a computer system running Unix. Three text files named "file1", "file2" and "file3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file1 contains information about her hobbies, file2 contains information about her friends and file3 contains information about her courses. The student executes the following sequence of commands from her current working directory.
Which of the following types of information would be lost from her file system?
I.Hobbies
II.Friends
III.Courses
ln -s file1 file2
ln -s file2 file3 Which of the following types of information would be lost from her file system?
I.Hobbies
II.Friends
III.Courses
Answer: (B)
ln -s makes a symbolic link: ln -s target link_name. Here each command makes a link that takes the place of the existing file with the link's name.
- ln -s file1 file2: file2 becomes a link to file1. The old contents of file2 (friends) are replaced, so friends are lost.
- ln -s file2 file3: file3 becomes a link to file2. The old contents of file3 (courses) are replaced, so courses are lost.
file1 is only the target of a link and is never changed. It still holds the hobbies, and file3 and file2 now both lead to it: file3 file2 file1.
So II and III are lost, and I is kept.
Answer: (B)
- ln -s file1 file2: file2 becomes a link to file1. The old contents of file2 (friends) are replaced, so friends are lost.
- ln -s file2 file3: file3 becomes a link to file2. The old contents of file3 (courses) are replaced, so courses are lost.
file1 is only the target of a link and is never changed. It still holds the hobbies, and file3 and file2 now both lead to it: file3 file2 file1.
So II and III are lost, and I is kept.
Answer: (B)
Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below:
If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this information should appear as an attribute of
If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this information should appear as an attribute of
Answer: (C)
The relationship Lodging is many to many: one person can stay in many rooms and one room can hold many persons. The rent depends on the particular person and room together, for example on how many persons share the room. So it is not a property of the room alone or of the person alone.
An attribute that depends on both entities in a many-to-many relationship belongs to the relationship, so the rent is an attribute of Lodging.
Answer: (C)
An attribute that depends on both entities in a many-to-many relationship belongs to the relationship, so the rent is an attribute of Lodging.
Answer: (C)
Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?
Answer: (B)
Count the tables needed:
- E1: 1 table.
- E2: 1 table.
- R1 (one-to-many, no attributes): no table. Put the key of the "one" side as a foreign key in the table of the "many" side.
- R2 (many-to-many): 1 table, holding the keys of E1 and E2.
Total = 1 + 1 + 1 = 3 tables.
Answer: (B)
- E1: 1 table.
- E2: 1 table.
- R1 (one-to-many, no attributes): no table. Put the key of the "one" side as a foreign key in the table of the "many" side.
- R2 (many-to-many): 1 table, holding the keys of E1 and E2.
Total = 1 + 1 + 1 = 3 tables.
Answer: (B)
Consider a relation scheme R=(A,B,C,D,E,H) on which the following functional dependencies hold: {AB, BCD, EC, DA}. What are the candidate keys of R?
Answer: (D)
E and H never appear on the right side of any FD, so every candidate key must contain E and H. This rules out (A), (B) and (C): (A) and (B) leave out H, and (C) has BCH, which leaves out E.
Check : gives and nothing more. So EH is not a key and one more attribute is needed.
- : adds B, adds C, adds D. Result , all attributes.
- : adds C, adds D, adds A. All attributes.
- : adds A, adds B, adds C. All attributes.
Each of these is minimal, since EH alone is not a key. So the candidate keys are AEH, BEH and DEH.
Answer: (D)
Check : gives and nothing more. So EH is not a key and one more attribute is needed.
- : adds B, adds C, adds D. Result , all attributes.
- : adds C, adds D, adds A. All attributes.
- : adds A, adds B, adds C. All attributes.
Each of these is minimal, since EH alone is not a key. So the candidate keys are AEH, BEH and DEH.
Answer: (D)