question

Michael 4 avatar image
Michael 4 asked

Who of the consultant is not certified, show their names and id.

CONSULTANT

C_ID    C_LAST  C_FIRST C_MI    C_ADD   C_CITY  C_STATE C_ZIP   C_PHONE C_EMAIL
100 Myers   Mark    F   10 Sky Blvd.    Orlando FL  32825   4075551212  mm@xx.com
101 Hernandez   Sheila  R   33 Left Cr. Orlando FL  32811   4071115555  sh@yyx.com
102 ZHANG   Brian       89 SE Ave.  Tampa   FL  32822   3211515555  bz@mm.org
103 Carlson Sarah   J   22 NW Pl.   Orlando FL  32825   4075111111  sc@uu.gov
104 Courtland   Paul    R   91 Water St.    Orlando FL  32800   4075151155  pc@pp.net
105 Park    Janet   S   15 High Rd. Miami   FL  32816   9541115555  jp@hr.net

CONSULTANTS _SKILL

C_ID    SKILL_ID    CERTIFICATION
100 1   Y
100 3   N
100 6   Y
101 4   N
101 5   N
102 7   Y
103 1   Y
103 6   Y
103 8   Y
103 9   Y
104 8   N
104 9   Y
105 2   N
105 3   N
105 4   Y
queryhomework
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ian Roke avatar image
Ian Roke answered

The easy solution would be to do these for you but aside from making my eyes bleed these look like simple join queries to me.

May I suggest you learn a bit about the join syntax in T-SQL through this great article here. Once you understand it a bit better you might be able to see how these queries and others you posted on here can be answered.

This could be more valuable in terms of personal development than just getting the answer.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Michael 4 avatar image Michael 4 commented ·
Would the Answer look like this Select C_ID,Certification,C_last,C_first from consultant, Consultant_skill where C__ID=Certification And C_ID=101, Hernandez,Shelia And Certification=N
0 Likes 0 ·
CirqueDeSQLeil avatar image
CirqueDeSQLeil answered

You have provided nothing more than a query. You need to provide some detail and what your actual question is.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DaniSQL avatar image
DaniSQL answered

Michael, use INNER JOIN and here is the general syntax

SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name

So based on the above syntax; for your specific question try something like this..

Select CONSULTANT.C_id, CONSULTANT.C_last, CONSULTANT.C.First
From CONSULTANT 
     INNER JOIN CONSULTANTS_SKILL 
     ON CONSULTANT.C_id = CONSULTANTS_SKILL.C_id

Good Luck!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.