Answer: The NOT NULL Constraint
Understand how to use the NOT NULL constraint in SQL by altering existing tables to enforce mandatory fields. Explore techniques to add or remove NOT NULL constraints, apply default values, and create temporary tables for multiple modifications. This lesson equips you with practical skills to manage SQL constraints effectively.
We'll cover the following...
We'll cover the following...
Solution
The solution is given below:
Explanation
The explanation of the solution code is given below:
Lines 2–3: The
ALTER TABLEmake changes to an already existingEmployeestable. TheMODIFY COLUMNmodifies the columnEmpNamecolumn to beNOT NULL.Lines 6–7: The
ALTER TABLEmake changes to an already existing ...