SqLite Syntex
SqLite – A relational databases?
A relational database management system can have following elements.
- Database – a collection of related records, organized into tables
- Table – a set of data elements (values) organized by records (horizontal rows) and fields (vertical columns)
- Record (or row) – a single, structured data item in a table
- Field (or column) – a set of data values of a particular simple type, one for each row of the table
Let’s Consider an example to Understand Sqlite database syntex. I say we have a database called School. In the School database we have a table called Student. The Student table contains student information as shown below:
ID NAME SURNAME AGE ADDRESS ---------- ---------- ---------- ---------- ---------- 1 Mark Benson 21 Cologne 2 July Tesar 25 Munich 3 John Mankov 23 Berlin 4 Tom Muller 30 Hamburg 5 Patrik Nauer 24 Essen 6 Peter Borse 32 Manheim 7 Carl Rossman 36 Stuttgart
The table Student contains information of seven students in seven rows. The Student table also contains five columns. (ID, NAME, SURNAME, AGE, ADDRESS).
SqLite Statements
SELECT * FROM Student;
SqLite – case sensitive
Now, if we talk about table or column names, then yes they are, but not the commands themselves.
So
SELECT * FROM foo;
is the same as
select * from foo;
but not the same as
select * from FOO;
SqLite – List Of most frequently used keywords in SqLite
- aggregate functions
- ALTER TABLE
- ANALYZE
- ATTACH DATABASE
- BEGIN TRANSACTION
- comment
- COMMIT TRANSACTION
- core functions
- CREATE INDEX
- CREATE TABLE
- CREATE TRIGGER
- CREATE VIEW
- CREATE VIRTUAL TABLE
- date and time functions
- DELETE
- DETACH DATABASE
- DROP INDEX
- DROP TABLE
- DROP TRIGGER
- DROP VIEW
- END TRANSACTION
- EXPLAIN
- expression
- INDEXED BY
- INSERT
- keywords
- ON CONFLICT clause
- PRAGMA
- REINDEX
- RELEASE SAVEPOINT
- REPLACE
- ROLLBACK TRANSACTION
- SAVEPOINT
- SELECT
- UPDATE
- VACUUM
- WITH clause
Leave a Reply