Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 First time SQL user. Can't make sense of anything!

Author  Topic 

the_k
Starting Member

2 Posts

Posted - 2012-07-07 : 14:30:28
Hello everyone!
I am stuck with an excel assignment that I just can't make sense of. When I read the questions, it sounds pretty simple but when I try and actually build a query, I get all confused.

Add to this that I have NEVER used SQL before, have no programming experience of any sort. I am still a student (if you hadn't guessed already:) and we have only had one lecture on sql. It all made perfect sense during the class but actually doing the damn thing is pretty confusing. I need, and will appreciate any and all help with this assignment. Thanks in advance!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-07 : 16:28:13
i would suggest you start with

http://www.w3schools.com/sql/default.asp

which has good working examples of sql

start with basic joins exercise

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

the_k
Starting Member

2 Posts

Posted - 2012-07-07 : 16:42:50
Thats the website I am using. This is my thinking for Q1....feel free to correct me..

I am trying to extract the student name, student id, address, city, state and country along with the gpa.

I have been able to do this using the join examples given on the website.

but now I cant figure out how to average the gpas.

This is my query for extracting all the relevant info:

Select Student.student_ID, student.Student_Name, student.City, student.State, student.Country, gpa.GPA
from student
inner join gpa
on gpa.Student_ID=student.Student_ID
Where (student.City='Atlanta' and student.State='GA') or (student.City='New Orleans' and student.State='LA')or(student.City='Seoul' and student.Country='korea')

order by student.Student_Name
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-07 : 17:16:06
you need to lookup for GROUP BY and AVG() function exercises for that

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -