Professional Documents
Culture Documents
ID int identity,
Name varchar(20),
Salary float,
DepartmentID char(2)
4.Create a table named "Department" with some columns and insert some data into it.
ID int identity,
DepartmentID char(2),
DepartmentName varchar(20)
7.Create a view named "Employee_View" that gets the employee's records from the
"MyEmployee" table whose salary is less than 3000 and also gets the "DepartmentID"
and " DepartmentName" from the "Department" table by joining them.
9. Problem: You can't update records in multiple tables when the view references
more than one base table. You can only update columns that belong to a single base
table. I will update the records via view in three ways to explain this problem.
Explaination: This query worked because as I said earlier, "you can only update
columns that belong to a single base table" and here we are only updating the data
of the "Department" table.