Alter Tables
1. Make email NOT NULL in customers ALTER TABLE customers ALTER COLUMN email SET NOT NULL; Ensures all future records must have an email. 2. Make username unique in users ALTER TABLE users ADD CONS...

Source: DEV Community
1. Make email NOT NULL in customers ALTER TABLE customers ALTER COLUMN email SET NOT NULL; Ensures all future records must have an email. 2. Make username unique in users ALTER TABLE users ADD CONSTRAINT unique_username UNIQUE (username); Prevents duplicate usernames. 3. Add CHECK on price in products ALTER TABLE products ADD CONSTRAINT check_price CHECK (price > 0); Ensures price is always greater than 0. 4. Set default status in orders ALTER TABLE orders ALTER COLUMN status SET DEFAULT 'pending'; Automatically assigns pending if no value is given. 5. Add salary column with constraints ALTER TABLE employees ADD COLUMN salary INT NOT NULL CHECK (salary > 10000); Ensures salary is mandatory and above 10,000. 6. Add ON DELETE CASCADE to foreign key ALTER TABLE employees DROP CONSTRAINT employees_department_id_fkey; ALTER TABLE employees ADD CONSTRAINT employees_department_id_fkey FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE CASCADE; Deletes employees automatical