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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:20:23+00:00 2026-05-19T06:20:23+00:00

Assume these two tables: blog id title keywords 1 Hello hello,world,test 2 Google search,

  • 0

Assume these two tables:

blog

id title      keywords
1  Hello      hello,world,test
2  Google     search, email, security
3  Microsoft  clippy, collaboration

category

id keywords
1  test, world, clippy

How do I search for blog rows that have one or more keyword matching a keyword in the category row?

  • 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-19T06:20:25+00:00Added an answer on May 19, 2026 at 6:20 am

    Succinctly: if you want to do that operation, you don’t store your data like that. You normalize your data, and search using the normalized data:

    CREATE TABLE Blog
    (
        id      INTEGER NOT NULL PRIMARY KEY,
        title   VARCHAR(30) NOT NULL
    );
    
    INSERT INTO Blog(id, title) VALUES(1, 'Hello');
    INSERT INTO Blog(id, title) VALUES(2, 'Google');
    INSERT INTO Blog(id, title) VALUES(3, 'Microsoft');
    
    CREATE TABLE BlogKeywords
    (
        id      INTEGER NOT NULL,
        keyword VARCHAR(20) NOT NULL,
        PRIMARY KEY(keyword, id)
    );
    
    INSERT INTO BlogKeywords(id, keyword) VALUES(1, 'hello');
    INSERT INTO BlogKeywords(id, keyword) VALUES(1, 'world');
    INSERT INTO BlogKeywords(id, keyword) VALUES(1, 'test');
    INSERT INTO BlogKeywords(id, keyword) VALUES(2, 'search');
    INSERT INTO BlogKeywords(id, keyword) VALUES(2, 'email');
    INSERT INTO BlogKeywords(id, keyword) VALUES(2, 'security');
    INSERT INTO BlogKeywords(id, keyword) VALUES(3, 'clippy');
    INSERT INTO BlogKeywords(id, keyword) VALUES(3, 'collaboration');
    
    CREATE TABLE Category
    (
        id      INTEGER NOT NULL,
        keyword VARCHAR(20) NOT NULL,
        PRIMARY KEY(id, keyword)
    );
    
    INSERT INTO Category(id, keyword) VALUES(1, 'test');
    INSERT INTO Category(id, keyword) VALUES(1, 'world');
    INSERT INTO Category(id, keyword) VALUES(1, 'clippy');
    

    Now you can search easily using simple joins:

    SELECT DISTINCT b.id AS BlogID, b.Title, c.id AS CategoryID
      FROM Blog AS b
      JOIN BlogKeywords AS K ON b.id      = k.id
      JOIN Category     AS C ON k.keyword = c.keyword;
    

    It isn’t completely clear what you’d want to see if there were multiple catagories.

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

Sidebar

Related Questions

Assume we have these two tables, binded by foreign key CAT_ID: Category[CAT_ID,CAT_NAME] cat_id =
Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Let's assume I have a database with two tables: categories and articles . Every
There are two tables with identical structure. Let's assume the number of rows in
Assume that we have two tables: Roles and Reports . And there exists a
Let's assume I two tables GOOD and BAD that stores records for widget production.
Assume two tables in Oracle 10G TableA (Parent) --> TableB (Child) Every row in
Let's assume that I have two tables... Foo and Bar. They contain the following
Consider these 2 pieces of code (you can assume execeptionObj is of type Object
I am new to ADO.net and have this problem: Let's assume I have these

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.