CREATE TABLE Games (EntryFee INT, Rake INT, TotalEntry INT);
CREATE TABLE Transaction1 (UserID VARCHAR(25));
INSERT INTO Games VALUES
(30,16,150),(45,20,100),(15,5,50),(25,20,300),(10,8,270);
INSERT INTO Transaction1 VALUES ('Daniel'),('David'),('John'),('Martha');
SELECT Games.EntryFee, Games.Rake, Games.TotalEntry, COUNT(distinct Transaction1.UserID) AS CountUser,
(Games.EntryFee * Games.Rake / (100 + Games.Rake) * Games.TotalEntry / COUNT(distinct Transaction1.UserID))
AS Calculate
FROM Games JOIN Transaction1 GROUP BY Games.EntryFee, Games.Rake, Games.TotalEntry;