How to effectively implement data query based on existing table structure

Hello, everyone. At present, there is a database query design problem:

action table:

user_id, action_detail
1        "action_click"
2        "action_drag"

user info tablle

user_id, full_name, email
1        "User One" "userone@user.com"
1        "User Two" "usertwo@user2.com"

company info table

company_name,      company_domain
"User Company"     "user.com"
"User2 Company"    "user2.com"

the queries that need to be implemented currently include:

  1. find out the action records (action_detail) of all users of a company
  2. find out the action records (action_detail) of all users of a company, but exclude certain specified users
  3. find the action records (action_detail) of all users of multiple companies, but exclude certain specified users

based on the above three tables, how to effectively implement these three queries? thank you!

Mar.28,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e41677-43669.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e41677-43669.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?