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

  • Home
  • SEARCH
  • 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 6343691
In Process

The Archive Base Latest Questions

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

I would like to build a reporting tool in an Oracle database that calculates

  • 0

I would like to build a reporting tool in an Oracle database that calculates a score based on the result of multiple fairly complex queries that work on different tables. All of these queries will give me a list of a specific ID if certain criteria match.

Here’s an example:

Imagine that there would be three queries “Find all user IDs that live in Seattle”, “Find all user IDs that bought a car during the last three months” and “Find all user IDs that moved within the US more than 3 times”. Each of these queries would get a score for a user if the user ID is found for a query e.g. query 1 = 3 points, query 2 = 5 points, query 3 = 2 points. The end result should give a list of users and their IDs that have a match for at least one of the queries. The result set would be ordered by the sum of all scores descending. The result set should be up-to-date.

| user_id | points_lived_in_seattle | points_bought_car | points_moved | sum |
------------------------------------------------------------------------------
|     123 |                       3 |                 0 |            2 |   5 |
|     456 |                       0 |                 3 |            0 |   3 |
|     789 |                       0 |                 0 |            2 |   2 |

What’s the best way to achieve a reporting tool like this in Oracle? I was thinking to create a view for it but this would be very hard because there could be 20 or more queries that could be added to this in the near future. Also I am worried about the fact that the joins that combines all queries don’t work correctly and cause an incorrect result set.

Another option I was thinking about was to create a materialized view for each of the queries and one view that just creates the scoring based on the other views.

How would you go go about solving this problem? What could be the performance impact on the database overall if one the queries is very slow?

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

    Why are you thinking about materialized views? Test the queries in one statement and if they’re quick enough then use them. If not, and you’ve checked your indexes, why not just insert the results into a table and then “select * from table order by sum desc”?

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

Sidebar

Related Questions

I would like to build (or find) a php reporting library that I can
I would like to build a regexp in Java that would be passed in
I would like to build an application that will run on a web, this
I would like to build a query that will pull the number of rows
I would like to build a cross-platform GUI application in Python that displays PostScript
I would like to build an excel VBA program to find all the match
I would like to build some code which calls some code on loadup of
I would like to build a static version of QT Library for X11 like
I would like to build some smaller scale but hightly customized documentation sites for
I would like to build a simple animation for a school project. I want

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.