SQL is a query language. Those. the heap of names as such (tin term) is not here, but there is a scheme. The schema is stored in the database itself, in service tables.
Different database vendors have "add-ons" over standard SQL, such as TSQL in MSSQL, PL / SQL in Oracle, etc., which allow writing stored procedures and, to some extent, operating with pseudo-variables in the queries themselves. It is important to understand here that all these "variables" exist only within a single SQL transaction, inside the database engine.
Perhaps you will be more aware of this analogy: You have a POST request in which there is a certain set of transmitted data key-value and a certain amount of service information. This request itself does not know anything about what is inside it and how it should be processed - it simply serves as a wrapper for communicating the client-server. Here with SQL - the same story.
As for the namespace. In the context of the base under this term can be considered 2 different entities:
1) Names of tables, columns, built-in procedures, indexes, keys, etc. This is what is called the "database schema". Information on them is stored in the service areas (tables) of the database. Each database vendor has its own. As a rule, this information can be retrieved by simple SQL queries to these tables.
2) Variables used in stored procedures and queries (in dialects, where possible). These variables exist only within the framework of a transaction and their scope is always local. Those. variables used in the stored procedure are available only within this procedure. The "pseudo-variables" used in the query are visible only at the level of this query and are not visible, for example, within the procedure called by this query (if, of course, they were not passed to them by parameter by value ).
Once again I want to note that the second type - the variables in the stored and queries - this is all the "extension" of the SQL syntax, strongly dependent on the database used. They are not part of the SQL specification.