Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Primary File Organization Consider the following table: CREATE TABLE User ( Logi

ID: 649776 • Letter: P

Question

Primary File Organization

Consider the following table:

CREATE TABLE User (

LoginID CHAR(15) PRIMARY KEY,

Password CHAR(15),

Name CHAR(25),

City CHAR(25),

State CHAR(24),

Email CHAR(20),

YearOfBirth INT );

Suppose the DBMS uses 1 byte to store a character and 4 bytes to store integers. The total number of rows in the table is 4000. The size of each disk block is B = 512 bytes.

(a) Compute the number of disk blocks needed to store the table.

(b) Consider the following query:

SELECT * FROM User WHERE LoginID =

Explanation / Answer

(a)In a preferred embodiment of this invention, if the number of slots in a field are too numerous to feasibly use a single-byte code, but a relatively small number of slots contain most of the records in a field, then an integral- byte code using a combination of single-byte and variable-byte codes can be used. This "combination-code" encodes the largest slots using one byte and the remaining slots using multiple bytes. Thus, the first single-byte of the combination code represents the 256 largest slots (i.e. numeric equivalents 0 through 255 are encoded as 00,B through FF16). The second single-byte of the combination code represents the next 256 largest slots (i.e. numeric equivalents 256 through 511 are also encoded as 0016 through FF16). The third single-byte of the combination code represents the next 256 largest slots (i.e. numeric equivalents 512 through 767 are also encoded as 00,6 through FF1B), and so on. Then, two bytes are used to represent the next 65,536 largest slots. (For example, numeric equivalents 768 through 66,303 are encoded as 0000?e through FFFF16). Then three bytes are used to represent the next 16,774,216 largest slots, and so on. The type byte distinguishes between the various single bytes (e.g. the first, second and third single-bytes as above) and also indicates use of the multiple-bytes. As the name suggests, the combination code falls between the single-byte code and the variable-byte code in achieving a tradeoff between reduced storage requirements and increased storage complexity.

(d) The mechanism for distributing database objects varies by RDBMS, depending on the manner in which storage space is allocated. Most databases have the ability to assign a given object to be created on a specific disk. These objects, and guidelines for some of them, are provided in the following list. A redundant array of independent disks, or RAID, can provide large amounts of I/O throughput and capacity, while appearing to the operating system and RDBMS as a single large disk (or multiple disks, as desired, for manageability).

The use of RAID can greatly simplify the database layout process by providing an abstraction layer above the physical disks while ensuring high performance. Regardless of the implemented RDBMS and the chosen disk arrangement, be sure that you properly distribute the following types of database objects:

? Database log or archive files.

? Temporary workspace used by the database.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote