SlideShare a Scribd company logo
Proven Database for
IIOT Applications
SQLite
Learn the Music of Database
SESSION #1
SQLite Basics
www.inforepos.com
Agenda
• Install & Configuring SQLite
• DOT (.) Commands
• Accessing Database
• Basics of SQLite
• Data Types
• Operators
• DQL (SELECT)
• DML (INSERT, UPDATE, DELETE)
www.inforepos.com
Install /Configure SQLite
• Unzip both the folders “sqlite-dll-win64-x64-3170000.zip” & “sqlite-tools-
win32-x86-3170000.zip”. Merge all files and place them in one folder, say
“C:sqlite3”
• Add PATH parameter in system environment variables “C:sqlite3”
• Open command prompt and go to “C:sqlite3” run sqlite3.exe
There are two types of command interpreters in SQLite –
• Free-form SQL statement
• Recognized by SQLite program and expects SQL native words at the start of the statement
• Dot-form statement
• Identified by SQLite command-line program (sqlite3.exe) and starts with dot-command
www.inforepos.com
SQLite DOT(.) Commands
• A dot-command must begin with the "." at the left margin with no preceding
whitespace.
• The dot-command must be entirely contained on a single input line.
• A dot-command cannot occur in the middle of an ordinary SQL statement. In
other words, a dot-command cannot occur at a continuation prompt.
• Dot-commands do not recognize comments.
• Eg.
• .open
• .tables
• .output
• .schema …. many
www.inforepos.com
Accessing Database
OPEN, ATTACH, DETACH database
• ATTACH [DATABASE] filename AS database_name;
• sqlite3>sqlite3 sensorsdb.db
• sqlite3> .database
seq name file
--- --------------- ------------------------
0 main D:sqlite3sensorsdb.db
www.inforepos.com
Accessing Database
OPEN, ATTACH, DETACH database
• ATTACH customerdb AS custdb;
• ATTACH DATABASE 'smartihomedb.db' as 'ihomedb';
• ATTACH DATABASE 'smartihealthdb.db' as 'ihealthdb';
• sqlite> .database
seq name file
--- --------------- ------------------------
0 main D:/sqlite3/sensorsdb.db
2 custdb D:/sqlite3/customerdb.db
3 ihomedb D:/sqlite3/smartihomedb.db
4 ihealthdb D:/sqlite3/smartihealthdb.db
www.inforepos.com
OPEN, ATTACH, DETACH database
• DETACH DATABASE 'Alias-Name';
• sqlite3> detach DATABASE sensorsdb;
• sqlite3> .database
• .open ?FILENAME?
• sqlite3> .open D:/sqlite3/smartihomedb.db
• sqlite3> .databases
seq name file
--- --------------- ------------------------------------
0 main D:/sqlite3/smartihomedb.db
www.inforepos.com
SQLite Data Types
• A data type specifies a particular type of data, such as integer, floating-point,
Boolean etc.
• A data type also specifies the possible values for that type, the operations that
can be performed on that type and the way the values of that type are stored.
NULL The value is a NULL value.
INTEGER
The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on
the magnitude of the value.
REAL
The value is a floating point value, stored as an 8-byte IEEE floating point
number.
TEXT
The value is a text string, stored using the database encoding (UTF-8, UTF-
16BE or UTF-16LE)
BLOB The value is a blob of data, stored exactly as it was input.
www.inforepos.com
SQLite Data Types – Type Affinity Examples
Example Type names From The
CREATE TABLE Statement
or CAST Expression
Resulting Affinity
Rule Used To
Determine Affinity
INT
INTEGER
TINYINT
SMALLINT
MEDIUMINT
BIGINT
UNSIGNED BIG INT
INT2
INT8
INTEGER 1
CHARACTER(20)
VARCHAR(255)
VARYING CHARACTER(255)
NCHAR(55)
NATIVE CHARACTER(70)
NVARCHAR(100)
TEXT
CLOB
TEXT 2
BLOB
no datatype specified
NONE 3
REAL
DOUBLE
DOUBLE PRECISION
FLOAT
REAL 4
NUMERIC
DECIMAL(10,5)
BOOLEAN
DATE | DATETIME
NUMERIC 5
www.inforepos.com
SQLite Operators
• Arithmetic Operators
• Comparison Operators
• Boolean Operators
• LIKE Operator
• Between Operator
• IN and NOT IN Operators
• EXISTS Operator
www.inforepos.com
SQLite Operators : Highest to Lowest precedence
• ||
• * / %
• + -
• << >> & |
• < <= > >=
• = == != <> IS IS NOT IN LIKE GLOB MATCH REGEXP
• AND
• OR
• Supported unary prefix operators are these: - + ~ NOT
www.inforepos.com
DQL
SQLite SELECT Query
• The SELECT statement is used to make a simple query from a database or a
complicated query against some criteria. A SELECT statement does not make
any changes to the database / database objects.
• A query or SELECT statement is a command which gives instructions to a
database to produce certain information(s) from the table in its memory. The
SELECT command starts with the keyword SELECT.
SELECT [ALL | DISTINCT] result [FROM table-list]
[WHERE expr]
[GROUP BY expr-list]
[HAVING expr]
[compound-op select]*
[ORDER BY sort-expr-list]
[LIMIT integer [(OFFSET|,) integer]]
www.inforepos.com
DQL
SQLite SELECT Query
• Parameters
Clause Operation perform Input Value
WHERE Used to restrict Expression or condition
DISTINCT Used to restrict List of columns
FROM Joins List of tables
GROUP BY Used to restrict List of columns
ORDER BY List of columns
HAVING Used to restrict Expression or condition
LIMIT Used to restrict Integer value
OFFSET Used to restrict Integer value
www.inforepos.com
DQL
SQLite SELECT Query
Basic Arithmetic Operations without any Table:
• SELECT 6+15;
• SELECT 5*15;
• SELECT 5+2-3*4/6;
SELECT Operations Using Tables:
• SELECT * FROM sensor_list;
• SELECT street_address, city FROM locations; (Select required columns)
• SELECT region_name AS "Name of the Region" FROM regions; (Renaming column names)
• SELECT r.region_name FROM regions r; (Select using alias)
• SELECT * FROM locations LIMIT 10; (Limit records)
• SELECT * FROM locations LIMIT 4,5; (Using LIMIT - Skip & Limit records)
• SELECT * FROM locations LIMIT 5 OFFSET 4; (Using LIMIT & OFFSET - Skip & Limit records)
www.inforepos.com
DQL
SQLite SELECT Query
• WHERE is a powerful filter, a WHERE clause can let you take exactly the piece of
the data you want. It sets the conditions for the SELECT, and the query will
return only those rows that match the conditions.
• WHERE clause with operators (Arithmetic, Boolean & Comparision)
• SELECT * FROM locations WHERE country_id='CA';
The following operators can be used with WHERE clause:
• operator description
• = Equal
• <> Not equal*
• > Greater than
• < Less than
• >= Greater than or equal
• <= Less than or equal
• SELECT * FROM agents WHERE commission<.15;
www.inforepos.com
DQL
SQLite SELECT Query
• WHERE clause with keywords
• DISTINCT
• AND and OR
• ORDER BY column_name(s) ACS | DESC
• GROUP BY
• GROUO BY and ORDER BY
• GROUO BY column_name HAVING
• GROUO BY column_name HAVING expression ORDER BY
• Please follow the notes below for detailed examples.
www.inforepos.com
DML
SQLite INSERT INTO
The INSERT command is used to create new rows in the specified table. The INSERT works on a
single table, and can both insert one row at a time or many rows at once using a SELECT
command. This statement is a part of the SQL Data Manipulation Language, DML.
• INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] VALUES
(value-list);
• INSERT INTO sensor_list (sensor_id, sensor_name, sensor_type, sensor_usage) VALUES
(‘TMP01’, ‘LM35’, ‘Temperature’, ‘Industrial’);
• INSERT INTO sensor_list (sensor_id, sensor_name, sensor_type) VALUES (‘TMP02’, ‘DHT11’,
‘Temperature’);
• INSERT INTO sensor_list VALUES (‘TMP03’, ‘DHT22’, ‘Temperature’, ‘Regular’);
• INSERT INTO sensor_list (sensor_id, sensor_name) VALUES (‘TMP005’, ‘LM335’);
• INSERT OR REPLACE INTO sensor_list (sensor_id, sensor_name, sensor_type, sensor_usage)
VALUES (‘TMP01’, ‘LM35’, ‘Temperature’, ‘Industrial/Regular’);
www.inforepos.com
DML
SQLite UPDATE
The UPDATE command is used to change the existing values to one or more columns of existing rows in a table. This
command can update more than one rows at a time, but all of the rows must be part of the same table.
• UPDATE table_name SET column_name=new_value [, ...] WHERE expression
• UPDATE sensor_list SET sensor_usage='Industrial/Regular' WHERE sensor_usage='Regular';
• UPDATE sensor_list SET sensor_name=(SELECT sensor_name FROM sensor_master WHERE sensor_id =
sensor_list_id);
• Eg. UPDATE sensor_list SET sensor_name=(
SELECT sensor_master.sensor_name
FROM sensor_master
WHERE sensor_list.sensor_list_id=sensor_master.sensor_id),
type_usage=(
SELECT sensor_master.sensor_type || sensor_list.sensor_usage
FROM sensor_master
WHERE sensor_list.sensor_list_id=sensor_master.sensor_id);
www.inforepos.com
DML
SQLite DELETE
• The DELETE command is used to delete or remove one or more rows from a
single table. When deleting all rows from the table this will not delete the
structure of the table, it will remain same only the records are deleted. To
delete a table from the database the DROP command is used.
• DELETE FROM [database-name .] table-name [WHERE expr]
• DELETE FROM sensor_list WHERE sensor_id=‘DHT11’;
• DELETE FROM sensor_test;
www.inforepos.com
Correct MIX … Current GEN
Python
PHP
JULIA
R
Web / Mobile
Programming
SQLite Perfect
Programming
THANK YOU
For All Queries : info@inforepos.com
Proven Database for
IIOT Applications
SQLite
Learn the Music of Database
IR SQLite Session #1
Ad

More Related Content

What's hot (19)

Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Execution
webhostingguy
 
Java class 8
Java class 8Java class 8
Java class 8
Edureka!
 
Oracle training in hyderabad
Oracle training in hyderabadOracle training in hyderabad
Oracle training in hyderabad
Kelly Technologies
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
Alex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
Jayesh Bhoyar
 
plsql Les08
plsql Les08 plsql Les08
plsql Les08
sasa_eldoby
 
Solr workshop
Solr workshopSolr workshop
Solr workshop
Yasas Senarath
 
Brief introduction of Slick
Brief introduction of SlickBrief introduction of Slick
Brief introduction of Slick
Knoldus Inc.
 
Apache Solr + ajax solr
Apache Solr + ajax solrApache Solr + ajax solr
Apache Solr + ajax solr
Net7
 
Mentor Your Indexes
Mentor Your IndexesMentor Your Indexes
Mentor Your Indexes
Karwin Software Solutions LLC
 
Stored procedure
Stored procedureStored procedure
Stored procedure
baabtra.com - No. 1 supplier of quality freshers
 
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
 
Mastering solr
Mastering solrMastering solr
Mastering solr
jurcello
 
MySQL for beginners
MySQL for beginnersMySQL for beginners
MySQL for beginners
Saeid Zebardast
 
8. sql
8. sql8. sql
8. sql
khoahuy82
 
plsql Les09
 plsql Les09 plsql Les09
plsql Les09
sasa_eldoby
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
Jonathan Levin
 
MYSQL
MYSQLMYSQL
MYSQL
Ankush Jain
 
Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Execution
webhostingguy
 
Java class 8
Java class 8Java class 8
Java class 8
Edureka!
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
Alex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
Jayesh Bhoyar
 
Brief introduction of Slick
Brief introduction of SlickBrief introduction of Slick
Brief introduction of Slick
Knoldus Inc.
 
Apache Solr + ajax solr
Apache Solr + ajax solrApache Solr + ajax solr
Apache Solr + ajax solr
Net7
 
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
 
Mastering solr
Mastering solrMastering solr
Mastering solr
jurcello
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
Jonathan Levin
 

Similar to IR SQLite Session #1 (20)

Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
MrsSavitaKumbhare
 
HPD SQL Training - Beginner - 20220916.pptx
HPD SQL Training - Beginner - 20220916.pptxHPD SQL Training - Beginner - 20220916.pptx
HPD SQL Training - Beginner - 20220916.pptx
PatriceRochon1
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Less07 schema
Less07 schemaLess07 schema
Less07 schema
Imran Ali
 
The SQL Query Language: Simple SELECT Commands
The SQL Query Language: Simple SELECT CommandsThe SQL Query Language: Simple SELECT Commands
The SQL Query Language: Simple SELECT Commands
teamspeer05
 
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
 
DBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx gggggggggggggggggggggggDBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
Dbms &amp; oracle
Dbms &amp; oracleDbms &amp; oracle
Dbms &amp; oracle
J VijayaRaghavan
 
MS SQL Server
MS SQL ServerMS SQL Server
MS SQL Server
Md. Mahedee Hasan
 
Lecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptxLecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
Using Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptxUsing Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
Chhom Karath
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
 
DP080_Lecture_1 SQL lecture document .pdf
DP080_Lecture_1 SQL lecture document .pdfDP080_Lecture_1 SQL lecture document .pdf
DP080_Lecture_1 SQL lecture document .pdf
MinhTran394436
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
metsarin
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
Sachidananda M H
 
Structures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdfStructures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdf
tipurple7989
 
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
nimsarabuwaa2002
 
HPD SQL Training - Beginner - 20220916.pptx
HPD SQL Training - Beginner - 20220916.pptxHPD SQL Training - Beginner - 20220916.pptx
HPD SQL Training - Beginner - 20220916.pptx
PatriceRochon1
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
TamiratDejene1
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Less07 schema
Less07 schemaLess07 schema
Less07 schema
Imran Ali
 
The SQL Query Language: Simple SELECT Commands
The SQL Query Language: Simple SELECT CommandsThe SQL Query Language: Simple SELECT Commands
The SQL Query Language: Simple SELECT Commands
teamspeer05
 
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
 
DBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx gggggggggggggggggggggggDBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
Lecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptxLecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
Using Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptxUsing Basic Structured Query Language lo1.pptx
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
Chhom Karath
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
 
DP080_Lecture_1 SQL lecture document .pdf
DP080_Lecture_1 SQL lecture document .pdfDP080_Lecture_1 SQL lecture document .pdf
DP080_Lecture_1 SQL lecture document .pdf
MinhTran394436
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
metsarin
 
Structures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdfStructures query language ___PPT (1).pdf
Structures query language ___PPT (1).pdf
tipurple7989
 
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
nimsarabuwaa2002
 
Ad

Recently uploaded (20)

SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Ad

IR SQLite Session #1

  • 1. Proven Database for IIOT Applications SQLite Learn the Music of Database
  • 3. www.inforepos.com Agenda • Install & Configuring SQLite • DOT (.) Commands • Accessing Database • Basics of SQLite • Data Types • Operators • DQL (SELECT) • DML (INSERT, UPDATE, DELETE)
  • 4. www.inforepos.com Install /Configure SQLite • Unzip both the folders “sqlite-dll-win64-x64-3170000.zip” & “sqlite-tools- win32-x86-3170000.zip”. Merge all files and place them in one folder, say “C:sqlite3” • Add PATH parameter in system environment variables “C:sqlite3” • Open command prompt and go to “C:sqlite3” run sqlite3.exe There are two types of command interpreters in SQLite – • Free-form SQL statement • Recognized by SQLite program and expects SQL native words at the start of the statement • Dot-form statement • Identified by SQLite command-line program (sqlite3.exe) and starts with dot-command
  • 5. www.inforepos.com SQLite DOT(.) Commands • A dot-command must begin with the "." at the left margin with no preceding whitespace. • The dot-command must be entirely contained on a single input line. • A dot-command cannot occur in the middle of an ordinary SQL statement. In other words, a dot-command cannot occur at a continuation prompt. • Dot-commands do not recognize comments. • Eg. • .open • .tables • .output • .schema …. many
  • 6. www.inforepos.com Accessing Database OPEN, ATTACH, DETACH database • ATTACH [DATABASE] filename AS database_name; • sqlite3>sqlite3 sensorsdb.db • sqlite3> .database seq name file --- --------------- ------------------------ 0 main D:sqlite3sensorsdb.db
  • 7. www.inforepos.com Accessing Database OPEN, ATTACH, DETACH database • ATTACH customerdb AS custdb; • ATTACH DATABASE 'smartihomedb.db' as 'ihomedb'; • ATTACH DATABASE 'smartihealthdb.db' as 'ihealthdb'; • sqlite> .database seq name file --- --------------- ------------------------ 0 main D:/sqlite3/sensorsdb.db 2 custdb D:/sqlite3/customerdb.db 3 ihomedb D:/sqlite3/smartihomedb.db 4 ihealthdb D:/sqlite3/smartihealthdb.db
  • 8. www.inforepos.com OPEN, ATTACH, DETACH database • DETACH DATABASE 'Alias-Name'; • sqlite3> detach DATABASE sensorsdb; • sqlite3> .database • .open ?FILENAME? • sqlite3> .open D:/sqlite3/smartihomedb.db • sqlite3> .databases seq name file --- --------------- ------------------------------------ 0 main D:/sqlite3/smartihomedb.db
  • 9. www.inforepos.com SQLite Data Types • A data type specifies a particular type of data, such as integer, floating-point, Boolean etc. • A data type also specifies the possible values for that type, the operations that can be performed on that type and the way the values of that type are stored. NULL The value is a NULL value. INTEGER The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value. REAL The value is a floating point value, stored as an 8-byte IEEE floating point number. TEXT The value is a text string, stored using the database encoding (UTF-8, UTF- 16BE or UTF-16LE) BLOB The value is a blob of data, stored exactly as it was input.
  • 10. www.inforepos.com SQLite Data Types – Type Affinity Examples Example Type names From The CREATE TABLE Statement or CAST Expression Resulting Affinity Rule Used To Determine Affinity INT INTEGER TINYINT SMALLINT MEDIUMINT BIGINT UNSIGNED BIG INT INT2 INT8 INTEGER 1 CHARACTER(20) VARCHAR(255) VARYING CHARACTER(255) NCHAR(55) NATIVE CHARACTER(70) NVARCHAR(100) TEXT CLOB TEXT 2 BLOB no datatype specified NONE 3 REAL DOUBLE DOUBLE PRECISION FLOAT REAL 4 NUMERIC DECIMAL(10,5) BOOLEAN DATE | DATETIME NUMERIC 5
  • 11. www.inforepos.com SQLite Operators • Arithmetic Operators • Comparison Operators • Boolean Operators • LIKE Operator • Between Operator • IN and NOT IN Operators • EXISTS Operator
  • 12. www.inforepos.com SQLite Operators : Highest to Lowest precedence • || • * / % • + - • << >> & | • < <= > >= • = == != <> IS IS NOT IN LIKE GLOB MATCH REGEXP • AND • OR • Supported unary prefix operators are these: - + ~ NOT
  • 13. www.inforepos.com DQL SQLite SELECT Query • The SELECT statement is used to make a simple query from a database or a complicated query against some criteria. A SELECT statement does not make any changes to the database / database objects. • A query or SELECT statement is a command which gives instructions to a database to produce certain information(s) from the table in its memory. The SELECT command starts with the keyword SELECT. SELECT [ALL | DISTINCT] result [FROM table-list] [WHERE expr] [GROUP BY expr-list] [HAVING expr] [compound-op select]* [ORDER BY sort-expr-list] [LIMIT integer [(OFFSET|,) integer]]
  • 14. www.inforepos.com DQL SQLite SELECT Query • Parameters Clause Operation perform Input Value WHERE Used to restrict Expression or condition DISTINCT Used to restrict List of columns FROM Joins List of tables GROUP BY Used to restrict List of columns ORDER BY List of columns HAVING Used to restrict Expression or condition LIMIT Used to restrict Integer value OFFSET Used to restrict Integer value
  • 15. www.inforepos.com DQL SQLite SELECT Query Basic Arithmetic Operations without any Table: • SELECT 6+15; • SELECT 5*15; • SELECT 5+2-3*4/6; SELECT Operations Using Tables: • SELECT * FROM sensor_list; • SELECT street_address, city FROM locations; (Select required columns) • SELECT region_name AS "Name of the Region" FROM regions; (Renaming column names) • SELECT r.region_name FROM regions r; (Select using alias) • SELECT * FROM locations LIMIT 10; (Limit records) • SELECT * FROM locations LIMIT 4,5; (Using LIMIT - Skip & Limit records) • SELECT * FROM locations LIMIT 5 OFFSET 4; (Using LIMIT & OFFSET - Skip & Limit records)
  • 16. www.inforepos.com DQL SQLite SELECT Query • WHERE is a powerful filter, a WHERE clause can let you take exactly the piece of the data you want. It sets the conditions for the SELECT, and the query will return only those rows that match the conditions. • WHERE clause with operators (Arithmetic, Boolean & Comparision) • SELECT * FROM locations WHERE country_id='CA'; The following operators can be used with WHERE clause: • operator description • = Equal • <> Not equal* • > Greater than • < Less than • >= Greater than or equal • <= Less than or equal • SELECT * FROM agents WHERE commission<.15;
  • 17. www.inforepos.com DQL SQLite SELECT Query • WHERE clause with keywords • DISTINCT • AND and OR • ORDER BY column_name(s) ACS | DESC • GROUP BY • GROUO BY and ORDER BY • GROUO BY column_name HAVING • GROUO BY column_name HAVING expression ORDER BY • Please follow the notes below for detailed examples.
  • 18. www.inforepos.com DML SQLite INSERT INTO The INSERT command is used to create new rows in the specified table. The INSERT works on a single table, and can both insert one row at a time or many rows at once using a SELECT command. This statement is a part of the SQL Data Manipulation Language, DML. • INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] VALUES (value-list); • INSERT INTO sensor_list (sensor_id, sensor_name, sensor_type, sensor_usage) VALUES (‘TMP01’, ‘LM35’, ‘Temperature’, ‘Industrial’); • INSERT INTO sensor_list (sensor_id, sensor_name, sensor_type) VALUES (‘TMP02’, ‘DHT11’, ‘Temperature’); • INSERT INTO sensor_list VALUES (‘TMP03’, ‘DHT22’, ‘Temperature’, ‘Regular’); • INSERT INTO sensor_list (sensor_id, sensor_name) VALUES (‘TMP005’, ‘LM335’); • INSERT OR REPLACE INTO sensor_list (sensor_id, sensor_name, sensor_type, sensor_usage) VALUES (‘TMP01’, ‘LM35’, ‘Temperature’, ‘Industrial/Regular’);
  • 19. www.inforepos.com DML SQLite UPDATE The UPDATE command is used to change the existing values to one or more columns of existing rows in a table. This command can update more than one rows at a time, but all of the rows must be part of the same table. • UPDATE table_name SET column_name=new_value [, ...] WHERE expression • UPDATE sensor_list SET sensor_usage='Industrial/Regular' WHERE sensor_usage='Regular'; • UPDATE sensor_list SET sensor_name=(SELECT sensor_name FROM sensor_master WHERE sensor_id = sensor_list_id); • Eg. UPDATE sensor_list SET sensor_name=( SELECT sensor_master.sensor_name FROM sensor_master WHERE sensor_list.sensor_list_id=sensor_master.sensor_id), type_usage=( SELECT sensor_master.sensor_type || sensor_list.sensor_usage FROM sensor_master WHERE sensor_list.sensor_list_id=sensor_master.sensor_id);
  • 20. www.inforepos.com DML SQLite DELETE • The DELETE command is used to delete or remove one or more rows from a single table. When deleting all rows from the table this will not delete the structure of the table, it will remain same only the records are deleted. To delete a table from the database the DROP command is used. • DELETE FROM [database-name .] table-name [WHERE expr] • DELETE FROM sensor_list WHERE sensor_id=‘DHT11’; • DELETE FROM sensor_test;
  • 21. www.inforepos.com Correct MIX … Current GEN Python PHP JULIA R Web / Mobile Programming SQLite Perfect Programming
  • 23. Proven Database for IIOT Applications SQLite Learn the Music of Database