MySQL a query to get user_idpassword 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 idpassword from the two table

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