Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to learn first, SQLite or SQL?

Tags:

sql

sqlite

I'll be using SQLite in C++ so i decided to learn it first. But still my question is, Are SQL commands pretty much like SQLite or Should I learn it before SQLite?

like image 467
user753214 Avatar asked Dec 27 '22 19:12

user753214


2 Answers

I'd recommend learning standard SQL before SQLite's version of SQL. SQLite allows a lot of things (such as automatic type conversions and incomplete GROUP BY clauses) that a lot of databases don't allow. Also, everything in SQLite is stored as a string but that's not the case for other versions of SQL.

Most of your SQL usage will be the same in SQLite and standard SQL but it is worth knowing about the traps. SQLite lets you get away with all sorts of things that standard SQL does not. If you start with SQLite, then you'll have a lot of trouble when you move to another database. However, if you start with a more standard SQL implementation (such as PostgreSQL or SQL Server) then dropping down to SQLite will be easy.

You might want to study some of the SQLite documentation before/after/while learning standard SQL so that you are aware of the differences:

  • SQL As Understood By SQLite
  • SQL Features That SQLite Does Not Implement
  • Distinctive Features Of SQLite

And, since you're going to be using SQLite from C++:

  • An Introduction To The SQLite C/C++ Interface

I'm not criticizing SQLite here. SQLite is a fantastic embedded database and serves its purpose very well. The problem is that going from a loose environment (such as SQLite or even MySQL) to a stricter one (PostgreSQL, SQL Server, Oracle, ...) can be difficult and frustrating. Starting with the standard (or "right") way will probably save some pain and suffering.

like image 197
mu is too short Avatar answered Jan 14 '23 15:01

mu is too short


You should learn them together since to learn SQL you'll need an SQL engine, and SQLite is just that.

Note that SQLite doesn't implement all of the SQL language but it's a great place to start learning it due to the library's simplicity. Once you are comfortable with the basics of SQL (data definition language and insert/update/select statements) you'll be ready to move on to advanced concepts (transactions, triggers, etc.) and can move on to a full Relational Database Management System which supports the entirety of the SQL language.

like image 40
maerics Avatar answered Jan 14 '23 15:01

maerics