Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4099860
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:29:29+00:00 2026-05-20T20:29:29+00:00

I have a database: id | movie_name | genres 1 | Die Hard |

  • 0

I have a database:

id       |                movie_name              |           genres
1        |                 Die Hard               |        Action, Thriller
2        |                Gladiator               | Adventure, Action, Drama, History
3        |  Harry Potter and the Sorcerers Stone  |    Fantasy, Adventure, Family
4        |               Pearl Harbor             |      Action, Melodrama, War

1) How I can select unique genres from genres of all database.
I need the next: Action / Adventure / Drama / Family / Fantasy / History / Melodrama / Thriller / War

2) How can I see a movie of a certain genre?

SELECT `movie_name` FROM `movies` WHERE `genre` LIKE ??

But he also can bring not only the drama, but melodrama.

3) How to make a search on a particular genre?
May be:

 SELECT `movie_name` FROm `movies` WHERE `movie_name` LIKE `%stone%` AND `genres LIKE 'drama'.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:29:29+00:00Added an answer on May 20, 2026 at 8:29 pm

    Don’t store a comma-delimited list of attributes in a database column.

    Instead, have 3 tables:

    Movies (id, movie_name)
    
    id | movie_name
    ---+--------------------------------------
     1 | Die Hard
     2 | Gladiator
     3 | Harry Potter and the Sorcerers Stone
     4 | Pearl Harbor
    
    Genres (id, genre_name)
    
    id | genre_name
    ---+------------
     1 | Action
     2 | Thriller
     3 | Adventure
     4 | Drama
     5 | History
     6 | Fantasy
     7 | Family
     8 | Melodrama
     9 | War
    
    MovieGenre (movie, genre)
    
    Movie | Genre
    ------+-------
        1 | 1
        1 | 2
        2 | 1
        2 | 3
        2 | 4
        2 | 5
        3 | 3
        3 | 6
        3 | 7
        4 | 1
        4 | 8
        4 | 9
    

    Then your problems become much, much simpler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a movie database Kind of like a blog and I want to
I Have to get a movie from a PostgreSQL database that matches a given
I have an example database, it contains tables for Movies, People and Credits. The
i have a process to move rows from one database to another. Because of
I have a bunch of records I want to move to another database and
I have two tables in my database, called ratings and movies . Ratings: |
I have database of about 5 tables. I am going to need to get
I have database called test.sqlite and i have copied the database file in to
I have database with many tables. In the first table, I have a field
I have database application, I want to allow the user to restore the deleted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.