First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Fundamentals of COBOL Programming
In the COBOL Identification Division, which paragraph is required and must be the very first paragraph of a source program?
- AUTHOR
- ENVIRONMENT DIVISION
- DATE-WRITTEN
- PROGRAM-ID Correct answer.
Explanation
PROGRAM-ID is the only mandatory paragraph in the Identification Division and it must appear first, naming the program. The other entries are optional documentation paragraphs, and ENVIRONMENT DIVISION is a separate division, not a paragraph.
Question 2Fundamentals of COBOL Programming
Which COBOL division contains the FILE SECTION and WORKING-STORAGE SECTION?
- DATA DIVISION Correct answer.
- PROCEDURE DIVISION
- ENVIRONMENT DIVISION
- IDENTIFICATION DIVISION
Explanation
The DATA DIVISION holds all data descriptions, organized into sections such as FILE SECTION, WORKING-STORAGE SECTION, and LINKAGE SECTION. File control entries naming files belong to the ENVIRONMENT DIVISION, while executable statements belong to the PROCEDURE DIVISION.
Question 3Fundamentals of COBOL Programming
What is the maximum number of characters permitted in a COBOL user-defined data name (for example, a field name in WORKING-STORAGE)?
- 63
- 128
- 30 Correct answer.
- 8
Explanation
COBOL user-defined words such as data names may be up to 30 characters long and must contain at least one alphabetic character, with no embedded spaces or hyphens at the end. Older standards limited names to fewer characters, but the 30-character limit has applied since COBOL 85.
Question 4Fundamentals of COBOL Programming
In the DATA DIVISION, what does the PICTURE clause 9(5)V99 describe?
- An alphanumeric field of seven characters
- A five-digit integer with two decimal places stored in the field Correct answer.
- A numeric edited field containing a decimal point character
- A five-character field with a literal V and two 9s
Explanation
The V in a PICTURE represents an assumed decimal point that occupies no storage, so 9(5)V99 defines a seven-digit numeric item with five integer positions and two decimal positions. The actual stored length is seven bytes and no decimal point character is kept.
Question 5Fundamentals of COBOL Programming
Which clause in a DATA DIVISION entry causes a group item to be subdivided into named elementary items?
- REDEFINES
- PIC
- OCCURS
- Level numbers Correct answer.
Explanation
Hierarchy in COBOL data is expressed through level numbers: a group item has a lower level number than the elementary items beneath it, and the group has no PICTURE clause. REDEFINES overlays storage and OCCURS repeats entries, but neither creates the group-to-elementary relationship.
Question 6Fundamentals of COBOL Programming
Which statement correctly moves the value of WS-A into WS-B and then adds 1 to WS-B in the PROCEDURE DIVISION?
- SET WS-B = WS-A + 1
- COMPUTE WS-B = WS-A ADD 1
- MOVE WS-A TO WS-B ADD 1 TO WS-B Correct answer.
- MOVE WS-A INTO WS-B THEN ADD 1
Explanation
COBOL statements are written as separate sentences or within a paragraph, each beginning with a verb such as MOVE or ADD. MOVE WS-A TO WS-B transfers the value and ADD 1 TO WS-B increments the receiving field. The other forms borrow syntax from other languages that COBOL does not accept.
Question 7Fundamentals of COBOL Programming
What does the value clause VALUE ZERO do when specified for a numeric item in WORKING-STORAGE?
- It initializes the item to numeric zero in all digit positions Correct answer.
- It suppresses initialization of the item
- It converts the item to an alphanumeric field
- It initializes the item to a single zero character
Explanation
ZERO is a figurative constant that fills every digit position of a numeric item with the digit 0, so the field holds the numeric value zero. It does not change the PICTURE or the usage of the item.
Question 8Fundamentals of COBOL Programming
Which COBOL verb is used to transfer control unconditionally to a named paragraph and never return to the following statement?
- CALL
- EXIT PROGRAM
- GO TO Correct answer.
- PERFORM
Explanation
GO TO transfers control directly to the named paragraph and execution continues from there, so the statement after the GO TO is bypassed. PERFORM, by contrast, returns control to the statement following the PERFORM when the performed paragraph ends.
Question 9Fundamentals of COBOL Programming
A program declares 01 WS-GROUP with PIC X(10) and then 01 WS-NUM PIC 9(4). After MOVE 'ABCDEFGHIJ' TO WS-GROUP, what does WS-NUM contain?
- FGHI
- 0000
- ABCD Correct answer.
- The move fails at compile time
Explanation
A group item with PIC X(10) occupies ten character positions, and moving a ten-character literal fills it left to right. WS-NUM is a separate field and is unaffected by the move to WS-GROUP, so it retains its initial value, which for a numeric item without VALUE is zero.
Question 10Fundamentals of COBOL Programming
What is the effect of the USAGE IS COMP-3 clause on a numeric item?
- It stores the value as a binary integer of fixed length
- It stores the value in floating-point format
- It stores the value as display characters, one digit per byte
- It stores the value in packed decimal format, two digits per byte plus a sign nibble Correct answer.
Explanation
COMP-3, or packed decimal, stores two decimal digits in each byte and uses a final half-byte for the sign, so an item with an odd number of digits plus sign occupies one more byte than a simple division suggests. This reduces storage compared with DISPLAY usage and preserves exact decimal values.
Question 11Fundamentals of COBOL Programming
How many bytes of storage does an item declared PIC S9(5) USAGE COMP-3 occupy?
- 5
- 8
- 3 Correct answer.
- 6
Explanation
Packed decimal stores two digits per byte, so five digits need three bytes: two bytes hold four digits and the third byte holds the final digit plus the sign nibble. The sign is included in the last byte, so no extra byte is added.
Question 12Fundamentals of COBOL Programming
In a PERFORM statement, what is the difference between PERFORM PARA-A and PERFORM PARA-A THRU PARA-C?
- The first executes once; the second executes three times
- The first executes one paragraph; the second executes PARA-A through PARA-C inclusive Correct answer.
- The first returns a value; the second does not
- The first is a call; the second is a copy
Explanation
PERFORM with a single procedure name executes only that paragraph or section. The THRU phrase extends the performed range to include every paragraph from the first name through the last name, inclusive.
Question 13Fundamentals of COBOL Programming
A table is defined with OCCURS 10 TIMES and an index-name is used in a SEARCH statement. What is the initial value of an index set with SET IDX TO 1?
- 0
- 10
- The value of the first table element
- 1 Correct answer.
Explanation
An index is an offset-like item whose value corresponds to an occurrence number, so SET IDX TO 1 positions the index at the first occurrence. Unlike subscripts, indexes are not ordinary integers and are manipulated with SET and SEARCH rather than by direct arithmetic.
Question 14Fundamentals of COBOL Programming
What does the SEARCH statement do when it is used with a table that has an OCCURS clause and a defined index?
- It sorts the table entries in ascending order
- It performs a binary search on a sorted table
- It scans the table sequentially until a condition is satisfied or the table ends Correct answer.
- It deletes duplicate entries from the table
Explanation
SEARCH performs a serial scan, testing the WHEN condition at each occurrence until it is true or the table is exhausted, at which point the AT END phrase runs. A binary search requires SEARCH ALL on a table with a KEY clause and sorted data.
Question 15Fundamentals of COBOL Programming
Which statement correctly uses the EVALUATE verb to test a code field against three possible values?
- EVALUATE WS-CODE WHEN 'A' PERFORM PARA-A WHEN 'B' PERFORM PARA-B WHEN OTHER PERFORM PARA-C END-EVALUATE Correct answer.
- EVALUATE WS-CODE CASE 'A' PERFORM PARA-A END-EVALUATE
- IF WS-CODE = 'A' OR 'B' OR 'C' PERFORM PARA-A END-IF
- SELECT WS-CODE WHEN 'A' PERFORM PARA-A END-SELECT
Explanation
EVALUATE lists one or more WHEN phrases, each followed by the statements to run when that value matches, and WHEN OTHER supplies the default. The construct ends with END-EVALUATE and can replace a nested IF chain.
Question 16Fundamentals of COBOL Programming
What is the purpose of the FILE-CONTROL paragraph in the ENVIRONMENT DIVISION?
- It associates each file name with an external data set and access mode Correct answer.
- It defines the working-storage fields used by the program
- It opens and closes files at run time
- It describes the record layout of each file
Explanation
FILE-CONTROL contains SELECT statements that link a COBOL file name to an external data set and specify organization and access mode. Record layouts belong in the FILE SECTION of the DATA DIVISION, and open and close operations are PROCEDURE DIVISION verbs.
Question 17Fundamentals of COBOL Programming
A sequential file is read in a loop. Which statement correctly detects the end of the file?
- READ IN-FILE WHILE WS-EOF = 'N' END-READ
- READ IN-FILE UNTIL WS-EOF = 'Y' END-READ
- READ IN-FILE AT END MOVE 'Y' TO WS-EOF END-READ Correct answer.
- READ IN-FILE ON EXCEPTION MOVE 'Y' TO WS-EOF END-READ
Explanation
The READ statement supports the AT END phrase, which runs the specified imperative statements when no next record exists. A common pattern sets an end-of-file switch in AT END and tests that switch in a PERFORM UNTIL loop around the READ.
Question 18Fundamentals of COBOL Programming
What does the INITIALIZE verb do when applied to a group item?
- It copies the group to another group
- It deletes the group from working storage
- It sets every elementary item to the value specified in its VALUE clause
- It sets numeric items to zero and alphanumeric items to spaces Correct answer.
Explanation
INITIALIZE assigns category-appropriate initial values: numeric fields receive zeros and alphanumeric fields receive spaces. It does not reapply VALUE clauses, which are applied only when the program starts.
Question 19Fundamentals of COBOL Programming
Which clause allows two different data descriptions to share the same storage area in WORKING-STORAGE?
- REDEFINES Correct answer.
- RENAMES
- OCCURS
- USAGE
Explanation
REDEFINES lets a second data description occupy the same storage as an earlier item at the same level, which is useful for interpreting the same bytes in different ways. The redefining item must immediately follow the redefined item and must not be longer than it.
Question 20Fundamentals of COBOL Programming
A field is declared PIC 9(3) and receives the value 1234 through a MOVE. What happens?
- The program abends with a size error
- The value is truncated on the right and becomes 123
- The field expands to four digits automatically
- The value is truncated on the left and becomes 234 Correct answer.
Explanation
When a numeric value is moved to a receiving field with fewer integer positions, the leftmost digits are lost and the rightmost digits are kept. No size error condition is raised for this truncation unless ON SIZE ERROR is specified for an arithmetic operation.
Question 21Fundamentals of COBOL Programming
Which statement correctly defines a two-level table where each entry contains a name and an amount?
- 01 WS-TABLE OCCURS 5 PIC X(15)
- 01 WS-TABLE 05 WS-NAME PIC X(10) OCCURS 5 05 WS-AMT PIC 9(5)
- 01 WS-TABLE OCCURS 5 TIMES 05 WS-NAME PIC X(10) 05 WS-AMT PIC 9(5) Correct answer.
- 01 WS-TABLE PIC X(15) OCCURS 5
Explanation
A repeating group is defined by placing OCCURS on a group item and describing the elementary items beneath it with higher level numbers. Each occurrence then contains both WS-NAME and WS-AMT, and the whole group repeats five times.
Question 22Fundamentals of COBOL Programming
In a CALL statement, what is the purpose of the USING phrase?
- It names the subprogram to be invoked
- It specifies the return code of the call
- It declares the language of the called module
- It passes parameters to the called subprogram Correct answer.
Explanation
The CALL statement names the subprogram after the verb and lists the parameters to pass in the USING phrase. The called program receives them through its LINKAGE SECTION, and BY REFERENCE or BY CONTENT can control the passing mechanism.
Question 23Fundamentals of COBOL Programming
A program uses an EVALUATE TRUE statement with several WHEN conditions. How are the WHEN phrases evaluated?
- The first WHEN whose condition is true executes and the remaining WHEN phrases are skipped Correct answer.
- All matching WHEN phrases execute in sequence
- The last WHEN whose condition is true takes precedence
- The WHEN phrases execute in reverse order
Explanation
EVALUATE TRUE tests each WHEN condition in the order written and transfers control to the statements of the first condition that is true. After those statements run, control passes to END-EVALUATE, so later WHEN phrases are not evaluated.
Question 24Fundamentals of COBOL Programming
An item is declared PIC S9(4) USAGE COMP. Why can a MOVE of 99999 to this item produce unexpected results?
- COMP items always store four characters
- COMP items cannot hold a sign
- The binary field can store only a limited range, so the value may be truncated or cause a size error Correct answer.
- The PICTURE is ignored for COMP items
Explanation
A COMP item with four digit positions is stored as a binary halfword whose range is smaller than five decimal digits, so moving 99999 can truncate the value or trigger a size error in arithmetic. The PICTURE still governs the decimal digits the field is intended to hold.
Question 25Fundamentals of COBOL Programming
A file is defined with ORGANIZATION IS INDEXED and ACCESS MODE IS RANDOM. Which statement correctly retrieves a specific record by its key?
- START IN-FILE KEY IS EQUAL TO WS-KEY
- READ IN-FILE NEXT RECORD
- READ IN-FILE INTO WS-REC KEY IS WS-KEY Correct answer.
- DELETE IN-FILE RECORD
Explanation
For an indexed file in random access mode, READ with the KEY IS phrase retrieves the record whose key matches the supplied value. NEXT RECORD is used for sequential retrieval, and START positions the file without returning a record.
Question 26Fundamentals of COBOL Programming
In the DATA DIVISION, which level number marks an elementary item that has no subordinate fields?
- A level number from 02 through 49 Correct answer.
- Level 01
- Level 88
- Level 66
Explanation
Elementary items carry a level number between 02 and 49 and have a PICTURE clause describing their own storage. Level 01 introduces a group or independent item, level 66 renames existing storage, and level 88 declares condition names rather than data.
Question 27Fundamentals of COBOL Programming
Which clause in a data description establishes that a field's value must fall within an accepted set of literals during execution of a program that uses the data?
- REDEFINES
- JUSTIFIED RIGHT
- VALUE IS Correct answer.
- OCCURS
Explanation
A VALUE clause on a level-88 condition-name, or on a working-storage item, documents and can enforce the set of literals a field may hold. REDEFINES overlays storage, OCCURS repeats entries, and JUSTIFIED RIGHT controls alignment of alphanumeric data.
Question 28Fundamentals of COBOL Programming
A program needs to repeat a paragraph a fixed number of times without any terminating condition test on the data. Which form of PERFORM should be coded?
- PERFORM PARA-A VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 10
- PERFORM PARA-A TIMES 10 Correct answer.
- PERFORM PARA-A UNTIL WS-EOF = 'Y'
- PERFORM PARA-A THRU PARA-A
Explanation
The PERFORM ... TIMES form executes the named paragraph an exact number of times and requires no condition. The UNTIL and VARYING forms both rely on a condition test, and the THRU form simply names a range of paragraphs without repetition control.
Question 29Fundamentals of COBOL Programming
What is the effect of coding the GIVING phrase on an arithmetic statement such as ADD WS-A TO WS-B GIVING WS-C?
- WS-B receives the sum and WS-C is left unchanged.
- Both WS-B and WS-C receive the sum.
- WS-A and WS-B are both replaced by the sum.
- WS-C receives the sum while WS-B keeps its original value. Correct answer.
Explanation
When GIVING is present, the result of the operation is placed only in the receiving item named after GIVING, and the operands themselves are not modified. Without GIVING, ADD ... TO would update WS-B in place.
Question 30Fundamentals of COBOL Programming
A working-storage item is declared PIC X(5) VALUE 'AB'. What is stored in the remaining positions of that item?
- Low-values
- The characters are repeated to fill the field
- Spaces Correct answer.
- Zeros
Explanation
For an alphanumeric item, a literal shorter than the field is left-justified and the unused right-hand positions are padded with spaces. Low-values and zeros are not used for PIC X fields, and no repetition of the literal occurs.
Question 31Fundamentals of COBOL Programming
Which statement correctly assigns the literal 100 to an index-name so that it can be used to address a table entry?
- ADD 100 TO WS-INDEX
- SET WS-INDEX TO 100 Correct answer.
- MOVE 100 TO WS-INDEX
- COMPUTE WS-INDEX = 100
Explanation
Index-names must be manipulated with the SET statement, which converts the numeric value into the internal index representation. MOVE, COMPUTE, and ADD treat the receiving item as ordinary data and are not valid ways to load an index-name.
Question 32Fundamentals of COBOL Programming
A file is opened with OPEN EXTEND. What happens when the program subsequently executes WRITE statements for that file?
- Records are appended after the last existing record in the file. Correct answer.
- The WRITE is rejected because EXTEND permits only reading.
- Records are inserted at the current read position.
- Records replace existing records starting at the beginning of the file.
Explanation
OPEN EXTEND positions the file after its existing contents so that each WRITE adds a new record at the end. It does not allow repositioning or overwriting, and it is a valid mode for output-only sequential files.
Question 33Fundamentals of COBOL Programming
Which statement correctly declares a group item named WS-CUSTOMER that contains a 10-character name and a 6-digit account number?
- 01 WS-CUSTOMER. 05 WS-NAME PIC X(10). 05 WS-ACCT PIC 9(6). Correct answer.
- 01 WS-CUSTOMER REDEFINES WS-NAME PIC X(10).
- 01 WS-CUSTOMER PIC X(16).
- 01 WS-CUSTOMER OCCURS 2 TIMES.
Explanation
A group item has no PICTURE clause; it is followed by subordinate elementary items at a deeper level, each with its own PICTURE. The two subordinate items together determine the group's total length.
Question 34Fundamentals of COBOL Programming
A program contains a paragraph named CALC-TOTALS and a data item named CALC-TOTALS. What is the consequence?
- The compiler reports a duplicate name error because procedure and data names share one namespace. Correct answer.
- The data item takes precedence and the PERFORM uses the data item.
- The paragraph name takes precedence and the data item is ignored.
- The program compiles and the two names are distinguished by context.
Explanation
COBOL uses a single namespace for user-defined names, so a paragraph and a data item cannot share the same name. The compiler flags the duplicate definition rather than resolving it by context or precedence.
Question 35Fundamentals of COBOL Programming
In the PROCEDURE DIVISION, what does the statement STOP RUN accomplish?
- It suspends the program and waits for operator input.
- It transfers control to the last paragraph of the program.
- It closes all files and returns control to the calling program.
- It terminates the run unit and returns control to the operating system. Correct answer.
Explanation
STOP RUN ends the entire run unit, closing files as part of normal termination and returning control to the system. GOBACK is the verb used to return control to a calling program without terminating the run unit.
Question 36Fundamentals of COBOL Programming
A subprogram is called with CALL 'SUBPGM' USING WS-REC. Which clause in the subprogram's PROCEDURE DIVISION header must correspond to that parameter?
- A WORKING-STORAGE SECTION entry with a VALUE clause
- A LINKAGE SECTION entry named in the USING phrase of the PROCEDURE DIVISION header Correct answer.
- A FILE SECTION record description
- A LOCAL-STORAGE SECTION entry
Explanation
Parameters passed by a CALL are described in the LINKAGE SECTION of the subprogram and listed in the USING phrase of its PROCEDURE DIVISION header. WORKING-STORAGE, LOCAL-STORAGE, and FILE SECTION items are not addressable by the caller.
Question 37Fundamentals of COBOL Programming
A table is declared with OCCURS 20 TIMES and is processed with PERFORM VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 20. Which subscripting form correctly references the tenth entry?
- WS-ENTRY 10
- WS-ENTRY (WS-I + 10)
- WS-ENTRY (10) Correct answer.
- WS-ENTRY OF 10
Explanation
A table element is referenced by placing the subscript in parentheses immediately after the entry name, so WS-ENTRY (10) addresses the tenth occurrence. Arithmetic expressions and other punctuation forms are not valid subscript syntax in this position.
Question 38Fundamentals of COBOL Programming
A record is defined with 05 WS-CODE PIC X, followed by 05 WS-AMT PIC 9(3). A program executes MOVE 'A12' TO WS-CODE. What is the resulting content of WS-AMT?
- Unchanged from its previous value
- Spaces
- 012 Correct answer.
- 123
Explanation
WS-CODE is a one-character field, so only the first character of the literal is moved; the remaining characters have no target. WS-AMT therefore keeps its original value and is not affected by the truncated move.
Question 39Fundamentals of COBOL Programming
Which statement correctly uses the INSPECT verb to count how many times the character 'X' appears in WS-TEXT?
- INSPECT WS-TEXT REPLACING ALL 'X' BY WS-COUNT
- INSPECT WS-TEXT TALLYING WS-COUNT FOR ALL 'X' Correct answer.
- SEARCH WS-TEXT FOR 'X'
- INSPECT WS-TEXT COUNTING ALL 'X'
Explanation
TALLYING names a counter that is incremented for each occurrence matched by the FOR phrase, so WS-COUNT holds the number of 'X' characters. REPLACING changes data rather than counting it, and SEARCH applies to tables, not to a simple character string.
Question 40Fundamentals of COBOL Programming
A program declares 01 WS-TAB with 05 WS-E PIC X(4) OCCURS 5 TIMES. What is the total length of WS-TAB?
- 5 bytes
- 9 bytes
- 20 bytes Correct answer.
- 4 bytes
Explanation
Each occurrence occupies 4 bytes, and OCCURS 5 TIMES repeats that entry five times, giving 4 x 5 = 20 bytes for the group. The group itself adds no padding or header bytes.
Question 41Data Division and Data Description
In a data dictionary, which entry describes the set of permitted values a field may hold and the meaning of each coded value?
- The physical storage length
- The domain of the attribute Correct answer.
- The access control list
- The update timestamp
Explanation
A domain defines the valid value set for an attribute together with the interpretation of coded values, so it constrains what the field can legally contain. Storage length, access control, and timestamps describe implementation or governance metadata rather than permitted values.
Question 42Data Division and Data Description
A column stores a person's date of birth. Which metadata property most directly distinguishes this from a column storing the date a record was loaded?
- The semantic domain of the attribute Correct answer.
- The index type on the column
- The collation of the column
- The partitioning key of the table
Explanation
Both columns share a date data type, so only the semantic domain, meaning what the values represent, separates a birth date from a load date. Index type, collation, and partitioning are physical design choices that do not carry business meaning.
Question 43Data Division and Data Description
Which item belongs in the data division of a data description rather than in the physical storage specification?
- The business definition of a customer identifier Correct answer.
- The tablespace where the table is stored
- The compression algorithm applied to the segment
- The block size of the data file
Explanation
The data division captures logical, business-facing descriptions such as entity and attribute definitions. Tablespaces, block sizes, and compression settings are physical storage details that belong to implementation specifications.
Question 44Data Division and Data Description
A data modeler records that an order must reference exactly one customer and that a customer may place zero or more orders. Which component of the data description is being captured?
- Cardinality and optionality of the relationship Correct answer.
- The retention period of order records
- The naming standard for tables
- The data type of the order key
Explanation
Cardinality states how many instances participate on each side, and optionality states whether participation is mandatory or optional. Together they describe the relationship rule between customer and order.
Question 45Data Division and Data Description
Which statement best describes a primary key in a data description?
- A foreign attribute that references another entity
- A column that stores the most recent modification time
- An attribute or set of attributes that uniquely identifies each entity instance and cannot be null Correct answer.
- An attribute that is indexed for faster lookups but may repeat
Explanation
A primary key enforces entity integrity: it uniquely identifies each instance and must be non-null. Indexes, audit timestamps, and foreign references serve different purposes and do not guarantee uniqueness.
Question 46Data Division and Data Description
A table uses a composite key made of order number and line number. A new requirement allows the same line number to appear across different orders. Which property of the key is being relied upon?
- The key must be a single surrogate integer
- Each component must be unique on its own
- The key must exclude the order number
- Uniqueness is enforced by the combination, not by either attribute alone Correct answer.
Explanation
In a composite key, uniqueness applies to the whole combination, so line numbers may repeat as long as each order-number and line-number pair is distinct. Individual components need not be unique by themselves.
Question 47Data Division and Data Description
What is the purpose of a foreign key in a relational data description?
- To guarantee that every value in the column is distinct
- To enforce referential integrity between a child entity and its parent entity Correct answer.
- To record the source system of each row
- To define the display format of the attribute
Explanation
A foreign key constrains child values to match an existing parent key, which enforces referential integrity. Uniqueness, formatting, and lineage are handled by other constructs.
Question 48Data Division and Data Description
A data description lists an attribute as nullable. What does this indicate about the attribute?
- The attribute must always contain a value
- A missing or unknown value is permitted for that attribute Correct answer.
- The attribute is part of the primary key
- The attribute stores only numeric values
Explanation
Nullability indicates whether the absence of a value is allowed; a nullable attribute may hold null to represent missing or unknown data. Mandatory attributes, by contrast, must always be populated.
Question 49Data Division and Data Description
A field is documented as CHAR(10) and another as VARCHAR(10). What is the key descriptive difference recorded in the data dictionary?
- CHAR uses fixed length while VARCHAR uses variable length up to the limit Correct answer.
- CHAR stores numbers while VARCHAR stores text
- CHAR allows nulls while VARCHAR does not
- CHAR is encrypted while VARCHAR is plain text
Explanation
The distinction between CHAR and VARCHAR concerns length behavior: fixed-length padding versus variable-length storage up to a maximum. Both store character data and neither implies encryption or null rules.
Question 50Data Division and Data Description
A monetary amount must be stored without rounding error across many additions. Which data description choice best supports this requirement?
- An integer type storing cents only when amounts are whole
- A floating-point type with high precision
- A decimal type with a defined precision and scale Correct answer.
- A variable character type holding formatted numbers
Explanation
Exact decimal types with explicit precision and scale avoid the binary rounding artifacts of floating point. Floating point can drift, and character storage defeats numeric processing.