QuestionQ16

Working with Databases and EAV

An Adobe Commerce developer is attempting to create a custom table using declarative schema but is unable to do so.

Question Image

What are two errors in the snippet shown above?

Choose two
  • A Column (roll_no) does not have index. It is needed since attribute identity is set to true.
  • B Column (entity_id) does not have index. It is needed since attribute identity is set to false.
  • C Column (student_name) does not have attribute length.
  • D NULL is not a valid value for column (roll_no).
Explanation

An identity column is auto-incremented and must be backed by an index, typically a primary-key constraint. A column marked non-nullable cannot use NULL as its default value. The length attribute is not required for a text column; Adobe Commerce documents it for char, varchar, and varbinary columns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!