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 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

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 1789
Alex Hales
  • 0
Alex HalesTeacher
Asked: May 31, 20222022-05-31T02:34:30+00:00 2022-05-31T02:34:30+00:00

database – I need to do a sub-query to list out the different employees (include name, email, birthday) who are working and have multiple skills,

  • 0

[ad_1]

I have the following tables:

Table EMPLOYEE:

CREATE TABLE EMPLOYEE(
EmpNo number CONSTRAINT PK_EmpNo PRIMARY KEY ,
EmpName varchar2(30),
Birthday DATE not null,
DeptNo number,
MgrNo varchar2(30) not null,
StartDate DATE not null,
Salary number(7,2) not null,
SYS_Level int,
Status int,
CONSTRAINT ck_SYS_Level CHECK  (SYS_Level > 0 AND SYS_Level < 8), 
CONSTRAINT ck_Status CHECK (Status >= 0 AND Status <= 2), 
Note varchar2(4000)

TABLE SKILL:

CREATE TABLE SKILL(
SkillNo int not null,
SkillName varchar(30) not null, 
Note varchar2(4000),
CONSTRAINT PK_SkillNo PRIMARY KEY(SkillNo) 

TABLE EMP_SKILL:

CREATE TABLE EMP_SKILL(
SkillNo int not null,
EmpNo number not null,
SkillLevel int CONSTRAINT CK_SkillLevel CHECK (SkillLevel >= 1 and SkillLevel<=3) ,
RegDate DATE not null,
Description varchar2(4000),
CONSTRAINT FK_SkillNo FOREIGN KEY(SkillNo) REFERENCES SKILL(SkillNo),
CONSTRAINT FK_EmpNo FOREIGN KEY(EmpNo) REFERENCES EMPLOYEE(EmpNo)  

Here is what Im trying to do, Status = 0 mean still working:

SELECT E.EmpName, E.Email, E.Birthday, S.SkillName
FROM (EMPLOYEE E  JOIN EMP_Skill M ON E.EmpNo = M.EmpNo) JOIN SKILL S ON M.SkillNo = S.SkillNo   
WHERE Status = 0 AND S.SkillName=".NET"

The problem is I think what Im trying to do is not like a SUB-QUERY technique. Sorry if I did something wrong to the code. Any suggestions? Tks.

[ad_2]

  • 0 0 Answers
  • 16 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 4796 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 1063 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 1009 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

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.