I'm starting to use SQL after only ever using mongodb. As such, I'm having trouble mapping some practices over to the SQL world. Primarily, I'm not sure how embedded documents in mongodb map to SQL.
For example, in mongodb, if I wanted to model a person who has a car, I would have a collection of documents that look like
{
firstName: 'John',
lastName: 'Smith',
car: {
color: 'Red',
year: 2001,
...
}
}
How would I create a similar relationship in a SQL database? I realize I could namespace things like car_color
and car_year
, but this seems conceptually ineffective when compared to showing this relationship in your document structure.