2 Replies - 4240 Views - Last Post: 10 April 2008 - 08:21 PM

#1 xosunkist   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 69
  • Joined: 28-March 07

Standard SQL

Post icon  Posted 08 April 2008 - 11:39 AM

How would I write this?

Write an SQL query to answer the following question:

Which instructors are qualified to teach ISM 3113?

I know I could use these names, but not sure how to organize this into a query.

Faculty_Name
Is_Qualified
Faculty_ID
Course_ID

This is my attempt at doing this:

SELECT INSTRUCTOR FROM INST_TABLE WHERE TEACHING_CLASS = ISM3113

I can NOT use Microsoft SQL (as used in Microsoft Access, for example with Inner Joins) or any other not 100 % compliant standard SQL.

Any help is appreciated. Thanks. :)

This post has been edited by xosunkist: 08 April 2008 - 12:09 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Standard SQL

#2 jjsaw5   User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 3,063
  • Joined: 04-January 08

Re: Standard SQL

Posted 08 April 2008 - 07:53 PM

View Postxosunkist, on 8 Apr, 2008 - 02:39 PM, said:

How would I write this?

Write an SQL query to answer the following question:

Which instructors are qualified to teach ISM 3113?

I know I could use these names, but not sure how to organize this into a query.

Faculty_Name
Is_Qualified
Faculty_ID
Course_ID

This is my attempt at doing this:

SELECT INSTRUCTOR FROM INST_TABLE WHERE TEACHING_CLASS = ISM3113

I can NOT use Microsoft SQL (as used in Microsoft Access, for example with Inner Joins) or any other not 100 % compliant standard SQL.

Any help is appreciated. Thanks. :)



Hold on so you can't use SQL to write this query but the title of your post is "Standard SQL"???!!!!! Then what can or would you like to use? How about we start there.

This post has been edited by jjsaw5: 08 April 2008 - 07:55 PM

Was This Post Helpful? 0
  • +
  • -

#3 JasonMcAuley   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 144
  • Joined: 10-April 08

Re: Standard SQL

Posted 10 April 2008 - 08:21 PM

Can you give us more details of your database structure?

In your query

SELECT INSTRUCTOR FROM INST_TABLE WHERE TEACHING_CLASS = ISM3113

You are selecting out a varchar without the quotes; so I am guessing you're getting a syntax error on that.

If your query is something like this:

SELECT INSTRUCTOR FROM INST_TABLE WHERE TEACHING_CLASS = "ISM3113"

You should be able to run your query without a syntax error. As to whether or not it will return the correct values; I can't say without knowing your data and data structure.



Hope this helps; good luck.

This post has been edited by JasonMcAuley: 10 April 2008 - 08:22 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1