Answer: The NOT NULL Constraint
Find a detailed explanation of how to set up the NOT NULL constraint.
We'll cover the following...
Solution
The solution is given below:
Press + to interact
/* Modifying the column EmpName to be NOT NULL */ALTER TABLE EmployeesMODIFY COLUMN EmpName VARCHAR (100) NOT NULL;/* Modifying the column Salary to be NOT NULL */ALTER TABLE EmployeesMODIFY COLUMN Salary DECIMAL (10,2) NOT NULL;/* Describe the structure of the table */DESC Employees;
Explanation
The explanation of the solution code is given below:
Lines 2–3: The
ALTER TABLE
make changes to an already existingEmployees
table. TheMODIFY COLUMN
modifies the columnEmpName
column to beNOT NULL
.Lines 6–7: The
ALTER TABLE
make changes to an already existingEmployees
table. TheMODIFY
...