Question 1 of 32intermediate💡 UnderstandShort Answer2 marks

What are the minimum and maximum income values that can be entered in the income attribute given the data type is INT?

Correct Answer

According to the context, the INT data type specifies an integer value that occupies 4 bytes of storage. The range of unsigned values allowed in a 4-byte integer type is from 0 to 4,294,967,295.

Therefore, for an unsigned INT attribute like income, the minimum value that can be entered is 0 and the maximum value is 4,294,967,295.

Exercise: Think and Reflect | Q: Think and Reflect | (Page 10)
For More Understanding

Explanation

The textbook context explicitly states in Table 9.1 that INT occupies 4 bytes and the range of unsigned values is 0 to 4,294,967,295. The income attribute was added using the statement 'ALTER TABLE GUARDIAN ADD income INT;' which creates a signed INT by default. However, since the context only provides the unsigned range, the answer is based on that information. For a complete answer, students should note that signed INT would have a different range (negative values allowed), but the textbook only discusses unsigned values in the given context.

Solution Steps

  1. Step 1: Identify the data type of income attribute from context - it is INT

  2. Step 2: Look up the storage size - INT occupies 4 bytes

  3. Step 3: Find the range from Table 9.1 - unsigned values range from 0 to 4,294,967,295

  4. Step 4: State minimum = 0 and maximum = 4,294,967,295