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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:35:47+00:00 2026-05-28T01:35:47+00:00

I am revising for my exam and I am a bit struggling with SQL

  • 0

I am revising for my exam and I am a bit struggling with SQL queries..

Task for me is:

write a SQL query to list the full names of all the clients that
attend Allen Moore‟s classes, in alphabetical order of surname (i.e.
Lname column)

Client

Cid Fname Lname Fitness
C129 Julie Summer 1
C525 Max Hedrum 3
C628 John Long 3
C772 Warren Peace 2
C829 Anna Heart 2

Programme

Code Title Fitness
AR02 Aerobics 2
EN99 Endurance 3
TU10 Tune-Up 1
UB01 Upper-Body 2
YG02 Yoga 1

Staff

Sid Fname Lname Position Salary
S09 Jenny Sayer Psychologist 23500
S22 Allen Moore Instructor 21500
S28 Polly Purves Instructor 19000
S35 Jim Shoe Instructor 18000
S55 Mark Spencer Manager 25500

Class

Code Sid Cid
AR02 S35 C772
EN99 S22 C525
TU10 S35 C129
UB01 S28 C628
YG02 S22 C829
YG02 S22 C12

Is it something like:

SELECT Cliente.Fname, Cliente.Lname
FROM Staff, Class, Cliente
WHERE  Staff.Sid = Class.Sid AND Staff.Fname = "Allen" AND Staff.Lname = "Moore 
AND Class.Cid = Cliente.Cid
GROUP BY Cliente.lName ASC;

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-28T01:35:47+00:00Added an answer on May 28, 2026 at 1:35 am

    The GROUP BY in your query has to go, you don’t have to aggregate anything. I would prefer the SQL92 syntax for a join:

    SELECT 
        Client.Fname, Client.Lname
    FROM 
       Staff
    INNER JOIN
    Class ON Staff.Sid = Class.Sid AND Staff.Fname = "Allen" AND Staff.Lname = "Moore"
    INNER JOIN 
    Client ON Class.Cid = Cliente.Cid
    ORDER BY Cliente.lName ASC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment I am revising my sql. I wish to perform a query
I'm revising code I did not write that uses JavaMail, and having a little
I am revising one of our in-house RPMs that adds to the nagios package.
So I am revising for an exam and have struck a big rock in
I'm revising for an upcoming Haskell exam and I don't understand one of the
Hey I'm just revising for my functional programming exam coming up on friday and
I am revising for an exam tomorrow, and going over a previous years one.
Originally, I asked How do you write a policy that requires a subject be
Revising the bootstrap-modal jquery plugin from Twitter's bootstrap I see that they use CSS
I'm currently revising for an exam and I'm stuck on a question which is:

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.