We need to ensure that the amount withdrawn should be less then the credit card limit amount, to ensure this integrity what type constraint will be used?Select one:a.table level foreign key constraintb.table level check constraintc.column level check constraintd.column level foreign key constraint
Question
We need to ensure that the amount withdrawn should be less then the credit card limit amount, to ensure this integrity what type constraint will be used?Select one:a.table level foreign key constraintb.table level check constraintc.column level check constraintd.column level foreign key constraint
Solution
The correct answer is c. column level check constraint.
This is because a check constraint allows you to specify a condition on each row in a table. In this case, you would set a check constraint on the 'withdrawal' column to ensure that the amount withdrawn is less than the credit card limit.
Here are the steps to do this:
- Define the credit limit column in your table.
- Define the withdrawal column.
- Add a check constraint to the withdrawal column that checks if the withdrawal amount is less than or equal to the credit limit.
This way, every time a withdrawal is made, the database checks if the withdrawal amount is less than or equal to the credit limit. If it's not, the database returns an error and doesn't allow the transaction to
Similar Questions
What SQL structure is used to limit column values of a table? The CHECK constraintNone of the above is correct.The LIMIT constraintThe VALUE constraint
Add a new CHECK constraint named CHK_CREDITS_NEW to ensure the CREDITS column is at least 3.
Which of the following is not a type of SQL constraint?Select one:a. UNIQUEb. DUPLICATEc. CHECKd. FOREIGN KEY
What constraint type does the following constraint belong to?"Every table must have a primary key, of which no part can be null."Select one:a.Entity integrityb.Domain integrityc.Semantic integrityd.Referential integrity
Referential Integrity Constraint: Foreign Key
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.