I have a table called Employee (with columns like name, ssn, age, etc..)
Suppose you wanted to give each employee read-only access to his/her own personal row
[the data describing them in the Employee table].
How exactly this might be achieved?
Depending on your DBMS, you might be able to create a view that selects only the logged-in user’s row from the Employee table, and grant access to that. For example, in Oracle, you can do something like:
(‘uid’ identifies the currently logged-in user).
Of course, as others have said, the more usual scenario is not to have end-users logging in directly to the database, but to have an application that’s retrieving the data on their behalf, and is responsible for limiting access.