I was asked this question during the interview with one of top IT industries and I had absolutely no clue. Can anyone tell me how? Either Mysql or Oracle is fine but I am providing the example with mysql.
CREATE TABLE employee (employee_ID VARCHAR(5), manager_ID VARCHAR(5));
CREATE TABLE meeting (meeting_ID VARCHAR(1), meeting_title VARCHAR(100));
CREATE TABLE attendee (meeting_ID VARCHAR(1), employee_ID VARCHAR(5));
The relationship is pretty straight forward with the example. I think this is a pretty much normalized example up to 3rd normal form. Attendee associates the meeting and participating employee including employees and managers.
The question was to write a query that finds out the meetings which both employee and his manager are attending.