Here are 2 tables. 1st user data 2nd about all user purchases. Can you please tell me how to make sure that in the first table a certain column shows the sum of all purchases from the second table of a user by his ID? Or even how to make that was the sum of all lines from. tables. Sorry for such questions, learning SQL not so long ago. Tested
CREATE TABLE IF NOT EXISTS asd (n INT DEFAULT (SELECT COUNT(id) FROM users)); but it does not work