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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:31:04+00:00 2026-05-17T22:31:04+00:00

I have a really basic question on SQL. Relational Schema: Student (Sid, Sname )

  • 0

I have a really basic question on SQL.

Relational Schema:

  • Student (Sid, Sname )
  • Class (Sid, ClassName, mark)
  • ClassName = { MATH, ENGLISH, PHY, …….}

I want to list out all the student who have taken MATH, and their MATH class average minus the student’s math mark

Select DINSTINCT S.Sname, (E.Mark - AVG (E.Mark))   
From Student As S, Class As C   
Where C.ClassName = 'MATH'  AND S.Sid = C.Sid

I don’t know how to do difference; I don’t think this is right; can someone tell me how to fix this?

  • 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-17T22:31:05+00:00Added an answer on May 17, 2026 at 10:31 pm
    Select DISTINCT S.Sname, E.Mark - (SELECT AVG(E.Mark)
                                         FROM Student
                                        WHERE C.ClassName = 'MATH')
    From Student As S, Class As C   
    Where C.ClassName = 'MATH'  AND S.Sid = C.Sid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

really basic question, I have a string to generate as SQL statement that I
I have another SQL/access 2007 question that seems really basic but I'm not sure
This is a really basic question but... I have some code like this var
Basic Question - I have installed SQL Server Express 2008 with integrated SP1 .
We’ve found that the unit tests we’ve written for our C#/C++ code have really
What should i use to code Classic ASP under Linux. I have really tried
I have some really complicated legacy code I've been working on that crashes when
I have a really big database (running on PostgreSQL) containing a lot of tables
I have never really found the design view in Visual Studio useful when developing
I have a really long 3 column table. I would like to <table> <tr><td>Column1</td><td>Column2</td></tr>

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.