ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 28 - AD0-E716 discussion

Report
Export

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

What are two errors in the snippet above? (Choose two.)

A.
Column (roll_no) does not have index. It is needed since attribute identity is set to true.
Answers
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.
Answers
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.
Answers
C.
Column (student_name) does not have attribute length.
D.
null is not a valid value for column (roll_no).
Answers
D.
null is not a valid value for column (roll_no).
Suggested answer: A, C

Explanation:

The correct answers are A and C.

The errors in the snippet are:

Columnroll_nodoes not have an index. It is needed sinceattribute_identityis set totrue.

Columnstudent_namedoes not have an attribute length.

The attribute_identity attribute specifies whether the primary key of the table should be auto-incremented. If attribute_identity is set to true, then the roll_no column must have an index. The student_name column does not have an attribute length, which is required for string columns.

The following code shows how to fix the errors:

XML

<table name='vendor_module_table'>

<entity_id>

<type>int</type>

<identity>true</identity>

<unsigned>true</unsigned>

<nullable>false</nullable>

</entity_id>

<roll_no>

<type>int</type>

<identity>false</identity>

<unsigned>true</unsigned>

<nullable>false</nullable>

true

<index>true</index>

</roll_no>

<student_name>

<type>string</type>

<length>255</length>

<nullable>false</nullable>

</student_name>

</table>

Once the errors have been fixed, the table can be created successfully.

asked 02/10/2024
franz yap
27 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first