When you create a query, you are retrieving data from a table or other objects structured like tables - views and certain user-defined functions. To work with any of these objects in your query, you add them to the diagram pane.
Alternatively you can
Tables and views are automatically added to the query when you reference them in the statement in the SQL editor.
A connection you are using while dragging a table must be the connection of the query document. You will not be able to perform a drag and drop operation from another connection.