In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In this article, we will learn about the introduction of mysql row-class view subquery. There is a certain reference value, friends in need can refer to, hope to help you.
Find the category name and number of movies that include robot in the description information, and also need the number of movies in this category > = 5
The film table is the movie table, the category table is the film classification table, and the film_category table is the intermediate table between the film table and the film classification table (many-to-many intermediate table)
Film table
CREATE TABLE IF NOT EXISTS film (film_id smallint (5) NOT NULL DEFAULT '0title varchar (255) NOT NULL,description text,PRIMARY KEY (film_id))
Category table
CREATE TABLE category (category_id tinyint (3) NOT NULL, name varchar (25) NOT NULL, `last_ update` timestamp,PRIMARY KEY (category_id))
Film_ chart
CREATE TABLE film_category (film_id smallint (5) NOT NULL,category_id tinyint (3) NOT NULL, `last_ update` timestamp) SELECT c.name, COUNT (f.film_id) AS amountFROM film AS f, film_category AS fc, category AS c, (SELECT category_id FROM film_category GROUP BY category_id HAVING COUNT (category_id) > = 5) AS ccWHERE f.description LIKE'% robot%'AND f.film_id = fc.film_idAND fc.category_id = c.category_idAND c.category_id = cc.category_id
After reading the above, do you have a general understanding of the introduction to mysql row-class view subqueries? If you want to know more, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.