I'm very new to this - could someone let me know if this query is correct? I'm trying to take a variable from table 1 and use it to count lines in table 2... Many thanks.
INSTRUCTION Take the following hypothetical 2 table database: Table 1, called content, has the fields: content_id, content_name, content_url. Table 2, called views, has the following fields: view_id, content_id, view_timestamp
Write a MySQL query to find the total number of views for a piece of content with the content_name "maria_video".
MY QUERY mysql> SELECT @ID:=content_id FROM content WHERE content_name=”maria_video”;
mysql> COUNT(*) FROM views WHERE content_id=@ID;