14. List the title and year of all movies, but for the years, display only the last 2 digits in the year. For example, 1999 will be displayed as 99, 2010 will be displayed as 10, and so on. Hint: You can apply a function to one of the columns. For example: - Without using function: SELECT title, year FROM movie; - Using a function: SELECT title, FUNCTION(year) FROM movie;
Added by Salvador P.
Close
Step 1
We can do this using the RIGHT() function in SQL. The RIGHT() function returns a specified number of characters from the right side of a string. So, to extract the last two digits of the year, we can use the RIGHT() function like this: SELECT RIGHT(year, 2) FROM Show more…
Show all steps
Your feedback will help us improve your experience
Ivan Kochetkov and 91 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Need Help Solving this
Tanvi G.
Your task is to write an SQL query to list the film_id and title of every film which has exactly the same cast acting in it as any other film. Your query's result must have the following columns: 1. film_id; and 2. title. The results should be listed in increasing order of film_id, and no film id should be listed more than once. Film film_id title description length release_year rental_duration rental_rate replacement_cost rating special_features language_id original_language_id Film_Actor film_id actor_id Actor actor_id first_name last_name nationality Country country_id short_code name Film_Category film_id category_id Category category_id name parent_cat Language language_id name Overview of the tables in the film database schema.
Supreeta N.
2.9 LAB - Select movie ratings with left join The Movie table has the following columns: ID - integer, primary key Title - variable-length string Genre - variable-length string RatingCode - variable-length string Year - integer The Rating table has the following columns: Code - variable-length string, primary key Description - variable-length string Write a SELECT statement to select the Title, Year, and rating Description. Display all movies, whether or not a RatingCode is available. Hint: Perform a LEFT JOIN on the Movie and Rating tables, matching the RatingCode and Code columns.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD