Question

    In a structured database, which data storage format would best support hierarchical data with varying levels of nested attributes?

    A CSV Correct Answer Incorrect Answer
    B SQL Correct Answer Incorrect Answer
    C JSON Correct Answer Incorrect Answer
    D Excel Correct Answer Incorrect Answer
    E NoSQL Correct Answer Incorrect Answer

    Solution

    JSON (JavaScript Object Notation) is an ideal data storage format for hierarchical data due to its nested structure, which can accommodate varying levels of attributes within each record. JSON allows data to be stored in a key-value format, where each key can contain another set of key-value pairs, making it flexible and suitable for storing data with multiple levels of depth, such as customer orders with nested items. JSON is commonly used in applications that require flexibility in data representation and is compatible with NoSQL databases, making it an excellent choice for semi-structured data storage. The other options are incorrect because: • Option 1 (CSV) lacks the ability to represent hierarchy as it is flat and row-based. • Option 2 (SQL) supports structured data but lacks flexibility for complex nested structures. • Option 4 (Excel) is also flat and limited in handling nested attributes. • Option 5 (NoSQL) is a database type, not a format, though it can store JSON data effectively.

    Practice Next