Skip to content

Mysql Join, Count and Sum?

campaign table are the item for sale and on the transaction table are the item sold. I want to count the transaction_id that are made transaction table and sum the total of sold item.. but the table are different.. Here is what I tried: campaign table: transactions table: Answer To get the total payout for al…

Foreign keys vs Composite keys in MySQL

I have a table just like this: USER_RELATIONSHIP ———————- user_id follows_id 1 2 1 3 2 1 3 1 Both user_id and follows_id are Foreign keys …