Skip to content
Introduction to SQL
Introduction to SQL
Aliasing is used to rename columns
DataFrameas
df
variable
SELECT name AS first_name, year_hired
FROM employees;Hidden output
Use DISTINCT to make sure there are no repeat values when running SQL code
DataFrameas
df1
variable
SELECT DISTINCT dept_id, year_hired
FROM employees;A view is a virutal table that is the result of a saved SQL **SELECT **statement When accessed, views automaticaly update in repsonse to updates in the underlying data
DataFrameas
df2
variable
CREATE VIEW employee_hire_years AS
SELECT id, name, year_hired
FROM employees;PostgreSQL -Free and open-source relational database system -Created at the Univsersity of California, Berkeley -"PostgreSQL" refers to both the PostgreSQL database system and its associated SQL flavor
SQL Server -Has free and paid versions -Created by Microsoft -T-SQL is Microsoft's SQL flavor, used with SQL Server databases.