Implement the constraints in the table

  1. You were asked to implement the following constraints in the table that stores the supplier details:
  • The fields that store the first name, last name, address, and phone number of the suppliers should not be left blank.
  • Phone number must be in the following format:

[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9] Example: 4356-555-555

However, while populating the table that stores the supplier details with the sample data, you find that even if you leave the preceding fields blank, no error is displayed. In addition, you are able to populate the field that stores the phone number with any number or character.

Analyze the preceding problem and implement the required constraints in the corresponding table. [5 marks]

  1. While populating the table that stores the order details with the sample data, you find that:
  • The order date should not be greater than the current date.
  • If a user does not enter the order date, the current date should be taken as the default date.
  • The quantity ordered, quantity received, and unit price of the products should be any value greater than 0.

Alter the corresponding table to add constraints so that the preceding requirements can be implemented. [5 marks]