MySQL a query to get user_id and password from two different tables for java projet

Professeur (professeur_id, name , password,mail)

Student (student_id, name, password, mail)

How can I write a query to get id and password from the two table

Also, can I make a login table that contains id and password as foreign key from the two table (Do I have to change the professeur id and student id columns to have the same name ? )