Last post Apr 02, 2012 10:46 AM by Basquiat
Apr 02, 2012 10:10 AM|Ryanm353|LINK
Hey so im having trouble getting SQL queries done. Are you able to help?
The first question is;
1. List title, start and end dates of all modules run in the ‘ICT - information and communication technologies’ course.
For the SQL I have,
But im getting an error saying "Characters found after end of SQL statement" .. any ideas on how to resolve this?
Second question is;
2. List last name, post, and qualifications of all members of academic staff who are employed by the department of ‘Computing and Intelligent Systems’.
For SQL I have,
SELECT LastName, Post, Qualifications
WHERE DepartmentName = 'Computing and Intelligent Systems'
and im getting the same error as the first one.
The third question is;
3. For each course with more than 6 students, list the course title and the number of students
For SQL I have;
SELECT CourseTitle, MatricultaionNumber
FROM Course, Student
WHERE MatricultaionNumber FROM Student > 6
Im getting a syntax error (missing operator) in query expression MatricultaionNumber FROM Student > 6
So yeah any help would be greatful! Im new at this stuff and i need to get it correct.
Apr 02, 2012 10:15 AM|Basquiat|LINK
For question 1 and 2....just remove the semicolon after the tabel name in your FROM clause
and your 3rd question...you have 2 FROM clauses
Apr 02, 2012 10:22 AM|Basquiat|LINK
Try something like this for your 3rd query
SELECT C.CourseTitle, S.MatricultaionNumber
FROM Course C
SELECT MatricultaionNumber, COUNT(MatricultaionNumber) as NumberOfStudents
GROUP BY CourseId
ON C.CourseId = S.CourseId
WHERE S.NumberOfStudents > 6
Apr 02, 2012 10:30 AM|Ryanm353|LINK
Aw I cant even begin of how grateful I am for you help!
THANK YOU!!! :)
Apr 02, 2012 10:46 AM|Basquiat|LINK
Kindly mark as the anwer, if it did resolve your issue, it'll also assist others.