Currently I am learning Python programming for manipulating SQLite database, and I am a bit confused with the following SQL statement which works.
SELECT *
FROM student s, result r
WHERE s.studentid = r.studentid
When we give an alias to a table, we're taught to use the 'as' keyword before an alias, and the above SQL statement should be like this one:
SELECT *
FROM student as s, result as r
WHERE s.studentid = r.studentid
- Is the above SQL statement also correct?
- What situation don't I need to add the keyboard 'as'?
- Adding the keyword 'as' depends on our preferences? We can choose to add it or omit it randomly?
asis optional. (But be consistent.)JOINsyntax. Easier to write (without errors), easier to read and maintain, and easier to convert to outer join if needed!