**New course!**Every coder should learn

**Generative AI!**

0

# I need help with practice 18.2 Mentors and Apprentice in SQL

Please, I need help with this question I have been trying to solve this problem I have tried to get this but I keep getting errors. I don't know what I am doing wrong. Thanks

4 Answers

+ 3

You only need to select teachers lastname as teacher, and the WHERE clause contains any specific condition not columns name, then you need to sort this data by student.id..
/********************
your code goes here
SELECT students.id, students.firstname, students.lastname, teachers.lastname AS teacher FROM students, teachers WHERE students.teacherid = teachers.id ORDER BY students.id;

+ 1

Please show your attempt, so that we can help you

+ 1

SELECT students.ID, students.firstname, students.lastname, teachers.firstname, teachers.lastname
FROM students, teachers
WHERE (students.ID, students.lastname,teachers.lastname) AS teacher

0

Thanks very much. You are awesome