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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:48:58+00:00 2026-05-31T04:48:58+00:00

I am developing an intranet web application that provides the users with short quizzes.

  • 0

I am developing an intranet web application that provides the users with short quizzes. The quizzes will be sent to the users via emails. I have the following database design:

Employee Table: Username, Name, Job, DivisionID

Division Table: DivisionID, DivisionName

Quiz Table: QuizID, Title, Description, IsSent

UserQuiz Table: UserQuizID, Score, DateTimeComplete, QuizID, Username

NOTE: The first attribute in each table is the primary key.

And for your information, IsSent is a flag used to determine which quiz is sent to the users and which one is not.

What I want and need now is: I need to come up with a query that shows the names of the non-participants in the last sending quiz. It means if there is more than one quiz that is sent to the users, this query should display the names of non-participants in the last sending quiz. The query also should display the DivisionName, too.

I came up with the following query but it shows the non-participants in all quizzes in the database. So how to modify it? or how to get what is required above?

SELECT     TOP (100) PERCENT Q.Title, D.DivisionShortcut, E.Name
FROM         dbo.Quiz AS Q CROSS JOIN
                      dbo.employee AS E LEFT OUTER JOIN
                      dbo.Divisions AS D ON E.DivisionCode = D.SapCode
WHERE     (NOT EXISTS
                          (SELECT     UserQuizID, QuizID, DateTimeComplete, Score, Username
                            FROM          dbo.UserQuiz AS UQ
                            WHERE      (Username = E.Username) AND (QuizID = Q.QuizID)))
ORDER BY Q.Title, D.DivisionShortcut
  • 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-31T04:49:00+00:00Added an answer on May 31, 2026 at 4:49 am

    Last quiz sent is

    select max(quizID) from dbo.Quiz where IsSent = 1
    

    users that participated at last quiz:

    select A.QuizID, a.Username 
    from UserQuiz a join 
     (select max(quizID) quizID from dbo.Quiz where IsSent = 1) b
      on a.QuizId = b.quizID
    

    users that did not participate at the last quiz

    select u.name, d.DivisionName
    from
      users u
      join Divisions d on (u.divisionID = d.divisionID)
      left join 
        (select A.QuizID, a.Username 
         from UserQuiz a join 
         (select max(quizID) quizID from dbo.Quiz where IsSent = 1) b
         on a.QuizId = b.quizID
         ) c
       on u.username = c.username
     where c.QuizID is null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an ASP.NET intranet web application that provides short quizzes to the
I am developing a small intranet based web application. I have YSlow installed and
I am developing an intranet web application which is a Quiz Engine. I have
I'm developing a kind of web-based intranet application that runs on wamp, other systems/hosts
I'm currently developing a MVC3 web application that needs to require extranet users to
I am developing an intranet web application which should provide its users with a
I am developing an ASP.NET intranet application that needs to have an interactive map
I'm developing an intranet-based web app that integrates with Facebook via the Graph API.
I am developing a simple ASP.NET website that will run on the intranet on
I'm developing an ASP.NET application for an intranet site that is using Windows/NTLM/WIA/whatever authentication.

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.