Relational databases

A relational database is a database that organizes its data based on the relations that exist between the data. In a relational database, data is presented in the form of tables with rows and columns. A table stores a collection of data of the same type. Each column in a table represents an attribute of an object stored in the table. Each row in a table represents an object stored. A table has a heading that specifies the names and types of the different attributes of the objects to be stored in the database. In relational databases, the data types of each attribute are specified at the point of creation of the table. 

Let's take a look at an example. The table here represents a collection of students:

Each row of the table represents a single student. The columns represent different attributes of each of the students. 

A relational database is maintained using an RDBMS (Relational Database Management System). The data is accessed and managed using a language known as SQL (Structured Query Language). Some of the most-used RDBMSs are Oracle, MySQL, Microsoft SQL Server, PostgreSQL, Microsoft Access, and SQLite. MySQL, PostgreSQL, and SQLite are open sourced. 

The RDBMS of choice for Android development is SQLite. This is because the Android OS comes bundled with SQLite. 

In the previous chapter, we built a to-do list app that lets the user add, update, and delete tasks. We used an ArrayList as our data store. Let's go ahead and extend the app to use a relational database instead. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset