Software Engineering › Learn step by step › Y12 Programming for the Web
Item 287 of 426 · Year 12: Programming for the Web, 53 of 59
SQL alias (AS)
Code pattern Check
Jump to a topic
- Exam format, question types and command words (46)
- Year 11: Programming Fundamentals (69)
- Year 11: The Object-Oriented Paradigm (33)
- Year 11: Programming Mechatronics (29)
- Year 12: Secure Software Architecture (57)
- Year 12: Programming for the Web (59)
- Year 12: Software Automation (35)
- Year 12: The Software Engineering Project (47)
- Diagrams and modelling tools (18)
- Python, SQL, pseudocode and CSS patterns (33)
Definition
Gives a table or column a temporary name to make queries shorter and clearer: SELECT s.name AS student FROM Student AS s.
Example: FROM Student AS s JOIN Class AS c
Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.
Where you'll use it in the test
Syllabus area: Y12 Programming for the Web.
Question types it can appear in
- SQL: Write or read it in the SQL query tool.
- Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
Where it has appeared in the paper
Programming for the Web (Part C). Part letters follow each paper’s own layout.
Related past questions
- Familiarisation Q12b (3 marks): SQL (joins, AS) Programming for the Web (Part C) · 3 marks
How to use it
A model sentence
Code pattern: “Gives a table or column a temporary name to make queries shorter and clearer: SELECT s.name AS student FROM Student AS s.” Then apply it: FROM Student AS s JOIN Class AS c
In a short answer, give the definition in your own words first, then tie it to the situation in the question. Do not copy the example above unless it fits the scenario.
Official worked answer
Familiarisation Q12b (3 marks): SQL (joins, AS) (3 marks): official criteria and sample answer
Criteria
3: Correct SQL query. 2: Substantially correct query with at least TWO of: renaming the columns; selecting the three tables; joining the tables. 1: Some understanding of renaming the columns or joining the tables.
Sample answer
SELECT Customers.CustName as 'Customer', Products.ProductName as 'Product', Orders.OrderQuantity as 'Quantity' FROM Products, Customers, Orders WHERE Orders.ProductID = Products.ProductID AND Orders.CustID = Customers.CustID ORDER BY Orders.OrderID ASC
Go deeper
- Flashcard: SQL alias (AS) in Programming for the Web (Year 12) · study that set
- Memorise: SQL vs ORM
- Notes: SQL: HSC syntax and must-know queries (Python and SQL you must be able to write)
- Master answer: sample-q17 (3 marks, SQL) (Master model answers: Programming for the Web)
- Master answer: sample-q17 (3 marks, SQL) (Master model answers: code, SQL, pseudocode, diagrams and tables)
- Notes: Part 3. Where this has been examined (see ../../question_bank.md) (Programming for the Web (Year 12))
- Full term page: every question, note and marking comment for SQL alias (AS)
Check yourself
Write or say the “SQL alias (AS)” pattern from memory: the syntax and what it does.
Reveal the answer
Gives a table or column a temporary name to make queries shorter and clearer: SELECT s.name AS student FROM Student AS s.
Example: FROM Student AS s JOIN Class AS c
Could be tested as: SQL, Code reading.