Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an Alter Table statement That adds two new check constraints to the Invoic

ID: 3529966 • Letter: W

Question

Write an Alter Table statement That adds two new check constraints to the
Invoices table of the Ap database. The first should allow (1) PaymentDate to be
null only if PaymentTotal is zero and (2) PaymentDate to be not null only if
PaymentTotal is greater than zero. The second constraint should prevent the sum
of PaymentTotal and CreditTotal from being greater than InvoiceTotal.



Delete the GroupMembership Table From the Membership database. Then, write a
Create Table statement that recreates the table, this time with a unigue
constraint that prevents an individual from being a member in the same group
twice.

Explanation / Answer

ALTER TABLE Invoices WITH CHECK ADD check ( (PaymentTotal = 0 AND PaymentDate is NULL) OR (PaymentTotal > 0 AND PaymentDate is NOT NULL) ) ADD CHECK ( (PaymentTotal
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote