SQL - HenriBech/SWO_DACH_wiki GitHub Wiki
CodeCademy Reference:
- Manipulation: CREATE, ALTER and DELETE tables; INSERT and UPDATE data
- Queries: SELECT and ORDER using conditional operators
- Aggregate Functions: calculate SUM, MIN/MAX, COUNT, AVG, ROUND from column data; GROUP said data based on column data
- Multiple Tables: JOIN data from multiple tables based on PRIMARY and FOREIGN KEY, stack tables and use aliases
SQLite: terminal based database engine
-
Download Latest Release
-
Extract
.zip
to desired location -
Open
bash
terminalEnter
echo "alias sqlite3=\"winpty ${PWD}/sqlite3.exe\"" >> ~/.bashrc
to create an alias -
Now you can type
sqlite3
in anybash
terminal to start SQLite -
To open an existing database type
sqlite3 <database>.<db/sqlite>
- Navigate to desired location
- Open
bash
terminal - Type
sqlite3 <database-name>.db "VACUUM;"
- A usable Database should now have been created in the current directory
sqlite3.js: Asynchronous Node SQL library
- Make sure you have Node.js and
npm
installed - In your workspace, open any terminal window
- Type
npm install sqlite3
- In your
.js
file addconst sqlite3 = require('sqlite3')
to the top
CodeCademy Reference:
-
Learn Node-SQLite: connect to databases, get queries and run commands
Note that this library will run asynchronously! Structure your code accordingly