Considerations | Invalid Query input | Valid Query input |
Specify the table alias along with the table name if the SQL query contains more than one table. | select deptno, empno from dept,emp deptno | select d.deptno, e.empno from dept d,emp e where d.deptno = ? |
Use different column name alias for columns in the SQL query. | select firstname as name, lastname as name from emp select name,name from emp | select firstname as f_name, lastname as l_name from emp select name as name1,name as name2 from emp |
For Sybase databases, specify an alias for the column result if you are using functions on an output column. | select e.deptno, count(e.job) from employees e group by e.deptno | select e.deptno, count(e.job) as count from employees e group by e.deptno |
Column names in the SQL query should not be enclosed in quotes. | select partno as 'partno' from emp where partno = 1 | select partno as partno from emp where partno=1 |
Use the “as” keyword when you specify an alias for a column. | select city dummy from emp | select city as dummy from emp |
Irrespective of the database type, the query syntax must follow the SQL standards. Standards corresponding to specific database types are not supported. | For MySQL query, insert into example_default_now set id=?,data=? | For MySQL query, insert into example_default_now [(set,data)] values (?,?) |