G (general audiences): G ratings are most notable for what the films don’t include: sex and nudity, substance abuse, or realistic/non-cartoon violence.
PG (parental guidance): Some material may not be suitable for children. There may be mild strong language and some violence, but there will not be substance use or physical abuse.
PG-13 (parental guidance-13): Some material may not be suitable for children under 13. Any nudity has to be non-sexual and any swear words have to be used sparingly. Violence in PG-13 films may be intense, but must be bloodless.
R (restricted): No one under 17 admitted without an accompanying parent or guardian. This rating is given for strong and frequent language and violence, nudity for sexual purposes, and drug abuse.
NC-17 (no one under 17): This rare rating is given to films which feature mature elements in such profusion or intensity that it surpasses even the R.
Unrated: Typically reserved for previews of films not yet officially rated by the MPAA. A green title card indicates the preview is safe for all viewers, while red is for mature audiences.
SQL = "SELECT rating FROM film GROUP BY rating"
df = pd.read_sql(SQL, db)
df
rating | |
---|---|
0 | G |
1 | PG |
2 | PG-13 |
3 | R |
4 | NC-17 |
SQL = """
SELECT rating, COUNT(*) FROM film WHERE rating = "PG" OR rating = "G" GROUP BY rating;
"""
df = pd.read_sql(SQL, db)
df
rating | COUNT(*) | |
---|---|---|
0 | G | 178 |
1 | PG | 194 |
SQL = """
SELECT rating, title FROM film WHERE rating = "PG" OR rating = "G";
"""
df = pd.read_sql(SQL, db)
df
SQL = """
SELECT rating, title
FROM film
WHERE
(rating = "PG" OR rating = "G") AND (release_year = 2006 OR release_year = 2007);
"""
df = pd.read_sql(SQL, db)
df