. A B C
A - 4 1
B 4 - 1
C 1 1 -
scanf("%s", *books[i].name);
Вы вместо указателя на имя передаёте значение первого символа, правильно:scanf("%s", books[i].name);
scanf("%d", books[i].price);
scanf("%d", books[i].page_n);
scanf("%d", books[i].pubhouse.year);
Вы вместо адреса переменной передаёте её значение, правильно:scanf("%d", &(books[i].price));
scanf("%d", &(books[i].page_n));
scanf("%d", &(books[i].pubhouse.year));
SELECT `employer`.*
FROM `EmployesInfo` AS `employer`
RIGHT JOIN `EmployesInfo` AS `chief` ON `employer`.`ChiefId` = `chief`.`emplId`
RIGHT JOIN (SELECT `ChiefId`, COUNT(`ChiefId`) AS `count`
FROM `EmployesInfo`
GROUP BY `ChiefId`
HAVING `count` >= 3) AS `sub` ON `employer`.`ChiefId` = `sub`.`ChiefId`
WHERE `chief`.`EmplCar` IS NOT NULL