In MySQL, if you want to load all users you can type this query:
SELECT * FROM tablename;
Otherwise, if you want to take a specified group of users you can type:
SELECT FROM tablename WHERE condition
In condition field you can put ID, username, or whatever you want
In Firebase is quite different but still, easy. I recommend you the official documentation.
I will mention some lines from the page in question.
Firstly, you have to get the reference of what you want retrieve
final FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference ref = database.getReference("server/saving-data/fireblog/posts");
You can now use a listener to read data from reference.
ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Post post = dataSnapshot.getValue(Post.class);
System.out.println(post);
}
Note that the listener function is called anytime new data is added to your database reference, and you don't need to write any extra code to make this happen.