• +1-617-874-1011 (US)  
  • +44-117-230-1145 (UK)  
Online Customer Service
Follow Us:

Join Related SQL Query Help

4. JOIN related SQL Query -

EMPLOYEE TABLE

EMP_ID

FIRST_NAME

LAST_NAME

GENDER

DEPARTMENT

JOINING_DATE

SALARY

1001

ANDREW

CENCINI

MALE

IT

08-01-2014

300000

1002

STEVEN

THROPE

MALE

HR

10-02-2014

400000

1003

ANNE

HELLUNG-LARSEN

FEMALE

FINANCE

20-03-2014

500000

1004

DENE

SENA

FEMALE

ACCOUNT

30-04-2014

200000

ASSIGNMENT TABLE

ASSIGN_ID

EMP_ID

ASSIGNMENT_NAME

ASSIGN_DATE

DUE_DATE

11

1001

MENAGEMENT

01-02-2014

01-03-2014

22

1001

HR SYSTEM

11-02-2014

11-04-2014

33

1002

MENAGEMENT

01-03-2014

01-04-2014

44

1003

FINANCE

01-03-2014

01-04-2014

55

1003

DBMS

11-04-2014

11-05-2014

66

1004

DB

10-04-2014

10-06-2014

1. get employee name, project name order by firstname from "EMPLOYEE" and "ASSIGNMENT" for those employee which have assigned project already.

SELECT FIRST_NAME, ASSIGNMENT_NAME FROM EMPLOYEE A INNER JOIN ASSIGNMENT B ON A.EMP_ID=B.ASSIGN_ID ORDER BY FIRST_NAME

2. order by first_name "EMPLOYEE" and "ASSIGNMENT" for all employee even they have not assigned assignment.

SELECT FIRST_NAME, ASSIGNMENT_NAME FROM EMPLOYEE A LEFT JOIN ASSIGNMENT B ON A.EMP_ID=B.ASSIGN_ID ORDER BY FIRST_NAME

3. get all assignment name even they have not matching any employeeid, in left table, order by firstname from employee and assignment.

SELECT FIRSTNAME, ASSIGNMENTNAME FROM EMPLOYEE A RIGHT OUTER JOIN ASSIGNMENT B ON A.EMP_ID=B.ASSIGN_ID ORDER BY FIRSTNAME

4. get complete record from both table, if no match found in any table then show null.

SELECT FIRSTNAME, ASSIGNMENT_NAME FROM EMPLOYEE A FULL OUTER JOIN ASSIGNMENT B ON A.EMP_ID=B.ASSIGN_ID ORDER BY FIRST_NAME

5. query to get the employee name who has not assigned any assignment, and display “no project assigned”

SELECT FIRST_NAME, ISNULL(ASSIGNMENT_NAME-‘NO ASSIGNMENT ASSIGNED’) AS ASSIGNMENT FROM EMPLOYEE A LEFT OUTER JOIN ASSIGNMENT B ON A.EMP_ID = B.ASSIGN_ID WHERE ASSIGNMENT_NAME IS NULL

Keywords: Data Relations homework help, SQL homework help, SQL project Help, Oracle Homework Help, XML homework help, XML and Relational Algebra assignment help, SQL Queries and Updates homework assignment help, XML Queries and Transformations tutoring help, Relational Database Design concept, Higher-Level Design help in UML and ERD, Data Warehousing and Data Mining, help with SQL 2008 database, support for Database help, Microsoft access and mysql database programmer, database development and xml database support, homework helper for asp database and uml modeling, uml sequence diagram and uml class diagram, database design development and software SQL server 2008.
Tap to Chat
Get Instant Assignment Help
Tap to Chat
Get Instant Assignment Help