The user and registration may have a username field. The username field on the user is the one that can be used to login. In general you will want to use the Search API for those types of queries rather than directly accessing the database.
The reason is because the API is documented and stable, and the database is undocumented and may change.