Mysql – combine a JOIN with the COUNT function and also distinguish between likes and dislikes
I have two tables with one referencing the other. CREATE TABLE blogs ( article LONGTEXT, id VARCHAR(255) PRIMARY KEY ); CREATE TABLE blog_eval ( blog_id VARCHAR(255) REFERENCES blogs(id) ON DELETE CASCADE, user_id VARCHAR(255) REFERENCES users(id), is_like BOOLEAN, --true if like…