Structures of my tables are as follow.

Table Name : timetable


Table Name : slot_table


Table Name : instructor(this table is not required for this particular problem)

I want to show the resultant data in my android app in a timetable format somewhat like this:


Question : What query i should write so that subjects of particular days with respective slots will be the result of the query?

1)The days should be in order like monday,tuesday,wednesday.

2)If monday has 2 subjects in 2 different slots then it should display like this :

Day         7:30-9:10AM           9:20-11:00AM        

Monday      Android Workshop      Operating System

This is just a sample.

P.S:As timetable format is required,all the subjects with slot ids of all the days(monday to saturday) must be there in it.

Edit :

I tried this

select day,subject,slot from timetable,slot_table where timetable.slotid = slot_table.slotid 

which gave a result :

a result

But i want it in a timetable format which i am not having an idea how to do that.

Edit :

Timetable sample format is something like this :


Edited by sash_kp

3 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.