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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:21:34+00:00 2026-05-24T11:21:34+00:00

I have following query where I am fetching Question count for exams created by

  • 0

I have following query where I am fetching Question count for exams created by CreatorID 1001

SELECT count(Questions.question_id) QuestionCount 
    FROM Exams 
        LEFT JOIN Questions  
            ON Exams.exam_id = Questions.exam_id_fk 
    WHERE Exams.CreatorId='1001'

I know this is really stupid question but at some point its possible that there can be 10,000 users executing same query I just want to make sure about performace. So is there any othso er better way than this to do it ?

Thanks.

  • 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-24T11:21:35+00:00Added an answer on May 24, 2026 at 11:21 am

    Provided you do not need the Exams where no questions have been defined, the following should be faster:

    SELECT
      count(Questions.question_id) QuestionCount 
    FROM Exams 
    INNER JOIN Questions  
            ON Exams.exam_id = Questions.exam_id_fk 
    WHERE Exams.CreatorId='1001'
    

    Also make sure you have an index on the appropriate fields. Try using EXPLAIN on the query.

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

Sidebar

Related Questions

I have the following query: SELECT src_big, created, modified, owner, aid, caption FROM photo
I have the following query: select column_name, count(column_name) from table group by column_name having
I have following query in PostgreSQL: SELECT COUNT(a.log_id) AS overall_count FROM Log as a,
I have following SQL query: SELECT Count(*) AS CountOfRecs FROM tblAccount INNER JOIN tblAccountOwner
I have following MySQL query: (SELECT c.Channel as name, count(*) as total_episode FROM (
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
I have the following query: $query = SELECT - AS - FROM - WHERE
I have the following query: SELECT c.* FROM companies AS c JOIN users AS
I have following query, SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(rc_timestamp) AS LAG_TIME FROM recentchanges ORDER BY
I have following query select * from table1 if table1 contains text type column/columns

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.