In MySql database have AM_COURSE
table in that
cId CourseName course_desc
101 java sometext...
102 mysql
try
SELECT course.cid, course.course_desc, user.name
FROM AM_COURSE course
INNER JOIN AM_INTER inter on inter.cid = course.cid
INNER JOIN AM_USER user on user.uid = inter.uid
INNER JOIN AM_TIMETABLE tt ON inter.cid = tt.UserId
WHERE course.Name = 'java'
AND tt.Date_Time BETWEEN '2012-08-07' AND '2012-08-20'
The INNER JOIN keyword returns rows when there is at least one match in both tables.
MySQL INNER JOIN clause
The MySQL INNER JOIN clause matches rows in one table with rows in other tables and allows you to query rows that that contain columns from both tables.
The MySQL INNER JOIN clause an optional part of the SELECT statement. It appears immediately after the FROM clause.
Before using MySQL INNER JOIN clause, you have to specify the following criteria:
First, you have to specify the main table that appears in the FROM clause. Second, you need to specify the tables that you want to join with the main table, which appear in the INNER JOIN clause. Theoretically, you can join a table with many tables. However, for a better query performance, you should limit the number of tables to join. Third, you need to specify the join condition or join predicate. The join condition appears after the keyword ON of the INNER JOIN clause. The join condition is the rule for matching rows between the main table and the other tables.
Example
SELECT c.cid, c.course_desc, user.name FROM AM_COURSE c
INNER JOIN AM_INTER inter on inter.cid = c.cid
INNER JOIN AM_USER user on user.uid = inter.uid
INNER JOIN AM_TIMETABLE tt ON inter.cid = tt.UserId
WHERE c.Name = 'coursename' AND tt.Date_Time BETWEEN '2011-08-12' AND '2012-08-12'