In computer science classes we're taught to "Program to an interface, not an implementation."
If we want to fetch some data, we ask the interface for the data, and the interface then translates that and fetches the data for us.
That way we can modify where the data is actually stored, and we just have to alter the interface, rather than track down every line of code which fetches that piece of data.
Is there an equivalent idea in SQL?
Currently I'm seeing SQL code that pulls data directly from the database, specifying the exact database name, table, and column.
Is there a way to insert an interface in SQL so SQL code queries an "SQL interface" which in turn directs to the actual data? Or is that just not practical for efficiency reasons?