Alter Tables
Hi! 1. You have a table customers with a column email that currently allows NULL values. Modify the table so that future entries must always have an email. ALTER TABLE customers ALTER COLUMN email ...

Source: DEV Community
Hi! 1. You have a table customers with a column email that currently allows NULL values. Modify the table so that future entries must always have an email. ALTER TABLE customers ALTER COLUMN email SET NOT NULL; here the alter is used to set the column email that should not be blank. 2. In the users table, ensure that the username column is unique across all records using an ALTER statement. ALTER TABLE users ADD CONSTRAINT unique_username UNIQUE (username); here an new contraint unique_name is used to keep unique user name thus ensure that the username column is unique across all records. 3. In the products table, enforce that price must always be greater than 0 using an ALTER command. ALTER TABLE products ADD CONSTRAINT price CHECK (price>0); here the table prducts is altered with price that has values greater than 0. 4. Modify the orders table so that the status column defaults to 'pending' if no value is provided during insertion. ALTER TABLE orders ALTER COLUMN status SET DEFAUL