[python]Flask Migrate

Flask Migrate advantage This is for easy update of the existing database, such as create a new column, create a new table, drop a table, revert previous database. With migrate, I do not need to do the db.create_all() anymore. A note on sqlite3, once a table is created you cannot insert column directly, need to … Continue reading [python]Flask Migrate

[python]Create database with SQLAlchemy

The objective of learning SQLAlchemy is to use its Object Relational Mapper (ORM), this allows programmer who does not do SQL syntax to also do CRUD on supported database, the ORM does the "translation or mapping" for us in the background, in our code we only need to do CRUD with python syntax. The SQLAlchemy … Continue reading [python]Create database with SQLAlchemy

[database]Functions provided by DBMS

Here is a list of non-exhaustive functions provided by DBMS (Database management system) To prevent data lost during system failure, it should provide reliable recovery service. Provide transaction service for user such as read (select), update, delete, commit, insert, rollback. Provide authorisation service such as permission for user to insert (write new data), update (update … Continue reading [database]Functions provided by DBMS

[DATABASE]ACID property of DBMS

Atomicity refers to a transaction is either fully completed or not completed at all, there is no partial complete transaction. This also refers to all or none rule. Consistency refers during transaction the integrity constraints are maintained so that the data are consistent before and after transactions. Isolation refers to changes of one transaction are … Continue reading [DATABASE]ACID property of DBMS

[DATABASE]Difference between inner join, right and left outer join

Creating the tables Data from T1 Data from T2 Left outer join In the below example left table is T1 and right table is T2. Left outer join will cause tuples of the left table (T1) to be preserved, the right table (T2) will display values that match the TID of the left, if there … Continue reading [DATABASE]Difference between inner join, right and left outer join