Can Sqlite be considered a relational database?

Asked

Viewed 1,873 times

0

According to Wikipedia, A relational database is a database that models the data in a way that the user perceives them as tables, or more formally relations.

In my mind SQLite fits this definition (and others I researched)

However, in the documentation of this implementation I was intrigued by the methods separating the SQLiteof Banco de dados relacionais:


inserir a descrição da imagem aqui


inserir a descrição da imagem aqui

After all, the SQLite can be considered a relational database?

  • 1

    It’s not even a matter of considering, it really is. The difference in description is just specialization of the library used. In the first case, "a relational in general", in the second, the specific Sqlite.em (would not have much sense nor need to write "when Targeting the Relational database Sqlite")

  • 1

    @Bacco this is the same answer, perhaps a little more elaborate :)

2 answers

3


Of course. Like any other relational scheme, Sqlite offers processes of

  • validation, verification and guarantees of data integrity,
  • Support for foreign keys, Trigger and auto-increment
  • competition control, fault recovery, security,
  • control of transactions, optimization of queries

The limitations of Sqlite are more related to performance, that is, it is not recommended in a server environment that will be very requested. As it is an embedded system, it is widely used in distributed applications, without the need to install any SGDB, since the drivers go along with the application.

the concept of a non-relational database (noSQL) refers to models that do not allow SQL, in situations where data is not modeled in the form of tables. Reasons:

  • difficulty in reconciling such a model with the demand for scalability more frequently.
  • difficulty in organizing the data in a distributed system working with data partitioning

Citation https://pt.wikipedia.org/wiki/NoSQL
Citation http://pt.slideshare.net/alexculpado/jose-alexandrerdbm-sxnosql

  • 2

    Sqllite is just not recommended where it has a lot of competing writing. It is common in many typical situations, if the person who is used knows what he is doing, he have more performance than other banks, after all many competing writings is not typical.

2

I just wanted to contribute my two cents.

Yes. Sqlite is a relational database manager system for the simple fact of using the SQL language, as the name implies. In contrast, there are Nosql databases (Mongodb, Cassandra and Redris, e.g.).

See, an example of data entry in Mongodb:

db.users.insertMany(
  [
     {
       _id: 5,
       name: "xyz",
       age: 23,
       type: 2,
       status: "D",
       favorites: { artist: "Noguchi", food: "nougat" },
       finished: [ 14, 6 ],
       badges: [ "orange" ],
       points: [
          { points: 71, bonus: 20 }
       ]
     },
     {
       _id: 6,
       name: "abc",
       age: 43,
       type: 1,
       status: "A",
       favorites: { food: "pizza", artist: "Picasso" },
       finished: [ 18, 12 ],
       badges: [ "black", "blue" ],
       points: [
          { points: 78, bonus: 8 },
          { points: 57, bonus: 7 }
       ]
     }
  ]
)

SQL is a structured language for managing data from relational data systems (which follow the relational model proposed by Codd), mainly database management systems such as Oracle Database 12c, MS SQL Server, Mysql, Sqlite, etc.

Example (with unusual syntax) with SQL:

-- MS SQL Server Query: A tabela do exemplo tem 5 campos, sendo um deles auto incrementável (chave-primária (IDENTITY(1, 1) PRIMARY KEY)
INSERT INTO minha_tabela
VALUES(
    'Valor 1' -- [N]VARCHAR
    ,1 -- TINYINT
    ,'2017-01-12 02:59:12' --DATETIME
    ,(SELECT TOP(1) nome FROM MEU_BD.DBO.tabela_usuarios) -- [N]VARCHAR
);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.