Hi,
i'm doing a school schedule and i have this:

http://desmond.imageshack.us/Himg13/scaled.php?server=13&filename=22875721.jpg&res=medium

as you can see i have the times on the first column and that is from table "tempos_letivos".

now i have a "schedule" table where is the hours of class of the courses, but in this table the cod_prof and cod_curso and i want the names...which are in the "profs" table (cod_prof) and the "course" table (cod_curso).

I'm thinking about the INNER JOIN, but i don't know how

can someone help me put the code, please?

Thank you

Recommended Answers

All 4 Replies

If you are needing to combine the data across those three tables you will need to do a join. Can you post up the actual structure of each table? That way we can help you more, at the moment we would just be guessing about the columns.

Table PROFS

cod_prof
name_prof
email_prof
cod_course

table COURSES

cod_course
name_course

OK, a basic join would look like this:

SELECT name_prof, name_course FROM profs join courses on profs.cod_course = courses.cod_course order by name_prof;

When doing joins you need to specify with the ON clause which columns in each table form the linkage. And if you refer to a column that occurs in both tables you need to fully qualify it as tableName.columnName.

Can you help me doing the code i never worked with sql so i don't know the operations i have to call and stuff like that :S

If you could help me, it would be awesome.

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.