Question: If I have two tables, Consumer, and Appointment, would there be a way join them, so that it only displays the most recent appointment? I was able to do it with sql server, but mysql seems to be a bit different.

I would have thought the query to do it would be

```
SELECT Con.ConsumerID, 
       Con.ConsumerName,
       App.AppointmentID, 
       App.ScheduledDate, 
       App.Location 
FROM Consumer Con 
LEFT JOIN Appointment AS App 
  ON Con.ConsumerID = (SELECT ConsumerID 
                       FROM Appointment AS App2 
                       WHERE App2.ConsumerID = Con.ComsumerID 
                       ORDER BY ScheduledDate 
                       DESC 
                       LIMIT 1)

```

That seems to return all the Consumers with all the appointments, so that I have a lot of duplicated Consumers though.

My tables look like

* Consumer

	+ ConsumerID
	+ ConsumerName
* Appointment

	+ AppointmentID
	+ ConsumerID
	+ ScheduledDate
	+ Location

Answer: 
add Indexes for given WHERE statements.

SOURCE\_SYSTEM, CAL\_DT
In addition to configuring indexes in the database, as mentioned by Kutay Zorlu in his answer, you could consider adding a pagination feature to your REST endpoint.