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 6606551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:24:29+00:00 2026-05-25T19:24:29+00:00

I have a table in a database with a structure like this Keywords id

  • 0

I have a table in a database with a structure like this
Keywords

  • id int(11)
  • U_id int(11)
  • keywords text
  • create_date int(11)

U_id is a foreign key, id is the primary key

The keywords field is a list of words created by users separated by commas
I was wondering if someone could suggest an efficient query to search such a table.

  • 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-25T19:24:29+00:00Added an answer on May 25, 2026 at 7:24 pm

    If you using MyISAM, you can create a fulltext index on field keywords. Then search using:

    select * from keywords k where match('test') against(k.keywords);
    

    Of course CSV in a database is just about the worst thing you can do. You should put keywords in a separate table. Make sure to use InnoDB for all tables.

    Table tags
    -------------
    id integer auto_increment primary key
    keyword_id integer foreign key references keywords(id)
    keyword varchar(40)
    

    Now you can select using:

    SELECT k.* FROM keywords k
    INNER JOIN tags t ON (t.keyword_id = k.id)
    WHERE t.keyword LIKE 'test' //case insensitive comparison.
    

    Much much faster than CSV.

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

Sidebar

Related Questions

I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have two database tables with the following structure: actions: action_id int(11) primary key
I have a simple database structure like this: entries table +----+-----------+------------+-----------+------+ | id |
I have created a table on an Oracle 10g database with this structure :
I have a table structure like this (vertical design). I can have unlimited number
I'm using SQL Server 2008. I have a database table that looks like this
So I have a database that has a structure something like this: [user_table] user_id,
I have a few classes, such as those that outline database table structure or
I have a database structure that has a Person table which contains fields such
I have a table in my database which stores a tree structure. Here are

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.