Table Structure
1. Table Name – Tbl_Entity_Master
E_CODE
E_NAME
STATUS
ACTIVE
DISDATE
E_TYPE
100
ABC PvtLtd
Active
1
1-1-2018
Private
101
BCD Private Limited
InActive
Null
Public
102
DEF Co. Ltd
Strike-Off with other things
Individual
103
ABC Co. Ltd
Struck-Off with others
104
BCD Co. td
null
105
GHI Co.
Amalgagted with others
106
JKL Co.
Handed over to others
107
MNO Pvt Ltd
Handed over
108
PQR Co. Ltd
109
PQR Pvt Ltd
110
ACB Co. Ltd
111
XYZ Pvt Ltd
112
IJK Co. Ltd
113
KLM Pvt Ltd
114
EFG PvtLtd
115
FGH Pvt LTd
Struck-Off
116
RST Pvt Ltd
117
XYZ Co. Ltd
118
HIJ Pvt Ltd
119
LMO Co. Ltd
Activie
120
MNO Co. Ltd
2. TBL_ENTITY_DETAILS
ID
ACC_CODE
ACC_NAME
SHARES(in%)
CEO_CODE
gref
20
Rohit Joshi
8
10
Others
2
3
4
5
Outside
6
7
30
Vijay Shah
9
11
12
13
50
Malini Parikh
40
14
15
16
17
18
19
21
22
60
Shruti Dave
23
44
24
25
26
27
28
55
29
31
Select
NA
32
3. TBL_CERTIFIED_ENTITIES
MONTH
YEAR
MAY
2018
NULL
Total Companies Query –
Select master.e_code, master.e_name
from tb_entity_master master, Tbl_entity_details details
Where master.e_code =details.e_code and
(Master.status =active or Master.Status is null)
AND (master.status not like ‘%Strike %’ or status is null)
AND (master.status not like ‘%Struck %’ or status is null)
AND (master.status not like ‘%Amalgated %’ or status is null)
AND (master.status not like ‘%Handed%’ or status is null)
AND (master.status <> ‘InActive’)
AND master.E_TYPE <> ‘Individual’
AND master.Active = 1
AND master.Disdate is null
AND details.gref <> ‘Outside’
AND details.ACC_CODE <>’Select’
Certified Companies Query
Select master.e_code, master.e_name , ‘Certified’ as CertifiedStatus
from tb_entity_master master, Tbl_entity_details details, TBL_Certified_Companies certified
Master.e_code = certified.e_code and
And certified.Month = ‘May’ AND certified.Year=2018
UNION
Select master.e_code, master.e_name , ‘UNCertified’ as CertifiedStatus
And certified.Month is null AND certified.Year is null