For questions about mysql, multi-table query, previously only a single table was used, as shown in the following figure

< H2 > question < / H2 >

usually what connection to choose and what role foreign keys usually play
clipboard.png

clipboard.png

id,


clipboard.png

Mar.12,2021

  1. join is used for querying, foreign key, for table structure, and for a completely different purpose.
  2. using or not using foreign keys has its own advantages. You can choose by yourself. To put it simply, using foreign keys can better maintain data consistency, but lose flexibility.
  3. several types of join can be found in the theoretical books of the database. Lend flowers and present Buddha to a picture:

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eabbd6-207c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eabbd6-207c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?