Can Anyone provide an example of RAW SQL for SELECTING posts by 2 or more tags

You seem to be catching wrong query. Dumping SQL for such URL (via posts_request filter) get me this: SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (93) AND tt1.term_taxonomy_id IN (94) AND wp_posts.ID IN ( SELECT … Read more

Can two domains use the same database?

No, not in the manner that you’re planning on doing it. Everything relating to the site (including the design, selected theme, etc) is stored in the database. By having a second site attach to it, any changes made there will be reflected on the main site.

Advantages of dbDelta

The purpose of dbDelta() is both to create and update tables. If you don’t need updates then you can skip it. For keeping track of name you can simply follow WP convention and save name of your table in field of $wpdb object. Also note that you should consider there is possibility of code running … Read more