Consider a database containing personel information
Question
Consider a database containing personal information, including names, addresses, and salaries of employees. Individually, the name, address, and salary information are available to a subordinate role, such as Clerk, but the association of names and salaries is restricted to a superior role, such as Administrator. 1. With this information, how could you construct your database and tables? Design your database and draw a database schema first.
Explanation
Here in the given question we Consider a database and have to construct two tables. Whereas in one table there will be the role of the person. And in the second table, there will be the information to be displayed.
In the above figure of database scheme. We can see that there are two tables. Naming role and information. And to make the data restricted there is one feature added. Which is RoleId. So this RoleId will then be use to specify a particular role of the person. Such that if the role of the person is major. So at that time their information will not be display by a constraint. And if the persons role is not that major, at that time information will be displayed.
Also read, I am having issues with SQL code: