SlideShare a Scribd company logo
Introduction to SQL
A little bit of about our group and me
 Research Computing services, visit http://rcs.bu.edu for more info
 Consulting
 Teaching
 Graphics
 Optimization
 Experience:
 Database programming
 Software development
Tutorial Outlines
 What is SQL
 SQL History
 Terminology By Examples
 SQL Syntax By Examples
 SQL Category
 Small yet worth noting
points
 Tutorial sample db overview
 Schema of the sample db
 Data of the sample db
 Hands on Tutorial Setup
SCC Research Data Metrics
3
03/18/2025
What is SQL ( ‘Structured Query Language’ )?
 SQL stands for ‘Structured Query Language’
 SQL is domain-specific language, NOT a general programming language
 SQL is specialized to handle ‘structured data’ that follows relational
model – data that incorporates relations among entities and variables.
 Used to interact with relational databases to manage data: create,
populate, modify, or destroy data. Also can manage data access
SQL is a standard language
 Nevertheless, SQL is a ‘language’. It has its language specification – a set
of language elements, rules and syntax
 Rigid and structural:
 Since the underlying data model is structural, SQL is very ‘structural’
too - requiring rigid predefined schema as compared with those of
‘noSQL’
 Syntax and grammar is also strict
 SQL specific features – triggers, stored procedures
History of SQL
 First developed in 1970s by two scientists at IBM following a theory of
‘relational algebra’ by Edgar F. Codd, who was also an IBM scientist.
 First commercial implementation of SQL-based RDMBS was Oracle’s V2.
 First adopted by ANSI in 1986, and ISO in 1987 as standard.
 The latest version of the SQL standard is from 2016. There have been
very many versions in between.
 Though standardized, this does not necessarily mean SQL code can be
migrated between different RDBMS seamlessly (Why?)
Terminology - Structure
 Database
 Table
 Column
 Row
 Relation
 Primary key
 Foreign key
Take sample_ecomm.db as an Example - schema
Customer
Terminology - SQL Language Elements
 Clause
 Statement
 Query
 Function
 Stored Procedure
 Predicate
 Expression
 Keyword
 Identifier
A SQL Example From Wikipedia
A chart showing several of the SQL language elements that compose a single statement
(source: https://wikimedia.org/api/rest_v1/media/math/render/svg/b83ad563285f7b0ebb325226d91f25ca0bffa7cd )
Our Own Query Example
SELECT FirstName, LastName -- SELECT clause
FROM Customer -- FROM clause
WHERE Id=1 – WHERE Clause
Clean way:
SELECT FirstName, LastName FROM Customer WHERE Id=1
Complete Query Statement Syntax – Order Matters !
Clause Priority Required?
SELECT <columns> 5. Mandatory 
FROM <table> 1. Mandatory 
WHERE <predicate on rows> 2. Optional 
GROUP BY <columns> 3. Optional 
HAVING <predicate on groups> 4. Optional, work with GROUP BY
ORDER BY <columns> 6. Optional 
OFFSET 7. Optional
FETCH FIRST 8. Optional
SQL Category
1. Data Query Language (DQL) - used to query data
2. Data Manipulation Language (DML) – used to create/modify/destroy data
3. Data Definition Language (DDL) – used to define database schema
4. Data Control Language (DCL) – used for security and access control
Most Important SQL Statements
 SELECT - extracts data from a database (DQL)
 UPDATE - updates data in a database (DML)
 DELETE - deletes data from a database (DML)
 INSERT - inserts new data into a database (DML)
 CREATE DATABASE - creates a new database (DDL)
 CREATE TABLE - creates a new table (DDL)
 DROP TABLE - deletes a table (DDL)
SCC Research Data Metrics
15
03/18/2025
Attention Please !
1. SQL keywords and table/column names are NOT case sensitive: ‘select’ and ‘SELECT’ are the
same
2. The values stored in a table can be case-sensitive – depending on configuration
3. Usually single quotes (‘’) or double quotes (“”) don’t matter, but could be configured otherwise
4. Semicolon ‘;’ is the standard way to separate SQL statements. It can be required in some
DBMS to end each statement with a ‘;’ even after a single statement
5. Comments can be used to make SQL more readable. Usually ‘--’ for single line comment, and
‘/*’ and ’*/’ for multiline comments. Add ‘--’ at the beginning to indicate a comment line
6. Standard is NOT STANDARD – none of SQL standard is fully implemented by all vendors. Pay
attention to the differences that each vendor’s implementation have from the SQL ‘standard’
In this Tutorial
 We will use all upper-case for all keywords
 We will use double quotes “” to indicate strings
 We will end each SQL statement with a ‘;’
Keywords Used in this Tutorial
 SELECT
 *
 FROM
 ORDER BY
 ASC
 DESC
 AND
 OR
 NOT
 WHERE
 LIMIT
 DISTINCT
 AS
 GROUP BY
 INNER JOIN
 ON
 !=
 INSERT
 UPDATE
 DELETE
 CREATE
 TABLE
 LIKE
 %
 INTO
 VALUES
 DROP
Functions Used in this Tutorial
 COUNT()
 MIN()
 MAX()
 AVG()
 SUM()
 REPLACE()
Hands On Demo
Basic SELECT + WHERE
Aggregation SELECT + GROUP BY
JOIN SELECT + JOIN
WRITE Queries INSERT/UPDATE/DELETE
Tutorial Tools and Files Overview
DB GUI : DBBrowser for SQLite
- sufficient yet simple/clean interface for demo purpose
- SQLite engine is already embedded in this tool
Sample DB: sample_ecomm.db
- a simple example e-commerce db. We will explore it a bit more …
sample_ecomm.db preview
sample_ecomm.db preview – Customer
sample_ecomm.db preview – Supplier
sample_ecomm.db preview – Product
sample_ecomm.db preview – OrderHead
sample_ecomm.db preview – OrderItem
Customer
OrderHead
OrderItem
Product
Supplier
Tutorial Setup
All the tutorial files can be accessed from:
http://www.bu.edu/tech/support/research/training-consulting/live-tutorials/
Tutorial Setup Instruction is at the following subdirectory:
Intro2SQLpresentationinstr_tutorialSetup_vdi.docx
Tutorial Software - using BU’s Common Lab Apps. It can be accessed at:
https://rdweb.wvd.microsoft.com/arm/webclient/index.html
Some Extra Info:
 The following is some extra information you may be
interested in:
SCC Research Data Metrics
34
03/18/2025
GUI tool is not the only way!
A GUI tool like DB Browser is not the only way to
access databases!
There could be many other ways! The following are
the two ways:
SQLite Programming Interface - Python
SQLite Programming Interface - R
Useful Resources:
 This tutorial materials:
http://www.bu.edu/tech/support/research/training-consulting/live-tutorials/
 W3Schools SQL tutorial: https://www.w3schools.com/sql/
 Khan Academy:
https://www.khanacademy.org/computing/computer-programming/sql
SCC Research Data Metrics
38
03/18/2025
Ad

Recommended

slides about : Introduction_to_SQL.pptx
slides about : Introduction_to_SQL.pptx
DrMarwaElsherif
 
Introduction to SQL
Introduction to SQL
MLG College of Learning, Inc
 
CSE311_IAH_Slide06_SQL _Retrival_Queries.pptx
CSE311_IAH_Slide06_SQL _Retrival_Queries.pptx
noshinnawar31
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
Lab
Lab
neelam_rawat
 
SQL.pptx
SQL.pptx
Satyam Sharma
 
SQL .pptx
SQL .pptx
SityogInstituteOfTec1
 
SQL_NOTES.pdf
SQL_NOTES.pdf
AnshumanDwivedi14
 
Structures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdf
tipurple7989
 
Structured query language
Structured query language
Rashid Ansari
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
sql notes Provideby AGN HUB Tech & It Solutions
sql notes Provideby AGN HUB Tech & It Solutions
mohanagn2244
 
Using Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
MySQL intro
MySQL intro
David Rajah Selvaraj
 
MySQL intro
MySQL intro
David Rajah Selvaraj
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
Introduction to sql new
Introduction to sql new
SANTOSH RATH
 
Database management system unit 1 Bca 2-semester notes
Database management system unit 1 Bca 2-semester notes
n32310997
 
Sql a practical_introduction
Sql a practical_introduction
investnow
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
Zespół Szkół nr 26
 
SQL commands powerpoint presentation. Ppt
SQL commands powerpoint presentation. Ppt
umadevikakarlapudi
 
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
aayushkrish007
 
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
aayushkrish007
 
An intoduction to sql and its components
An intoduction to sql and its components
Monika Jain DAIMSR
 
Structured query language presentation.pptx
Structured query language presentation.pptx
rinku raphy
 
SQL: Structured Query Language
SQL: Structured Query Language
Rohit Bisht
 
Structure query language, database course
Structure query language, database course
yunussufyan2024
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
 

More Related Content

Similar to introduction to SQL query language beginner.ppt (20)

Structures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdf
tipurple7989
 
Structured query language
Structured query language
Rashid Ansari
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
sql notes Provideby AGN HUB Tech & It Solutions
sql notes Provideby AGN HUB Tech & It Solutions
mohanagn2244
 
Using Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
MySQL intro
MySQL intro
David Rajah Selvaraj
 
MySQL intro
MySQL intro
David Rajah Selvaraj
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
Introduction to sql new
Introduction to sql new
SANTOSH RATH
 
Database management system unit 1 Bca 2-semester notes
Database management system unit 1 Bca 2-semester notes
n32310997
 
Sql a practical_introduction
Sql a practical_introduction
investnow
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
Zespół Szkół nr 26
 
SQL commands powerpoint presentation. Ppt
SQL commands powerpoint presentation. Ppt
umadevikakarlapudi
 
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
aayushkrish007
 
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
aayushkrish007
 
An intoduction to sql and its components
An intoduction to sql and its components
Monika Jain DAIMSR
 
Structured query language presentation.pptx
Structured query language presentation.pptx
rinku raphy
 
SQL: Structured Query Language
SQL: Structured Query Language
Rohit Bisht
 
Structure query language, database course
Structure query language, database course
yunussufyan2024
 
Structures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdf
tipurple7989
 
Structured query language
Structured query language
Rashid Ansari
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
sql notes Provideby AGN HUB Tech & It Solutions
sql notes Provideby AGN HUB Tech & It Solutions
mohanagn2244
 
Using Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
Introduction to sql new
Introduction to sql new
SANTOSH RATH
 
Database management system unit 1 Bca 2-semester notes
Database management system unit 1 Bca 2-semester notes
n32310997
 
Sql a practical_introduction
Sql a practical_introduction
investnow
 
SQL commands powerpoint presentation. Ppt
SQL commands powerpoint presentation. Ppt
umadevikakarlapudi
 
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
aayushkrish007
 
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
aayushkrish007
 
An intoduction to sql and its components
An intoduction to sql and its components
Monika Jain DAIMSR
 
Structured query language presentation.pptx
Structured query language presentation.pptx
rinku raphy
 
SQL: Structured Query Language
SQL: Structured Query Language
Rohit Bisht
 
Structure query language, database course
Structure query language, database course
yunussufyan2024
 

Recently uploaded (20)

IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Building Geospatial Data Warehouse for GIS by GIS with FME
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Microsoft-365-Administrator-s-Guide1.pdf
Microsoft-365-Administrator-s-Guide1.pdf
mazharatknl
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
ElectraSuite_Prsentation(online voting system).pptx
ElectraSuite_Prsentation(online voting system).pptx
mrsinankhan01
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Building Geospatial Data Warehouse for GIS by GIS with FME
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Microsoft-365-Administrator-s-Guide1.pdf
Microsoft-365-Administrator-s-Guide1.pdf
mazharatknl
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
ElectraSuite_Prsentation(online voting system).pptx
ElectraSuite_Prsentation(online voting system).pptx
mrsinankhan01
 
Ad

introduction to SQL query language beginner.ppt

  • 2. A little bit of about our group and me  Research Computing services, visit http://rcs.bu.edu for more info  Consulting  Teaching  Graphics  Optimization  Experience:  Database programming  Software development
  • 3. Tutorial Outlines  What is SQL  SQL History  Terminology By Examples  SQL Syntax By Examples  SQL Category  Small yet worth noting points  Tutorial sample db overview  Schema of the sample db  Data of the sample db  Hands on Tutorial Setup SCC Research Data Metrics 3 03/18/2025
  • 4. What is SQL ( ‘Structured Query Language’ )?  SQL stands for ‘Structured Query Language’  SQL is domain-specific language, NOT a general programming language  SQL is specialized to handle ‘structured data’ that follows relational model – data that incorporates relations among entities and variables.  Used to interact with relational databases to manage data: create, populate, modify, or destroy data. Also can manage data access
  • 5. SQL is a standard language  Nevertheless, SQL is a ‘language’. It has its language specification – a set of language elements, rules and syntax  Rigid and structural:  Since the underlying data model is structural, SQL is very ‘structural’ too - requiring rigid predefined schema as compared with those of ‘noSQL’  Syntax and grammar is also strict  SQL specific features – triggers, stored procedures
  • 6. History of SQL  First developed in 1970s by two scientists at IBM following a theory of ‘relational algebra’ by Edgar F. Codd, who was also an IBM scientist.  First commercial implementation of SQL-based RDMBS was Oracle’s V2.  First adopted by ANSI in 1986, and ISO in 1987 as standard.  The latest version of the SQL standard is from 2016. There have been very many versions in between.  Though standardized, this does not necessarily mean SQL code can be migrated between different RDBMS seamlessly (Why?)
  • 7. Terminology - Structure  Database  Table  Column  Row  Relation  Primary key  Foreign key
  • 8. Take sample_ecomm.db as an Example - schema
  • 10. Terminology - SQL Language Elements  Clause  Statement  Query  Function  Stored Procedure  Predicate  Expression  Keyword  Identifier
  • 11. A SQL Example From Wikipedia A chart showing several of the SQL language elements that compose a single statement (source: https://wikimedia.org/api/rest_v1/media/math/render/svg/b83ad563285f7b0ebb325226d91f25ca0bffa7cd )
  • 12. Our Own Query Example SELECT FirstName, LastName -- SELECT clause FROM Customer -- FROM clause WHERE Id=1 – WHERE Clause Clean way: SELECT FirstName, LastName FROM Customer WHERE Id=1
  • 13. Complete Query Statement Syntax – Order Matters ! Clause Priority Required? SELECT <columns> 5. Mandatory  FROM <table> 1. Mandatory  WHERE <predicate on rows> 2. Optional  GROUP BY <columns> 3. Optional  HAVING <predicate on groups> 4. Optional, work with GROUP BY ORDER BY <columns> 6. Optional  OFFSET 7. Optional FETCH FIRST 8. Optional
  • 14. SQL Category 1. Data Query Language (DQL) - used to query data 2. Data Manipulation Language (DML) – used to create/modify/destroy data 3. Data Definition Language (DDL) – used to define database schema 4. Data Control Language (DCL) – used for security and access control
  • 15. Most Important SQL Statements  SELECT - extracts data from a database (DQL)  UPDATE - updates data in a database (DML)  DELETE - deletes data from a database (DML)  INSERT - inserts new data into a database (DML)  CREATE DATABASE - creates a new database (DDL)  CREATE TABLE - creates a new table (DDL)  DROP TABLE - deletes a table (DDL) SCC Research Data Metrics 15 03/18/2025
  • 16. Attention Please ! 1. SQL keywords and table/column names are NOT case sensitive: ‘select’ and ‘SELECT’ are the same 2. The values stored in a table can be case-sensitive – depending on configuration 3. Usually single quotes (‘’) or double quotes (“”) don’t matter, but could be configured otherwise 4. Semicolon ‘;’ is the standard way to separate SQL statements. It can be required in some DBMS to end each statement with a ‘;’ even after a single statement 5. Comments can be used to make SQL more readable. Usually ‘--’ for single line comment, and ‘/*’ and ’*/’ for multiline comments. Add ‘--’ at the beginning to indicate a comment line 6. Standard is NOT STANDARD – none of SQL standard is fully implemented by all vendors. Pay attention to the differences that each vendor’s implementation have from the SQL ‘standard’
  • 17. In this Tutorial  We will use all upper-case for all keywords  We will use double quotes “” to indicate strings  We will end each SQL statement with a ‘;’
  • 18. Keywords Used in this Tutorial  SELECT  *  FROM  ORDER BY  ASC  DESC  AND  OR  NOT  WHERE  LIMIT  DISTINCT  AS  GROUP BY  INNER JOIN  ON  !=  INSERT  UPDATE  DELETE  CREATE  TABLE  LIKE  %  INTO  VALUES  DROP
  • 19. Functions Used in this Tutorial  COUNT()  MIN()  MAX()  AVG()  SUM()  REPLACE()
  • 20. Hands On Demo Basic SELECT + WHERE Aggregation SELECT + GROUP BY JOIN SELECT + JOIN WRITE Queries INSERT/UPDATE/DELETE
  • 21. Tutorial Tools and Files Overview DB GUI : DBBrowser for SQLite - sufficient yet simple/clean interface for demo purpose - SQLite engine is already embedded in this tool Sample DB: sample_ecomm.db - a simple example e-commerce db. We will explore it a bit more …
  • 33. Tutorial Setup All the tutorial files can be accessed from: http://www.bu.edu/tech/support/research/training-consulting/live-tutorials/ Tutorial Setup Instruction is at the following subdirectory: Intro2SQLpresentationinstr_tutorialSetup_vdi.docx Tutorial Software - using BU’s Common Lab Apps. It can be accessed at: https://rdweb.wvd.microsoft.com/arm/webclient/index.html
  • 34. Some Extra Info:  The following is some extra information you may be interested in: SCC Research Data Metrics 34 03/18/2025
  • 35. GUI tool is not the only way! A GUI tool like DB Browser is not the only way to access databases! There could be many other ways! The following are the two ways:
  • 38. Useful Resources:  This tutorial materials: http://www.bu.edu/tech/support/research/training-consulting/live-tutorials/  W3Schools SQL tutorial: https://www.w3schools.com/sql/  Khan Academy: https://www.khanacademy.org/computing/computer-programming/sql SCC Research Data Metrics 38 03/18/2025

Editor's Notes

  • #8: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #9: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #21: SQLite is a serverless, in-memory db engine. It doesn’t have its GUI by itself. Many other companies step up to fill the blank. DBBrowser is one of them. Almost all major database engines provide programming APIs for application developers to get access to database through programming interfaces.
  • #22: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #28: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #29: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #30: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #31: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #32: When write SQL, you must be very clear about the underlying table structure. Here is the ERD for sample_ecomm.db. It shows the overall structure and relationships of tables it has.
  • #35: SQLite is a serverless, in-memory db engine. It doesn’t have its GUI by itself. Many other companies step up to fill the blank. DBBrowser is one of them. Almost all major database engines provide programming APIs for application developers to get access to database through programming interfaces.