Query First and last names of authors that wrote books in more than one genre
Added by John W.
Step 1
Step 1: Identify the database or dataset that contains information about authors, their books, and the genres of those books. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 57 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
Provide a result set of all the customer's first and last name that have a preference for salsa, and have booked an engagement. Make sure there is no duplicate values in the result set.
Akash M.
Finding Duplicate Actors Notes Code Problem Your task is to write an SQL query that finds all entries in the Actor table where the first_name and last_name are the same as another actor's first and last names. For example: actor_id | first_name | last_name 1 | JOHN | APPLESEED 22 | JOHN | APPLESEED 32 | MARK | ZUCKERBERG 44 | MARK | ZUCKERBERG (4 rows) Your query's result table must contain these columns: 1. actor_id 2. first_name; and 3. last_name. The results should be listed in alphabetical order by first_name and last_name, then in increasing order by actor_id for actors with the same names. Try to use SQL's CROSS JOIN operator in your answer! 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.
The following questions will all use the schema we're about to describe for a library database. Books (isbn, title, author, genre, publisher) Members (id, name) Lending (isbn, id, checkout, returned) // checkout and returned are both DATETIME A tuple in Books represents a single book in the library system (We're assuming the library doesn't have multiple copies of a book, and each book has a single author and publisher). The Members table holds identifying information for people checking out books from the library. There may be multiple people with the same name and different member ids. Lastly, the Lending table shows a history of books loaned to various members. The checkout and returned attributes are the timestamps the book was checked out to a user and subsequently returned by that user. Any Lending tuple with a NULL "returned" attribute means the book is currently checked out. Each unique checkout becomes a new tuple with the new checkout time. Books.isbn is the primary key for Books. Members.id is the primary key for Members. Lending.isbn, Lending.id, and Lending.checkout together constitute the primary key for Lending. Lending.isbn is a foreign key to Books.isbn. Lending.id is a foreign key to Members.id. For all queries below, you do not need sub-queries (but you may use them if you choose.)
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD