Select Dogs and Join Breed
POST {{HDB_ENDPOINT}}
Here's a more complex SQL command joining the breed table with the dog table. We will also pull only the pups belonging to Kyle, Zach, and Stephen.
Request Body
{"operation"=>"sql", "sql"=>"SELECT d.id, d.dog_name, d.owner_name, b.name, b.section FROM dev.dog AS d INNER JOIN dev.breed AS b ON d.breed_id = b.id WHERE d.owner_name IN ('Kyle', 'Zach', 'Stephen') AND b.section = 'Mutt' ORDER BY d.dog_name"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
[{"id":4,"dog_name":"Billy","owner_name":"Zach","name":"LABRADOR / GREAT DANE MIX","section":"Mutt"},{"id":8,"dog_name":"Gemma","owner_name":"Stephen","name":"SHORT HAIRED SETTER MIX","section":"Mutt"},{"id":2,"dog_name":"Harper","owner_name":"Stephen","name":"HUSKY MIX","section":"Mutt"},{"id":5,"dog_name":"Rose Merry","owner_name":"Zach","name":"TERRIER MIX","section":"Mutt"}]