One-to-one: Use a foreign key to the referenced table:
student: student_id, first_name, last_name, address_id address: address_id, address, city, zipcode, student_id # you can have a
# "link back" if you need
You must also put a unique constraint on the foreign key column (addess.student_id) to prevent multiple rows in the child table (address) from relating to the same row in the referenced table (student).
-- Getting all students for a class: SELECT s.student_id, last_name FROM student_classes scINNER JOIN students s ON s.student_id = sc.student_id WHERE sc.class_id = X-- Getting all classes for a student: SELECT c.class_id, name FROM student_classes scINNER JOIN classes c ON c.class_id = sc.class_id WHERE sc.student_id = Y