About this ebook
SQLite is a very lightweight database, with no installation required, zero configuration, and no server required. SQLite is widely used as a database of choice in mobile apps, camera, home electronic devices and other embedded systems.
This book is designed for beginners with little or no prior database experience.
Table Of Content
Here is what you will learn:
Chapter 1: Introduction
Chapter 2: Create Database
CREATE Database
CREATE Database in a Specific Location
Create database and populate it with tables from a file
Backup & Database
Drop Database
Chapter 3: Create, Alter, Drop Table
Create table
Drop table
Alter table
Add columns- Using ALTER TABLE Command
Insert value into a table
Chapter 4: Primary & Foreign Key
SQLite constraint
Primary Key
Not null constraint
DEFAULT Constraint
UNIQUE constraint
What is a SQLite Foreign KEY?
Chapter 5: Data Types
Storage Classes
Affinity Type
Examples of storing data types in SQLite
Chapter 6: Select, Where, Limit, Count, Group By, Union
Reading data with select
WHERE
Limiting and Ordering
Group BY
Query & Subquery
Set Operations -UNION,Intersect
Conditional results
Advanced queries
Chapter 7: Joins
Introduction to SQLite JOIN Clause
INNER JOIN
JOIN … USING
NATURAL JOIN
LEFT OUTER JOIN
CROSS JOIN
Chapter 8: INSERT, UPDATE, DELETE
INSERT
Update
Delete
Conflict clause
Chapter 9: Index, Trigger & View
View
Index
Trigger
Chapter 10: SQLite Functions
Finding the LENGTH of a string
UPPER Function and LOWER Function
TRIM Function
TYPEOF Function
SQLite LAST_INSERT_ROWID
SQLite library
User-defined functions
Read more from Alex Nordeen
Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5Learn PMP in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Learn SAP MM in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn HANA in 24 Hours Rating: 5 out of 5 stars5/5Learn SAP Basis in 24 Hours Rating: 5 out of 5 stars5/5Learn SAP SD in 24 Hours Rating: 0 out of 5 stars0 ratingsBusiness Analysis : Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Selenium in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn MongoDB in 24 Hours Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Learn R Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn SAP HR in 24 Hours Rating: 5 out of 5 stars5/5Learn Data Warehousing in 24 Hours Rating: 0 out of 5 stars0 ratingsC++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Software Testing in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Operating System in 24 Hours Rating: 0 out of 5 stars0 ratingsHacking : Guide to Computer Hacking and Penetration Testing Rating: 5 out of 5 stars5/5Learn SAP BI in 24 Hours Rating: 3 out of 5 stars3/5Learn PHP in 24 Hours Rating: 0 out of 5 stars0 ratingsC# for Beginners: Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Excel in 24 Hours Rating: 4 out of 5 stars4/5Learn Cassandra in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Hive in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Design and Analysis of Algorithms in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn AngularJS in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn C Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsLearn Hadoop in 24 Hours Rating: 0 out of 5 stars0 ratings
Related to Learn SQLite in 24 Hours
Related ebooks
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers Rating: 0 out of 5 stars0 ratingsMySQL for Python Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Windows Batch File Programming Rating: 2 out of 5 stars2/5Oracle SQL In 10 Minutes Rating: 5 out of 5 stars5/5Creating your MySQL Database: Practical Design Tips and Techniques Rating: 3 out of 5 stars3/5SQL Server: Tips and Tricks - 2 Rating: 4 out of 5 stars4/5Python and SQLite Development Rating: 0 out of 5 stars0 ratingsFlask By Example Rating: 0 out of 5 stars0 ratingsPyqt6 101: A Beginner’s Guide to PyQt6 Rating: 0 out of 5 stars0 ratingsPython: Programming For Intermediates: Learn The Basics Of Python In 7 Days! Rating: 0 out of 5 stars0 ratingsC# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsProfound Python Libraries Rating: 0 out of 5 stars0 ratingsBeginning Programming with Python For Dummies Rating: 3 out of 5 stars3/5SQL For Dummies Rating: 0 out of 5 stars0 ratingsVisual Studio Code for Python Programmers Rating: 0 out of 5 stars0 ratingsGitHub For Dummies Rating: 0 out of 5 stars0 ratingsAdventures in Python Rating: 0 out of 5 stars0 ratingsPython Tools for Visual Studio Rating: 0 out of 5 stars0 ratingsSQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Learn Python in 10 Minutes Rating: 4 out of 5 stars4/5Git Essentials Rating: 4 out of 5 stars4/5Python GUI Programming Cookbook Rating: 5 out of 5 stars5/5Profound Python Rating: 5 out of 5 stars5/5Teach Yourself VISUALLY Python Rating: 0 out of 5 stars0 ratingsFresher PyQt5: A Beginner’s Guide to PyQt5 Rating: 0 out of 5 stars0 ratingsRuby on Rails Web Mashup Projects Rating: 0 out of 5 stars0 ratingsLearning Flask Framework Rating: 4 out of 5 stars4/5
Internet & Web For You
Coding For Dummies Rating: 5 out of 5 stars5/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5No Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5How to Be Invisible: Protect Your Home, Your Children, Your Assets, and Your Life Rating: 4 out of 5 stars4/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5The $1,000,000 Web Designer Guide: A Practical Guide for Wealth and Freedom as an Online Freelancer Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5The Digital Marketing Handbook: A Step-By-Step Guide to Creating Websites That Sell Rating: 5 out of 5 stars5/5The Gothic Novel Collection Rating: 5 out of 5 stars5/5Cybersecurity All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsBeginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratingsHTML in 30 Pages Rating: 5 out of 5 stars5/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5How to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsHow To Make Money Blogging: How I Replaced My Day-Job With My Blog and How You Can Start A Blog Today Rating: 4 out of 5 stars4/5Wireless Hacking 101 Rating: 5 out of 5 stars5/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Wordpress for Beginners: The Easy Step-by-Step Guide to Creating a Website with WordPress Rating: 5 out of 5 stars5/5Social Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Tor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5Surveillance and Surveillance Detection: A CIA Insider's Guide Rating: 3 out of 5 stars3/5How To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5
Reviews for Learn SQLite in 24 Hours
0 ratings0 reviews
Book preview
Learn SQLite in 24 Hours - Alex Nordeen
Learn SQLite in 24 Hours
By Alex Nordeen
Copyright 2021 - All Rights Reserved – Alex Nordeen
ALL RIGHTS RESERVED. No part of this publication may be reproduced or transmitted in any form whatsoever, electronic, or mechanical, including photocopying, recording, or by any informational storage or retrieval system without express written, dated and signed permission from the author.
Table Of Content
Chapter 1: Introduction
Chapter 2: Create Database
CREATE Database
CREATE Database in a Specific Location
Create database and populate it with tables from a file
Backup & Database
Drop Database
Chapter 3: Create, Alter, Drop Table
Create table
Drop table
Alter table
Add columns- Using ALTER TABLE Command
Insert value into a table
Chapter 4: Primary & Foreign Key
SQLite constraint
Primary Key
Not null constraint
DEFAULT Constraint
UNIQUE constraint
What is a SQLite Foreign KEY?
Chapter 5: Data Types
Storage Classes
Affinity Type
Examples of storing data types in SQLite
Chapter 6: Select, Where, Limit, Count, Group By, Union
Reading data with select
WHERE
Limiting and Ordering
Group BY
Query & Subquery
Set Operations -UNION,Intersect
Conditional results
Advanced queries
Chapter 7: Joins
Introduction to SQLite JOIN Clause
INNER JOIN
JOIN … USING
NATURAL JOIN
LEFT OUTER JOIN
CROSS JOIN
Chapter 8: INSERT, UPDATE, DELETE
INSERT
Update
Delete
Conflict clause
Chapter 9: Index, Trigger & View
View
Index
Trigger
Chapter 10: SQLite Functions
Finding the LENGTH of a string
UPPER Function and LOWER Function
TRIM Function
TYPEOF Function
SQLite LAST_INSERT_ROWID
SQLite library
User-defined functions
Chapter 1: Introduction
What is SQLite?
SQLite is a relational database management system. It was designed originally on August 2000. It is an Open source software.
SQLite is very lightweight; it is less than 500Kb size. Unlike other database management systems like SQL Server, or Oracle.
SQLite is not a client-server database management system: it is an in-memory library that you can call it and use it directly, no installation and no configuration required.
A typical SQLite database will be contained on a single file on the computer disk storage with all the database objects (tables, views, triggers, etc.) included on that file, no dedicated server required.
SQLite Performance - Why and When to use SQLite?
When to use SQLite:
Whenever you need a lightweight database, if you are developing an embedded software for devices like televisions, mobile phones, cameras, home electronic devices, etc. then SQLite is a good choice.
If you want to manage complex session information for a website, SQLite can handle low to medium traffic HTTP requests.
When you need to store an archive of files, SQLite can produce smaller size archives and much amount metadata included than regular ZIP archives.
If you want to do some processing on some data within an application, you can use SQLite as a temporary dataset. You can load the data into an SQLite in-memory database and do the queries the way you want. You can extract the data in the way you want back to your application.
It gives you an easy and efficient way to deal with data rather than do the data processing internally inside in-memory variables. For example, if you are developing a program and you have some records that you want to do some calculations on them. Then you can create an SQLite database and insert therecords there, and with only one query, you can select the records and do the calculations you want on them directly.
When you need a database system for learning and training purposes, SQLite is a good fit for that. As we explained, no installation and no configuration are required. Just copy the SQLite libraries in your computer and is ready for creating the database.
Why to use SQLite:
It is all free – SQLite is an open source, no license required to work with it.
SQLite is cross-platform database management system; it can be used on a broad range of different platforms like Windows, Mac OS, Linux, and Unix. It can also be used on a lot of embedded operating systems like Symbian, and Windows CE.
SQLite offers an efficient way for storing data, the length of the columns is variable and is not fixed. So SQLite will allocate only the space a field needs. For example, if you have a varchar(200) column, and you put a 10 characters' length value on it, then SQLite will allocate only 20 characters' space for that value not the whole 200 space.
A broad range of SQLite APIs – SQLite provides APIs for a broad range of programming language, for example.Net languages (Visual Basic, C#), PHP, Java, Objective C, Python and a lot of other programming language.
SQLite is very flexible.
SQLite variables are dynamic typed, meaning that the type of the variable is not determined until it is assigned a value, and not on the declaration.
INSERT ON CONFLICT REPLACE statement. With this statement, you can tell SQLite to try to do an insert on a table and if it found rows with the same primary keys, then update them with the values from the inserted values.
With SQLite, you can work on multiple databases on the same session on the same time. just attach those databases and then you can access all the databases' objects (tables, views, etc..) on the same time.
SQLite limitations and Unsupported Features
The following are the list of unsupported features and limitations in SQLite:
SQLite doesn't support neither RIGHT OUTER JOIN nor FULL OUTER JOIN. It supports only LEFT OUTER JOIN.
Limitations in ALTER table statement: with ALTER TABLE statement in SQLite you can only add a column or rename a table (as we will see in the following tutorials). However, you can't do the following:
ALTER column.
DROP a column.
ADD a constraint.
VIEWs are read-only – you can't write INSERT, DELETE, or UPDATE statements into the view. However, you can create a trigger on a view and do the INSERT, DELETE, or UPDATE statements into it.
GRANT and REVOKE commands are not implemented in SQLite. There are only normal file access permissions implemented in SQLite. This is because SQLite reads and writes to the disk files, unlike other Database management systems.
TRIGGERS – As we will see