Difference between SQL and NoSQL

In this article let us see about basic differences between SQL and NoSQL and try to understand the structure of both database models.

 SQLNoSQL
Data ModelRelational model.Structured database. Stores data in tablesNon-Relational model. Semi-Structured database. Stores data in JSON documents, graphs, key value pairs, column based.
Query LanguageStructured Query LanguageNo declarative query language.
SchemaPredefined or StaticDynamic
Popular Database SystemsMySQL, PostgreSQL, Oracle, MS-SQLMongoDB, Apache HBase, Cassandra, Amazerticalon DynamoDB
ScalingVerticalHorizontal
TransactionACID (Atomicity, Consistency, Isolation, Durability)BASE (Basically Available, Soft state, Eventual Consistency)
FlexibilityNot very flexible in terms of designVery flexible in terms of design
ExampleSELECT id, name, address FROM students WHERE age>12 LIMIT 5db.students.find( {age:{$gt:18}}, {name:{1,address:1} ).limit(5)

Relational

SQL
NoSQL

In the above images we can understand the models of SQL and NoSQL databases.

If your application has fixed structure and does not require frequent modifications  then SQL is best. But if your application is rapidly changing and growing like in big data analytics then NoSQL is best.

What is the difference between OOP and Functional programming

ParameterObject Oriented ProgrammingFunctional Programming
DefinitionA programming paradigm based on the concept of objects which contains data in the form of fields called attributes and code in the form of methodsA programming paradigm based on the concept of procedure calls
Paradigm
ApproachBottom-up ApproachTop-down Approach
Data ControlIn OOP data in each function is controlled on its ownIn POP every function has different data so no control over it.
EmphasisEmphasis on objectsEmphasis on functions
CommunicationObjects communicate with each other by message passingParameters communicate with each other by parameter passing
InheritanceInheritance is supported by three modes : private, protected and publicInheritance is not supported
Access ControlAccess control is done with access modifiersAccess modifiers is not supported
Data HidingData can be hidden is using EncapsulationNo data hiding. Data is accessible globally
Overloading or PolymorphismOverloading functions, constructors and operators are possibleOverloading is not possible
SecurityMore secured language because external functions can’t access another data.Due to global data, it is less secured language
Code reusabilityExisting code can be reusedNo code reusability
Problem SolvingUsed for solving big problemsNot used for solving big problems
ExampleC++, Java,C#, PHP, PythonCOBOL, C, FORTRAN, BASIC, PASCAL