SQL Terms vs MongoDB Terms

This blog post is a bit of a different post than the normal blog posts which I write as the topic of this blog post is SQL Terms vs MongoDB Terms. As many of you know I work on the SQL Server Performance tuning area mainly and I make living by helping every single day turning SQL Server for various organizations here: Comprehensive Database Performance Health Check.

SQL Terms vs MongoDB Terms mongodb-sqlserver-800x411

Most of the large organizations are not dependent on a single database product. They often use multiple products and multiple platforms. My recent client who is a huge stockbroking firm uses along with SQL Server, MongoDB as well. Recently I got the opportunity to work with their MongoDB Expert who is also managing their one of the SQL Server which was performing very poorly.

The biggest challenge both of us faced while talking about the database was terminology which we used for various elements of the database. While I called a record or row, he called that document and we often got lost in the translation. To avoid such confusion, I have created a small table mapping the MongoDB terms with SQL terms.

SQL TermsMongoDB Terms

The biggest two words which we keep on getting mixed up were Table and Collection and Row and Documents. Once we got used to the words, it was much easier for us to work together. MongoDB is a document database and works pretty different from the relational database like SQL Server

Let me give you an idea of how different it is to write a query for both the products.

Query: Retrieve all the data from the table Users.

In SQL Server:


In MongoDB:

db.Users.find( {} )

There you go, you can see how different syntax is for both of them. With that said, I truly had a great time working with client once we started to speak each other’s languages.


Here are some of the relevant blog posts on MongoDB.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

MongoDB, NoSQL, SQL Server
Previous Post
SQL SERVER – Multiple Miscellaneous Option – Bugs Fixed by SSMS Team
Next Post
SQL SERVER – Blocking Tree – Identifying Blocking Chain Using SQL Scripts

Related Posts

2 Comments. Leave new

  • Hi Pinal, Can u pl share can u pl share when to consider between relational database and nosql db

    • Both are great. I have found them working equally good. There is no one rule I can say which will work.

      However, use the database which works for you the best or you know the most.


Leave a Reply