What is the difference between the engine in the database and the engine in the table?

  mysql, question

The general database can be set up in MyISAM or Innodb, and the tables can also be set up.

My question: Can the engine of database and table be inconsistent? For example, the database is InnoDB, and the table is MyISAM. Does it affect the performance?

Yes, it doesn’t matter. If the table does not specify an engine, the engine settings of the database are used, that’s all.
Similarly, there are character set settings, database > table > fields, which are not processed according to the settings of the superior.