Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How can I create an SQL query for finding the percentage of elements in a database using keywords?

Asked by Chandralekha Debbie Jan 11, 2024 774 views 1 answer
Share

About this question

I am currently working for an online bookstore that wants to analyze the popularity of book genres among their clients or customers. For this, I have a table of databases whose name is “Books” I which have columns like “BookID”, “Title”, ”Genre”, and “keyword”. How can I write an SQL query to calculate the percentage of books in each genre or category that contains a specific keyword? Here is the table structure given of the table “Books”

CREATE TABLE Books (
    BookID INT,
    Title VARCHAR(100),
    Genre VARCHAR(50),
    Keywords VARCHAR(200)
);

I want to write an SQL query for finding the percentage of books in each category or genre that contains keywords like “technology.”

Level up your career with Online SQL Server course! Start your journey to success today. Enroll now and unleash your full potential!

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.