PERSON
DriverID (primary)
DriverName
Address
CAR
RegNO (primary)
Model
Year
ACCIDENT
ReportNumber (primary)
AccidentDate
Location
OWNS
DriverID (primary key) foreign key with PERSON(DriverID)
RegNo (primary Key) foreign key with CAR(RegNo)
PARTICIPATION
DriverID (primary key) foreign key with PERSON (DriverID)
RegNo (primary Key) foreign key with CAR(RegNo)
ReportNumber (primary key) foregin with ACCIDENT(primary)
Damage Amount
查询是 -> 查找涉及属于特定型号的汽车的事故数量
溶胶是
SELECT COUNT (a.ReportNumber)
FROM ACCIDENT a
WHERE
a.ReportNumber in ( SELECT pa.ReportNumber FROM PARTICIPATED pa, CAR c
WHERE pa.RegNo = c.RegNo AND c.Model = 'honda');
我的问题是如何理解涉及 C++ 中嵌套查询的复杂查询你可以使用断点进行调试,但如何在 mySQL 中调试我使用 SQLyog,我知道包括 GROUP 在内的所有基本查询,但是当嵌套查询出现时我无法理解