Exploration of SQLite

Recently got a chance to work on SQLite for a requirement to Purge Data based on Date Conditions.Collaborating all learning as part of perks of working on something new.

1. Date Function to Add Days in SQLite.

As part of DATE functions, we can specified Days we need to add or delete.

SELECT DATE('now') ,  DATE('now' , '1 days') , DATE('now' , '-1 days')

2. Rebuild Index in SQLite

We have “REINDEX” command in SQLite to Rebuild a particular index or all indexes on a table.

3. ListAGG in SQLite

As Grouping function, SQLite provide “GROUP_CONCAT” to Concat and Group it.

WITH ALIAS1(COL1) AS
(SELECT 'HELLO' UNION
SELECT 'WORLD')
SELECT group_concat(COL1, ' ') FROM ALIAS1;

4. Database Metadata Information.

SELECT *
FROM SQLITE_MASTER
Advertisements

About Deepak Mahto

Having 10 Years of relevant/exciting/fruitful/challenging/learning in Oracle Technology. Currently working as Oracle Performance Consultant in an MNC. Hold Expertise in Performance Engineering, SQL Tuning, Database Tuning, SQL, PLSQL Development/Design Considerations and Oracle Internals. I enjoy reading on Oracle internals, posting some of my finding or observations and playing football.
This entry was posted in SQLite Learning and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s