Using Column Aliases with AS in SQL
📖 Scenario: You are managing a small bookstore database. The store wants to display a list of books with their titles and prices, but with clearer column names for reports.
🎯 Goal: Create a SQL query that selects the book title and price from the books table, and use column aliases with AS to rename the columns to Book_Title and Book_Price.
📋 What You'll Learn
Create a table called
books with columns title (text) and price (numeric).Insert three books with exact titles and prices.
Write a SELECT query that retrieves
title and price from books.Use
AS to alias title as Book_Title and price as Book_Price.💡 Why This Matters
🌍 Real World
Column aliases are used in reports and user interfaces to show friendly column names instead of raw database column names.
💼 Career
Knowing how to use column aliases is important for database querying, reporting, and data analysis roles.
Progress0 / 4 steps