where to use sql and nosql code example

Example 1: difference between nosql and sql

SQL						|    NoSQL
  relational			| non-relational
  						|
use structured query	| NoSQL databases have 
language and have a		| dynamic schemas for 
predefined schema.		| unstructured data.
						|
are vertically scalable | are horizontally scalable.
are table based			| are document, key-value,
						| graph or wide-column stores.
                        |
are better for multi-row| are better for unstructured 
transactions			| data like documents or JSON.

Example 2: sql vs nosql

/* KEY DIFFERENCE
SQL pronounced as "S-Q-L" or as "See-Quel" is primarily called RDBMS or Relational Databases whereas NoSQL is a Non-relational or Distributed Database.
SQL databases are table based databases whereas NoSQL databases can be document based, key-value pairs, graph databases.
SQL databases are vertically scalable while NoSQL databases are horizontally scalable.
SQL databases have a predefined schema whereas NoSQL databases use dynamic schema for unstructured data.
SQL requires specialized DB hardware for better performance while NoSQL uses commodity hardware.*/

Tags:

Sql Example