As stated, you cannot do this with views, but you can with temporary tables.
If you create a temporary table with the same name as the actual table, the temporary table will shadow (hide) the actual table. This means that you cannot access the actual table until you delete the temporary table:
mysql> create table t select 1;
However, temporary tables are deleted (even if you donβt drop them) after the session is disconnected. You will need to create them every time you connect.
source share