Date() Function in SQLite

SQLite Date Function To get a date value, the SQLite date function is used. It returns a date value in ‘YYYY-MM-DD’ format. Syntax: date( time_string, [ modifier1, modifier2, … modifier_n ] ) Time_string: TIMESTRING USES now To get the current date. YYYY-MM-DD To specify the date value formatted as ‘YYYY-MM-DD’. YYYY-MM-DD HH:MM To specify the … Read more

now() function in SQLite

SQLite now() Now” is a time string parameter in SQLite which is used to fetch the current date and time by various SQLite functions. Syntax 1: date(‘now’) Syntax 2: time(‘now’) Syntax 3: strftime(‘ Syntax 4: strftime(‘ Syntax 5: strftime(‘ Format: FORMAT DESCRIPTION VALUES Year 0000 to 9999 Week of year 00 to 53 Day of … Read more

strftime Function in SQLite

SQLite strftime Function To fetch date and time, the SQLite strftime function is used. It is a very powerful function and is also used to perform date calculations.   Syntax: strftime (format, timestring [, modifier1, modifier2, … modifier_n ] )   Format: FORMAT DESCRIPTION VALUES Year 0000 to 9999 Week of year 00 to 53 … Read more

Julianday Function in SQLite

SQLite Julianday Function To convert a date as a Julian Day the SQLite Julianday function is used. The resultant is thus a floating-point number. A Julian Day can be simply understood as the number of days since November 24, 4714 BC 12:00 pm Greenwich time in the Gregorian calendar. Syntax: julianday(timestring [, modifier1, modifier2, … … Read more

DateTime Function in SQLite

SQLite DateTime Function To retrieve date and time in different formats, the DateTime function is used in SQLite. The result format of DateTime function is ‘YYYY-MM-DD HH:MM:SS’. Syntax: datetime(timestring, [ modifier1, modifier2, … modifier_n ] ) Example 1: SELECT datetime(’now’);SELECT datetime(‘now’); Output: 2019-08-05 12:00:072019-08-05 12:00:07 Explanation: In the above example, we are retrieving the current … Read more

Date and Time() Functions in SQLite

To get the current date and time, the date and time() functions are used in SQLite. It uses a subset of IS0-8601 date and time formats.   FUNCTION USES SQLite date() function To calculate the date and return it in the format ‘YYYY-MM-DD’. SQLite datetime() function To calculate a date/time value, and return it in … Read more

Cross Join in SQLite

SQLite Cross Join To join each row of the first table (of x number of rows) with each row of the second table (of y number of rows), the Cross join is used in SQLite. The resultant thus contains x*y number of rows. Syntax: SELECT columns FROM table1 CROSS JOIN table2 Example: STUDENTS Table: STUDENT_ID … Read more

Outer Join in SQLite

SQLite Outer Join Unlike SQL, the SQLite supports only one type of OUter JOin and that is the Left Outer Join. SQLite Left Outer Join: The SQLite left outer join fetches all the rows from the specified fields of the left-hand table. However, for the right-hand table, it joins only those rows where the join … Read more

Inner Join in SQLite

SQLite Inner Join To combine all rows from multiple tables, the SQLite Inner join is used. However, it joins only those rows where the join condition is satisfied. It is the simplest, most popular and the default type of Join in SQLite. Syntax 1: SELECT columns FROM table_1 INNER JOIN table_2 ON conditions Syntax 2: … Read more

Joins in SQLite

SQLite Joins To combine records from two or more tables in a database, the SQLite Joins are used. The common values in the mentioned fields from the tables are fetched and displayed as the result.   Types of SQLite Joins: SQLite supports three types of Joins, including, SQLite INNER JOIN SQLite OUTER JOIN SQLite CROSS … Read more