The Sequelize include option is commonly added in a model finder method (findOne(), findAll(), etc.)
This option is used to add a JOIN clause to the generated SQL query, enabling you to retrieve data from multiple tables with one query.
For example, suppose you have two related SQL tables named Cities and Countries.
Each Cities row stores the information of which country it belongs to with the CountryId column as shown below:

To retrieve data from these tables, you need to create the Sequelize models for the tables first:
const City = sequelize.define(
“City”,
{ cityName: Sequelize.STRING },
{ timestamps: false }
);
const Country = sequelize.define(
“Country”,
{ countryName: Sequelize.STRING },
{ timestamps: false }
);
For this example, A country can have many cities, while a city can only have one country.
The relationship should be defined as follows:
Country.hasMany(City);
City.belongsTo(Country);
const city = await City.findByPk(1, {
include: Country,
});
console.log(city.toJSON());
The returned city object will have the following values:
{
id: 1,
cityName: 'York',
CountryId: 1,
Country: { id: 1, countryName: 'United Kingdom' }
}