INPUT
There are two Data Tables.
The first table is as follows:
PLCNO | NAME | DATE | AGE | DDNO | EML | TRANID |
---|---|---|---|---|---|---|
1000 | John | 14-06-2021 | 23 | 1 | 500 | ASC234RT |
1001 | Mary | 15-06-2021 | 43 | 2 | 100 | WERT432 |
1002 | Ram | 16-06-2021 | 55 | 400 | DHI765WE | |
1003 | Shyam | 13-06-2021 | 22 | 5 | 400 | QWE123AS |
1004 | Ali | 12-06-2021 | 18 | 6 | 300 | JHJHJ23 |
1006 | Robin | 11-06-2021 | 32 | 100 | ASW23RT | |
1007 | Ash | 10–6-2021 | 29 | 5 | 400 | TEW345 |
and the second table is like
PLCNO | CITY | PHONE | BLD | ISPRES | DDNO | EML | STATUS |
---|---|---|---|---|---|---|---|
1000 | CALIFORNIA | 23456 | B | YES | 1 | 500 | CONF |
1001 | PARIS | 24356 | AB | NO | 2 | 100 | PEND |
1002 | LONDON | 23789 | O | YES | 100 | DONE | |
1003 | DELHI | 23098 | AB | NO | 5 | 400 | CONF |
1004 | CHENNAI | 23000 | AB | YES | 6 | 300 | PEND |
1005 | LUCKNOW | 23765 | A | NO | 2 | 500 | DONE |
The columns PLCNO, DDNO, EML are common in both the tables.
OUTPUT
Two output tables are required which are as follows-
First Output table is as follows:
PLCNO | NAME | DATE | AGE | DDNO | EML | TRANID | STATUS |
---|---|---|---|---|---|---|---|
1000 | John | 14-06-2021 | 23 | 1 | 500 | ASC234RT | CONF |
1001 | Mary | 15-06-2021 | 43 | 2 | 100 | WERT432 | PEND |
1002 | Ram | 16-06-2021 | 55 | 400 | DHI765WE | ||
1003 | Shyam | 13-06-2021 | 22 | 5 | 400 | QWE123AS | CONF |
1004 | Ali | 12-06-2021 | 18 | 6 | 300 | JHJHJ23 | PEND |
1006 | Robin | 11-06-2021 | 32 | 4 | 100 | ASW23RT | |
1007 | Ash | 10–6-2021 | 29 | 5 | 400 | TEW345 |
Second output Table is as follows:
PLCNO | NAME | DATE | AGE | DDNO | EML | TRANID | STATUS |
---|---|---|---|---|---|---|---|
1000 | John | 14-06-2021 | 23 | 1 | 500 | ASC234RT | CONF |
1001 | Mary | 15-06-2021 | 43 | 2 | 100 | WERT432 | PEND |
1003 | Shyam | 13-06-2021 | 22 | 5 | 400 | QWE123AS | CONF |
1004 | Ali | 12-06-2021 | 18 | 6 | 300 | JHJHJ23 | PEND |
PROCESS
To get the output tables, we need to compare PLCNO, DDNO and EML of both the input tables. All the rows for which the their values are Equal it is added in the output table. The first output table is the first input table with one extra column (STATUS) from the 2nd input table with values mentioned only for rows in which there is a match (i.e. LEFT JOIN)
The 2nd output table it’s INNER JOIN on PLCNO, DDNO and EML columns.
RQUIRED
Separate LINQ queries for both outputs
Note: The actual operation is to be performed on tables containing 650K rows and 150 columns. There is no such requirement of row order to be same as shown in output tables.