SlideShare a Scribd company logo
1 of 43
Download to read offline
Join 10,000+ Product Managers on
2,000+
6
Include @productschool and #prodmgmt at the
end of your tweet
Tweet to get a free ticket
for our next Event!
● Hierarchical
○ 1960s IBM
○ Efficient but complex to implement
History of Databases
● Relational
○ Logically-related entities (tables)
○ Dominant form of storage
○ Major players: Microsoft (Access, SQL Server), Oracle (Oracle, mySQL)
● NoSQL
○ Schemaless
○ Quick to implement
○ Easy to change on the fly
○ Most famous: MongoDB
What is SQL
Structured Query Language, the standard method of querying relational databases
Developed in IBM's San Jose research laboratory in the 1970's.
Standardised by ANSI in 1986
Using SQL, you can define
● what data you want to retrieve from the database
● what tables you want to get the data from
● what actions you want to perform on the data
Most major commercial platforms have their own "flavor" of SQL (i.e. ANSI SQL+)
but basic concepts common to all.
Structure of relational database
Tables and relationships
SQL Standard Commands
● Select
● Insert
● Update
● Delete
● Create
● Drop
Table Basics
Column:
● Column name
● Data Type
● Attributes (length, format, etc)
Rows
● Records
Format of create table if you were to use optional constraints:
create table "tablename"
("column1" "data type"
[constraint],
"column2" "data type"
[constraint],
"column3" "data type"
[constraint]);
[ ] = optional
Note: You may have as many columns as you'd like, and the constraints are optional.
CREATE Table
CREATE Table
Example:
create table employee
(first varchar(15),
last varchar(20),
age number(3),
address varchar(30),
city varchar(20),
state varchar(20));
DROP Table
The drop table command is used to delete a table and all rows in the table.
drop table "tablename"
Example:
drop table myemployees_ts0211;
Note: To delete an entire table including all of its rows, issue the drop table command
followed by the tablename. drop table is different from deleting all of the records in the
table. Deleting all of the records in the table leaves the table including column and
constraint information. Dropping the table removes the table definition as well as all of its
rows.
INSERT Statement
The insert statement is used to insert or add a row of data into the
table.
insert into "tablename"
(first_column,...last_column)
values (first_value,...last_value);
In the next example, the column name first will match up with the
value 'Luke', and the column name state will match up with the value
'Georgia'.
INSERT Statement
Example:
insert into employee
(first, last, age, address, city, state)
values ('Luke', 'Duke', 45, '2130 Boars Nest',
'Hazard Co', 'Georgia');
UPDATE Statement
The update statement is used to update or change records that match a specified criteria.
update "tablename"
set "columnname" =
"newvalue"
[,"nextcolumn" =
"newvalue2"...]
where "columnname"
OPERATOR "value"
[and|or "column"
OPERATOR "value"];
UPDATE Statement
Examples:
update phone_book
set area_code = 623
where prefix = 979;
DELETE Statement
The delete statement is used to delete records or rows from the table.
delete from "tablename"
where "columnname"
OPERATOR "value"
[and|or "column"
OPERATOR "value"];
Examples:
delete from employee
where lastname = 'May';
Query Structure
The SELECT statement is used to query the database and retrieve
selected data that match the criteria that you specify. Every SQL query
will have the same basic structure
SELECT <- The fields you want to return
FROM <- The tables the fields live in
select "column1" [,"column2",etc]
from "tablename"
WHERE Clause
The Where clause is used to restrict the rows returned by filtering on
specific values
SELECT
FROM
WHERE
SELECT
*
FROM
Employee
WHERE
jobCode = "SFI";
JOIN tables
Joins allow you to link data from two or more tables together into a
single query result--from one single SELECT statement.
SELECT "list-of-columns"
FROM table1,table2
WHERE "search-condition(s)"
JOIN tables
Example:
SELECT employee_info.employeeid, employee_info.lastname,
employee_sales.commission
FROM employee_info, employee_sales
WHERE employee_info.employeeid = employee_sales.employeeid;
Logical operators
The AND operator can be used to join two or more conditions in the
WHERE clause. Both sides of the AND condition must be true in order
for the condition to be met and for those rows to be displayed.
WHERE "condition1" AND "condition2"
The OR operator can be used to join two or more conditions in the
WHERE clause also. However, either side of the OR operator can be
true and the condition will be met - hence, the rows will be displayed.
Logical operators
For example:
SELECT employeeid, firstname, lastname, title, salary
FROM employee_info
WHERE salary >= 45000.00 AND title = 'Programmer';
Calculations, functions, operators
● Standard math: +, -, /, *
● Math functions: ABS(), ROUND(), etc
● String function*: length (), substr (), upper (), etc
● IN, BETWEEN
Example:
SELECT lastname, round(salary)
FROM emp
WHERE lastname IN ('Hernandez', 'Jones', 'Roberts', 'Ruiz');
Aggregative functions
● Max
● Min
● Sum
● Avg
● Count
Example:
SELECT AVG(salary)
FROM employee
WHERE title = 'Programmer'
The GROUP BY clause will gather all of the rows together that contain
data in the specified column(s) and will allow aggregate functions to be
performed on the one or more columns. This can best be explained by
an example:
SELECT column1,
SUM(column2)
FROM "list-of-tables"
GROUP BY "column-list"
GROUP BY
Let's say you would like to retrieve a list of the highest paid salaries in
each dept:
SELECT max(salary), dept
FROM employee
GROUP BY dept
GROUP BY
LIKE Operator
Use this operator to perform string matching
You can also use "%" to specify any number of random characters
SELECT
*
FROM
Employee
WHERE
Lower (lastname) LIKE '%imp%';
Other SELECT options
● ORDER BY
● UNION
● LIMIT
● OUTER JOIN
● Sub-queries
Table Security
Commands:
● GRANT
● REVOKE
Privileges:
● Read
● Write
● Owner
Level:
● User
● Role/Group
● Schema
Other database objects
Indexes
Primary/unique keys
Foreign keys
Views
Job roles
Database architect/designer
Database engineer
Database administrator
Industry-specific
Popular flavors:
● Oracle - PL/SQL
● Microsoft - Transact-SQL
Popular SQL Tools:
● Toad
● Access
Tuesdays & Thursdays
6.30pm - 9pm
Saturdays
9.30am - 3.30pm
Mondays &
Wednesdays
6.30pm - 9pm
Saturdays
9.30am - 3.30pm
‘Open
Marketplaces’
‘Products are
about People’
Intro to SQL by Google's Software Engineer

More Related Content

What's hot

How to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryHow to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryAli Dasdan
 
PowerPivot and PowerQuery
PowerPivot and PowerQueryPowerPivot and PowerQuery
PowerPivot and PowerQueryin4400
 
Intro to SQL for Beginners
Intro to SQL for BeginnersIntro to SQL for Beginners
Intro to SQL for BeginnersProduct School
 
From Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka JourneyFrom Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka JourneyAllen (Xiaozhong) Wang
 
How to Build a Robust Product Roadmap by Salesforce VP of Product
How to Build a Robust Product Roadmap by Salesforce VP of ProductHow to Build a Robust Product Roadmap by Salesforce VP of Product
How to Build a Robust Product Roadmap by Salesforce VP of ProductProduct School
 
Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Databricks
 
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...Denodo
 
Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks Nishant Gandhi
 
How to Build a Product Roadmap by eBay Director of Product
How to Build a Product Roadmap by eBay Director of ProductHow to Build a Product Roadmap by eBay Director of Product
How to Build a Product Roadmap by eBay Director of ProductProduct School
 
Mongodb administración
Mongodb administraciónMongodb administración
Mongodb administraciónJuan Ladetto
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for ExperimentationGleb Kanterov
 
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaPower BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaEdureka!
 
Google BigQuery Best Practices
Google BigQuery Best PracticesGoogle BigQuery Best Practices
Google BigQuery Best PracticesMatillion
 
Power BI Desktop | Power BI Tutorial | Power BI Training | Edureka
Power BI Desktop | Power BI Tutorial | Power BI Training | EdurekaPower BI Desktop | Power BI Tutorial | Power BI Training | Edureka
Power BI Desktop | Power BI Tutorial | Power BI Training | EdurekaEdureka!
 
Data catalog
Data catalogData catalog
Data catalogiamtodor
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks FundamentalsDalibor Wijas
 
Prioritization Method for Every Case by fmr Atlassian Principal PM
Prioritization Method for Every Case by fmr Atlassian Principal PMPrioritization Method for Every Case by fmr Atlassian Principal PM
Prioritization Method for Every Case by fmr Atlassian Principal PMProduct School
 

What's hot (20)

How to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryHow to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st century
 
PowerPivot and PowerQuery
PowerPivot and PowerQueryPowerPivot and PowerQuery
PowerPivot and PowerQuery
 
Intro to SQL for Beginners
Intro to SQL for BeginnersIntro to SQL for Beginners
Intro to SQL for Beginners
 
From Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka JourneyFrom Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka Journey
 
BigQuery for Beginners
BigQuery for BeginnersBigQuery for Beginners
BigQuery for Beginners
 
How to Build a Robust Product Roadmap by Salesforce VP of Product
How to Build a Robust Product Roadmap by Salesforce VP of ProductHow to Build a Robust Product Roadmap by Salesforce VP of Product
How to Build a Robust Product Roadmap by Salesforce VP of Product
 
Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0
 
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
 
Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks
 
How to Build a Product Roadmap by eBay Director of Product
How to Build a Product Roadmap by eBay Director of ProductHow to Build a Product Roadmap by eBay Director of Product
How to Build a Product Roadmap by eBay Director of Product
 
Mongodb administración
Mongodb administraciónMongodb administración
Mongodb administración
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | EdurekaPower BI Full Course | Power BI Tutorial for Beginners | Edureka
Power BI Full Course | Power BI Tutorial for Beginners | Edureka
 
Construindo um data lake na nuvem aws
Construindo um data lake na nuvem awsConstruindo um data lake na nuvem aws
Construindo um data lake na nuvem aws
 
Google BigQuery Best Practices
Google BigQuery Best PracticesGoogle BigQuery Best Practices
Google BigQuery Best Practices
 
Power BI Desktop | Power BI Tutorial | Power BI Training | Edureka
Power BI Desktop | Power BI Tutorial | Power BI Training | EdurekaPower BI Desktop | Power BI Tutorial | Power BI Training | Edureka
Power BI Desktop | Power BI Tutorial | Power BI Training | Edureka
 
Data catalog
Data catalogData catalog
Data catalog
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks Fundamentals
 
Power BI Overview
Power BI OverviewPower BI Overview
Power BI Overview
 
Prioritization Method for Every Case by fmr Atlassian Principal PM
Prioritization Method for Every Case by fmr Atlassian Principal PMPrioritization Method for Every Case by fmr Atlassian Principal PM
Prioritization Method for Every Case by fmr Atlassian Principal PM
 

Similar to Intro to SQL by Google's Software Engineer

Similar to Intro to SQL by Google's Software Engineer (20)

Sql 2006
Sql 2006Sql 2006
Sql 2006
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
 
What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
Mysql1
Mysql1Mysql1
Mysql1
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 
Sql
SqlSql
Sql
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schools
 
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
 
Data Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdfData Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdf
 
Sql
SqlSql
Sql
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Sql
SqlSql
Sql
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schema
 
Sql
SqlSql
Sql
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 

More from Product School

Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Product School
 
Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Product School
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Product School
 
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoRevolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoProduct School
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Product School
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, TripadvisorProduct School
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolProduct School
 
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdf
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdfWebinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdf
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdfProduct School
 
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM Leader
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM LeaderWebinar: Using GenAI for Increasing Productivity in PM by Amazon PM Leader
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM LeaderProduct School
 
Unlocking High-Performance Product Teams by former Meta Global PMM
Unlocking High-Performance Product Teams by former Meta Global PMMUnlocking High-Performance Product Teams by former Meta Global PMM
Unlocking High-Performance Product Teams by former Meta Global PMMProduct School
 
The Types of TPM Content Roles by Facebook product Leader
The Types of TPM Content Roles by Facebook product LeaderThe Types of TPM Content Roles by Facebook product Leader
The Types of TPM Content Roles by Facebook product LeaderProduct School
 
Match Is the New Sell in The Digital World by Amazon Product leader
Match Is the New Sell in The Digital World by Amazon Product leaderMatch Is the New Sell in The Digital World by Amazon Product leader
Match Is the New Sell in The Digital World by Amazon Product leaderProduct School
 
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping Revolution
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping RevolutionBeyond the Cart: Unleashing AI Wonders with Instacart’s Shopping Revolution
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping RevolutionProduct School
 
Designing Great Products The Power of Design and Leadership
Designing Great Products The Power of Design and LeadershipDesigning Great Products The Power of Design and Leadership
Designing Great Products The Power of Design and LeadershipProduct School
 
Command the Room: Empower Your Team of Product Managers with Effective Commun...
Command the Room: Empower Your Team of Product Managers with Effective Commun...Command the Room: Empower Your Team of Product Managers with Effective Commun...
Command the Room: Empower Your Team of Product Managers with Effective Commun...Product School
 
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...Product School
 
Customer-Centric PM: Anticipating Needs Across the Product Life Cycle
Customer-Centric PM: Anticipating Needs Across the Product Life CycleCustomer-Centric PM: Anticipating Needs Across the Product Life Cycle
Customer-Centric PM: Anticipating Needs Across the Product Life CycleProduct School
 
AI in Action The New Age of Intelligent Products and Sales Automation
AI in Action The New Age of Intelligent Products and Sales AutomationAI in Action The New Age of Intelligent Products and Sales Automation
AI in Action The New Age of Intelligent Products and Sales AutomationProduct School
 

More from Product School (20)

Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
 
Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
 
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoRevolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product School
 
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdf
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdfWebinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdf
Webinar How PMs Use AI to 10X Their Productivity by Product School EiR.pdf
 
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM Leader
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM LeaderWebinar: Using GenAI for Increasing Productivity in PM by Amazon PM Leader
Webinar: Using GenAI for Increasing Productivity in PM by Amazon PM Leader
 
Unlocking High-Performance Product Teams by former Meta Global PMM
Unlocking High-Performance Product Teams by former Meta Global PMMUnlocking High-Performance Product Teams by former Meta Global PMM
Unlocking High-Performance Product Teams by former Meta Global PMM
 
The Types of TPM Content Roles by Facebook product Leader
The Types of TPM Content Roles by Facebook product LeaderThe Types of TPM Content Roles by Facebook product Leader
The Types of TPM Content Roles by Facebook product Leader
 
Match Is the New Sell in The Digital World by Amazon Product leader
Match Is the New Sell in The Digital World by Amazon Product leaderMatch Is the New Sell in The Digital World by Amazon Product leader
Match Is the New Sell in The Digital World by Amazon Product leader
 
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping Revolution
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping RevolutionBeyond the Cart: Unleashing AI Wonders with Instacart’s Shopping Revolution
Beyond the Cart: Unleashing AI Wonders with Instacart’s Shopping Revolution
 
Designing Great Products The Power of Design and Leadership
Designing Great Products The Power of Design and LeadershipDesigning Great Products The Power of Design and Leadership
Designing Great Products The Power of Design and Leadership
 
Command the Room: Empower Your Team of Product Managers with Effective Commun...
Command the Room: Empower Your Team of Product Managers with Effective Commun...Command the Room: Empower Your Team of Product Managers with Effective Commun...
Command the Room: Empower Your Team of Product Managers with Effective Commun...
 
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...
Metrics That Matter: Bridging User Needs and Board Priorities for Business Su...
 
Customer-Centric PM: Anticipating Needs Across the Product Life Cycle
Customer-Centric PM: Anticipating Needs Across the Product Life CycleCustomer-Centric PM: Anticipating Needs Across the Product Life Cycle
Customer-Centric PM: Anticipating Needs Across the Product Life Cycle
 
AI in Action The New Age of Intelligent Products and Sales Automation
AI in Action The New Age of Intelligent Products and Sales AutomationAI in Action The New Age of Intelligent Products and Sales Automation
AI in Action The New Age of Intelligent Products and Sales Automation
 

Recently uploaded

Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computationsit20ad004
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...Suhani Kapoor
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 

Recently uploaded (20)

Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computation
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 

Intro to SQL by Google's Software Engineer

  • 1.
  • 2. Join 10,000+ Product Managers on
  • 4.
  • 5.
  • 6.
  • 7. Include @productschool and #prodmgmt at the end of your tweet Tweet to get a free ticket for our next Event!
  • 8.
  • 9.
  • 10. ● Hierarchical ○ 1960s IBM ○ Efficient but complex to implement History of Databases ● Relational ○ Logically-related entities (tables) ○ Dominant form of storage ○ Major players: Microsoft (Access, SQL Server), Oracle (Oracle, mySQL) ● NoSQL ○ Schemaless ○ Quick to implement ○ Easy to change on the fly ○ Most famous: MongoDB
  • 11. What is SQL Structured Query Language, the standard method of querying relational databases Developed in IBM's San Jose research laboratory in the 1970's. Standardised by ANSI in 1986 Using SQL, you can define ● what data you want to retrieve from the database ● what tables you want to get the data from ● what actions you want to perform on the data Most major commercial platforms have their own "flavor" of SQL (i.e. ANSI SQL+) but basic concepts common to all.
  • 12. Structure of relational database Tables and relationships
  • 13. SQL Standard Commands ● Select ● Insert ● Update ● Delete ● Create ● Drop
  • 14. Table Basics Column: ● Column name ● Data Type ● Attributes (length, format, etc) Rows ● Records
  • 15. Format of create table if you were to use optional constraints: create table "tablename" ("column1" "data type" [constraint], "column2" "data type" [constraint], "column3" "data type" [constraint]); [ ] = optional Note: You may have as many columns as you'd like, and the constraints are optional. CREATE Table
  • 16. CREATE Table Example: create table employee (first varchar(15), last varchar(20), age number(3), address varchar(30), city varchar(20), state varchar(20));
  • 17. DROP Table The drop table command is used to delete a table and all rows in the table. drop table "tablename" Example: drop table myemployees_ts0211; Note: To delete an entire table including all of its rows, issue the drop table command followed by the tablename. drop table is different from deleting all of the records in the table. Deleting all of the records in the table leaves the table including column and constraint information. Dropping the table removes the table definition as well as all of its rows.
  • 18. INSERT Statement The insert statement is used to insert or add a row of data into the table. insert into "tablename" (first_column,...last_column) values (first_value,...last_value); In the next example, the column name first will match up with the value 'Luke', and the column name state will match up with the value 'Georgia'.
  • 19. INSERT Statement Example: insert into employee (first, last, age, address, city, state) values ('Luke', 'Duke', 45, '2130 Boars Nest', 'Hazard Co', 'Georgia');
  • 20. UPDATE Statement The update statement is used to update or change records that match a specified criteria. update "tablename" set "columnname" = "newvalue" [,"nextcolumn" = "newvalue2"...] where "columnname" OPERATOR "value" [and|or "column" OPERATOR "value"];
  • 21. UPDATE Statement Examples: update phone_book set area_code = 623 where prefix = 979;
  • 22. DELETE Statement The delete statement is used to delete records or rows from the table. delete from "tablename" where "columnname" OPERATOR "value" [and|or "column" OPERATOR "value"]; Examples: delete from employee where lastname = 'May';
  • 23. Query Structure The SELECT statement is used to query the database and retrieve selected data that match the criteria that you specify. Every SQL query will have the same basic structure SELECT <- The fields you want to return FROM <- The tables the fields live in select "column1" [,"column2",etc] from "tablename"
  • 24. WHERE Clause The Where clause is used to restrict the rows returned by filtering on specific values SELECT FROM WHERE SELECT * FROM Employee WHERE jobCode = "SFI";
  • 25. JOIN tables Joins allow you to link data from two or more tables together into a single query result--from one single SELECT statement. SELECT "list-of-columns" FROM table1,table2 WHERE "search-condition(s)"
  • 26. JOIN tables Example: SELECT employee_info.employeeid, employee_info.lastname, employee_sales.commission FROM employee_info, employee_sales WHERE employee_info.employeeid = employee_sales.employeeid;
  • 27. Logical operators The AND operator can be used to join two or more conditions in the WHERE clause. Both sides of the AND condition must be true in order for the condition to be met and for those rows to be displayed. WHERE "condition1" AND "condition2" The OR operator can be used to join two or more conditions in the WHERE clause also. However, either side of the OR operator can be true and the condition will be met - hence, the rows will be displayed.
  • 28. Logical operators For example: SELECT employeeid, firstname, lastname, title, salary FROM employee_info WHERE salary >= 45000.00 AND title = 'Programmer';
  • 29. Calculations, functions, operators ● Standard math: +, -, /, * ● Math functions: ABS(), ROUND(), etc ● String function*: length (), substr (), upper (), etc ● IN, BETWEEN Example: SELECT lastname, round(salary) FROM emp WHERE lastname IN ('Hernandez', 'Jones', 'Roberts', 'Ruiz');
  • 30. Aggregative functions ● Max ● Min ● Sum ● Avg ● Count Example: SELECT AVG(salary) FROM employee WHERE title = 'Programmer'
  • 31. The GROUP BY clause will gather all of the rows together that contain data in the specified column(s) and will allow aggregate functions to be performed on the one or more columns. This can best be explained by an example: SELECT column1, SUM(column2) FROM "list-of-tables" GROUP BY "column-list" GROUP BY
  • 32. Let's say you would like to retrieve a list of the highest paid salaries in each dept: SELECT max(salary), dept FROM employee GROUP BY dept GROUP BY
  • 33. LIKE Operator Use this operator to perform string matching You can also use "%" to specify any number of random characters SELECT * FROM Employee WHERE Lower (lastname) LIKE '%imp%';
  • 34. Other SELECT options ● ORDER BY ● UNION ● LIMIT ● OUTER JOIN ● Sub-queries
  • 35. Table Security Commands: ● GRANT ● REVOKE Privileges: ● Read ● Write ● Owner Level: ● User ● Role/Group ● Schema
  • 37. Job roles Database architect/designer Database engineer Database administrator
  • 38. Industry-specific Popular flavors: ● Oracle - PL/SQL ● Microsoft - Transact-SQL Popular SQL Tools: ● Toad ● Access
  • 39.
  • 40. Tuesdays & Thursdays 6.30pm - 9pm Saturdays 9.30am - 3.30pm
  • 41. Mondays & Wednesdays 6.30pm - 9pm Saturdays 9.30am - 3.30pm