Rule Definition
Table aliases improves the readability of your query when you are referencing many tables that's why they should not end with a numeric suffix.
Remediation
Check the statement and if so, remove numbers from alias name.
Violation Code Sample
select sal1.date,
sal1.ord_num,
saldet1.qty,
saldet1.title_id,
saldet1.discount,
titl1.price,
total = saldet1.qty * titl1.price * (1 - saldet1.discount/100)
from sales sal1
join salesdetail saldet1 on sal1.ord_num = saldet1.ord_num
join titles titl1 on titl1.title_id = saldet1.title_id
where sal1.stor_id = @stor_id
order by sal1.date desc, sal1.ord_num
Fixed Code Sample
select sal.date,
sal.ord_num,
saldet.qty,
saldet.title_id,
saldet.discount,
titl.price,
total = saldet.qty * titl.price * (1 - saldet.discount/100)
from sales sal
join salesdetail saldet on sal.ord_num = saldet.ord_num
join titles titl on titl.title_id = saldet.title_id
where sal.stor_id = @stor_id
order by sal.date desc, sal.ord_num
Related Technologies
Technical Criterion
Documentation - Naming Convention Conformity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.