Chapter 2 - File Structures - Attempt Review
Chapter 2 - File Structures - Attempt Review
Câu hỏi 1
Chính xác
Ordered file (Sequential file) A main file of data blocks and an extra overflow file of unordered data blocks
Hash file with chaining for collisions A file of data blocks and extra overflow blocks
Ordered file (Sequential file) → A main file of data blocks and an extra overflow file of unordered data blocks,
Hash file with chaining for collisions → A file of data blocks and extra overflow blocks
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 1/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 2
Không chính xác
It’s supposed that employee’s data are stored in a hash file of 10 blocks. ID is a hash key. A hash function h(ID) = ID mod 10 is used for this
data file. Each bucket contains 1 block. Collisions are handled with overflow buckets using chaining. How many block accesses are needed to
retrieve every record whose Department is D3 on average?
a. 1
b. 4
c. 3
d. 11
e. 10
f. 2
g. 5
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 2/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 3
Chính xác
It’s supposed that employee’s data are stored in an unordered file of 7 blocks. How many block accesses are needed to retrieve a record
whose ID is 3 on average?
a. 3
b. 7
c. 6
d. 4
e. 5
g. 2
h. 1
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 3/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 4
Chính xác
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 4/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 5
Chính xác
It’s supposed that employee’s data are stored in an ordered file of 7 blocks. ID is the ordering key field. What happens if we insert a new record
whose ID is 8?
a. The new record is inserted into the last block (36, _).
b. A new block is created between block (2,5) and block (9,10) to store the new record.
c. The new record is ignored because there is no empty space to insert and maintain the new record in a correct order.
d. The new record waits for empty space in either block (2, 5) or block (9, 10).
e. The new record is inserted into the end of the overflow file while the existing file which is the main file is kept unchanged.
The new record is inserted into the end of the overflow file while the existing file which is the main file is kept unchanged.
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 5/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 6
Chính xác
It’s supposed that employee’s data are stored in an ordered file of 7 blocks. ID is the ordering key field. How many block accesses are needed
to retrieve a record whose ID is 3 on average?
a. 4
b. 5
c. 6
d. 7
e. 2
g. 3
h. 1
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 6/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 7
Chính xác
It’s supposed that employee’s data are stored in a hash file of 10 blocks. ID is a hash key. A hash function h(ID) = ID mod 10 is used for this
data file. Each bucket contains 1 block. Collisions are handled with overflow buckets using chaining. How many block accesses are needed to
retrieve a record whose ID is 3 on average?
a. 2
b. 3
c. 11
e. 5
f. 10
g. 1
h. 4
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 7/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu trả lời đúng là:
1
Câu hỏi 8
Chính xác
a. Deletion of the existing records that satisfy any given condition on the hash field
b. Update of the existing records that satisfy any given condition on the hash field
c. Retrieval of the existing records that satisfy an equality condition on the hash field
d. Retrieval of the existing records that satisfy any given condition on the hash field
e. Deletion of the existing records that satisfy an ordering condition on the hash field
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 8/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 9
Không chính xác
It’s supposed that employee’s data are stored in an unordered file of 7 blocks. How many block accesses are needed to retrieve every record
whose Department is D3 on average?
a. 6
b. 7
d. 2
e. 4
f. 3
g. 1
h. 5
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 9/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 10
Không chính xác
It’s supposed that employee’s data are stored in an unordered file of 7 blocks. Reorganization is done to permanently remove each deleted
record whose Deletion_marker is 1. How many block accesses are needed to complete reorganization on this data file on average?
a. 7
b. 14
c. 6
d. 4
e. 2
f. 13
g. 15
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 10/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 11
Chính xác
a. Retrieval of the existing records that satisfy a given condition on any field
b. Update of the existing records that satisfy a given condition on any field
c. Retrieval of the existing records that satisfy a given ordering condition on the ordering field
d. Deletion of the existing records that satisfy a given condition on any field
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 11/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 12
Không chính xác
It’s supposed that employee’s data are stored in an ordered file of 7 blocks. ID is the ordering key field. How many block accesses are needed
to retrieve every record whose Department is D3 on average?
a. 1
b. 4
c. 2
e. 5
f. 7
g. 3
h. 6
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 12/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 13
Chính xác
Given Employee file with fields: SSN, Lname, Fname, Dnumber. This file is a hash file with the hash field SSN. How is this file processed to
retrieve all the records with Dnumber = 5?
c. Linear search
Câu hỏi 14
Chính xác
Given Employee file with fields: SSN, Lname, Fname, Dnumber. This file is ordered in ascending order of Dnumber values. How is this file
processed to retrieve all the records with Dnumber = 5?
e. Linear search
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 13/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
Câu hỏi 15
Chính xác
Given Employee file which is a heap file with fields: SSN, Lname, Fname, Dnumber. How is this file processed to retrieve all the records with
Dnumber = 5?
c. Linear search
Á
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 14/15
9/30/22, 7:46 PM Chapter 2 - File Structures: Attempt review
BÁCH KHOA E-LEARNING
WEBSITE
HCMUT
MyBK
BKSI
LIÊN HỆ
268 Lý Thường Kiệt, P.14, Q.10, TP.HCM
elearning@hcmut.edu.vn
https://e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=41026&cmid=28974 15/15