0% found this document useful (0 votes)
87 views2 pages

SQL Test (MSSQL/Oracle) : Lotno Stepid in - Qty in - Date Out - Qty Out - Date

The document contains a series of SQL queries and expected outputs to test SQL skills on tables containing lot production data. It also includes questions to test programming skills in VB/C# such as finding the second highest number in an array and finding a missing number from a range stored in an array. The final question asks how to create a generic error handling routine.

Uploaded by

tjm.stkr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views2 pages

SQL Test (MSSQL/Oracle) : Lotno Stepid in - Qty in - Date Out - Qty Out - Date

The document contains a series of SQL queries and expected outputs to test SQL skills on tables containing lot production data. It also includes questions to test programming skills in VB/C# such as finding the second highest number in an array and finding a missing number from a range stored in an array. The final question asks how to create a generic error handling routine.

Uploaded by

tjm.stkr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Test(MSSQL/Oracle)

LOTNO STEPID IN_QTY IN_DATE OUT_QTY OUT_DATE


702ZZAB A060 800 20170114 120952000 800 20170115 085817000
702ZZAB A265 2330 20170120 080406000 2327 20170121 230450000
702ZZAC A060 8589 20170113 122857000 8589 20170114 125903000
702ZZAC A085 8589 20170117 061307000 8544 20170117 071845000
702ZZAC A115 8544 20170117 234259000 8544 20170118 005053000
702ZZAC A265 8544 20170120 153705000 8529 20170121 112631000
Table Name: T_TRAN

1. Write a Query, to get Last StepID, and Last Qty from table above.
Note : Try to get last record(sort by out date)
Statement Input: LOTNO = ‘702ZZAB’

Expected Output:
LOTNO LASTSTEP LASTQTY LASTTRANSACTION
702ZZAB A265 2327 20170121 230450000
2. Get Yield information from T_TRAN, display only those step with yield lose (2 decimal).
Note: Yield = (OUT Qty/ IN Qty) * 100
Statement Input: LOTNO = ‘702ZZAC’

Expected Output: LOTNO STEPID YIELD


702ZZAC A085 99.48
702ZZAC A265 99.82

3. Get Total Out Qty At StepID : A265 from T_TRAN.

Expected Output: TOTAL_QTY


10856

4. Get LotNo that with PMC process, by link T_PROCESS table with T_TRAN table.

STEPID DESCRIPTION
A060 DIEATTACH
A085 WIREBOND
A115 PMC
A120 MOLD
A265 FYI
Table Name : T_PROCESS

Expected Output: LOTNO


702ZZAC
5. Use other method, to return same result based on query given.
SELECT LOTNO
FROM T_TRAN
GROUP BY LOTNO

Output :
LOTNO
702ZZAB
702ZZAC

6. Write 1 simple query base on T_TRAN table, to return LotNo with more than 2 records.

Output :
LOTNO
702ZZAC
7. Write a simple stored procedure, by passing in 2 parameter and return 1 result with Sum all
number in between.
e.g. Parameter 1 = 10, Parameter 2 = 15, Result = 50 (11+12+13+14)

Programming Test (VB/C#)


8. How do you find second highest number in an integer array?

9. In an array 1-100 numbers are stored, one number is missing how do you find it?

10. How to perform generic error handling routine?

You might also like