0% found this document useful (0 votes)
1 views11 pages

Slides 4 Sqlite 2020 10 16 PDF

This document provides a detailed overview of an embedded database experiment using SQLite, including its architecture, data types, and local infrastructure setup. It outlines tasks for downloading SQLite tools, creating databases, and implementing tables using SQLite commands. Additionally, it includes instructions for testing models in SQLite and utilizing the DB Browser for database management.

Uploaded by

bashar.fares.sy2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views11 pages

Slides 4 Sqlite 2020 10 16 PDF

This document provides a detailed overview of an embedded database experiment using SQLite, including its architecture, data types, and local infrastructure setup. It outlines tasks for downloading SQLite tools, creating databases, and implementing tables using SQLite commands. Additionally, it includes instructions for testing models in SQLite and utilizing the DB Browser for database management.

Uploaded by

bashar.fares.sy2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

DATABASE ENGINEERING

CHAPTER 4
Experiment: Embedded Database with SQLite

Wolfgang Dorner
Database Engineering
Lecture Notes
Version: Oct 16th 2021

Prof. Dr. Wolfgang Dorner

Institute for Applied Informatics


Technische Hochschule Deggendorf

Technologie Campus Freyung


Grafenauer Str. 22
94078 Freyung
An Embedded DBMS

https://www.sqlite.org/index.html Version: 3.x


Architecture
Data Types

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.


But store larger binaries/files better in the file system
Special Data Types

Boolean values are stored as integers 0 (false) and 1 (true)

Date and Time

TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").

REAL as Julian day numbers, the number of days since noon


in Greenwich on November 24, 4714 B.C. according to the
proleptic Gregorian calendar.

INTEGER as Unix Time, the number of seconds since


1970-01-01 00:00:00 UTC.
Local Infrastructure for handling SQLite Databases

We will install some local files to have an environment to work and experiment
with SQLite.
Relevant links for downloads are liste in iLearn in the corresponding section.

Task


Download SQLite Tools from sqlite.org (look for „Precompiled
Binaries for ...)

Download SQLiteBrowser

Unpack both systems to your local drive I: in a directory called sqlite

Open the command shell cmd.exe

Change to drive I: ( I: )

Change working directory to sqlite ( cd sqlite)
SQLite in the shell: sqlite-tools

Starting SQLite Tool

C:\ sqlite3.exe \\opens sqlite command shell with a new database


C:\ sqlite3.exe test.db \\opens with a new database or opens database

Working with SQLite dot-commands

sqlite> .tables \\shows all tables


sqlite> .q \\quit the application

Working with SQLite with SQL-statements and dot-commands

sqlite> CREATE TABLE test


(id INTEGER PRIMARY KEY NOT NULL,
name TEXT NOT NULL);

sqlite> .tables
sqlite> SELECT * FROM test;
DB Browser for SQLite

Open your
database-file in the
DB Browser
Test your model in SQLlite

Implement the relations Contact and Chat in SQLite using sqlite-tools


sqlite3.exe as well as the DB Browser

Task


Open sqlite3.exe and create a database file messenger.db

Create the table Contact

Open the file in the DB Browser

Control the table Contact

Create a table Chat

Fill-in some test data
WOLFGANG DORNER
Prof. Dr.

INSTITUTE FOR
APPLIED INFORMATICS
Technologie Campus Freyung

You might also like