Can I create computed columns in SQLite?

Update: As of version 3.31.0 (released on 2020-01-22), SQLite supports computed columns so the answer below applies to versions prior to 3.31.0

SQLite doesn’t supported computed columns.

However your problem can be solved with a relatively simple SQL Query, you can then create a view to make it appear like a table with the extra computed columns.

SELECT Car_Make.Name, Count(*) AS Count 
FROM Car_Make, Car_Model 
WHERE Car_Make.Id = Car_Model.Make 
GROUP BY Car_Make.Name

This should return a table similar to the following

Name      Count
----      -----
Nissan    5
Toyota    20
Ford      10

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)