- What is NoSQL?
- What is the difference between SQL and NoSQL databases, and when should you use one over the other?
- How do the data structures of SQL and NoSQL databases differ?
- What is MongoDB? and why we call it a document-oriented database?
- What are the most important MongoDB commands? explain two of them.
-
-
Save Kishimoto96/1dcb8bddee9f84b77c7ef4d1bb5cd2fa to your computer and use it in GitHub Desktop.
@nourkrimesh @TasneemAkkad @mohamadAid
1-NoSQL is a type of database that can handle large volumes of unstructured data and does not rely on a fixed schema or SQL for querying and managing data. It's often used in web applications for its scalability, performance, and flexibility.
2-SQL databases are relational databases with a fixed structure that enforce strict data consistency, while NoSQL databases are non-relational databases with a flexible structure that prioritize scalability and speed. The choice between SQL and NoSQL depends on the specific requirements of your application and the type of data you need to store and manage.
-
SQL databases use a tabular structure with pre-defined columns and rows, while NoSQL databases use a variety of flexible data structures such as key-value, document-based, column-family, and graph-based structures to store data. NoSQL databases can handle unstructured and semi-structured data more efficiently than SQL databases.
-
MongoDB is a popular, flexible, and scalable database platform that is designed to handle large amounts of unstructured or semi-structured data.
MongoDB is often referred to as a document-oriented database because it stores information in a document format rather than in tables, rows, or columns as in traditional relational databases. -
Some of the most important MongoDB commands are db.collection.find(), db.collection.insertOne(), and db.collection.updateOne().
db.collection.find() is used to retrieve documents that match a query and project the desired fields. db.collection.insertOne() is used to insert a new document into a collection, and db.collection.updateOne() is used to update a single document in a collection that matches a filter.
@ilaydanurguzel1 @jimaa-maya @tomiece317 @mustafakraizim98 @MuhammedMustafaAlnaddaf1
1- NoSQL (Not Only SQL) is a type of database management system that does not use the traditional SQL relational database model. Instead, NoSQL databases use a flexible and scalable data model, typically using document-oriented, key-value, graph, or column-family database architectures. NoSQL databases are often used for handling large amounts of unstructured or semi-structured data, which can be challenging to manage in a traditional SQL database.
2- SQL databases use structured tables and predefined schemas to store data, while NoSQL databases use flexible data models that can handle various types of data structures. SQL databases are best for applications that require complex querying and have structured data, while NoSQL databases are ideal for applications that need to handle large volumes of rapidly changing and unstructured data. Ultimately, the choice between SQL and NoSQL databases depends on the specific requirements of the application and the type of data that needs to be stored and retrieved. SQL databases are best used for structured data, NoSQL databases are suitable for structured, semi-structured, and unstructured data.
3- SQL databases use a structured, table-based data model with strict data consistency rules, while NoSQL databases use flexible, non-tabular data models that can handle unstructured or semi-structured data without strict data consistency rules. NoSQL databases typically use documents, key-value pairs, graphs, or column families to store data, and they often have a distributed architecture for scalability and high availability.
4- MongoDB is an open-source document-oriented database that is designed to store a large scale of data and also allows you to work with that data very efficiently. It is categorized under the NoSQL (Not only SQL) database because the storage and retrieval of data in the MongoDB are not in the form of tables. Because it handles information as if it were a structured document.
As opposed to a key-value store where the internals of a document are not visible to the database or accessible. In those cases the record must be consumed by the application for processing. Or a column family where parts of the document are placed into columns for access by the database.
MongoDB on the other hand allows indexing and updates within the JSON document that is stored in the db. So each part of the document is accessible to the database.
5- Two important MongoDB commands are db.collection.find(), which is used to query data from a MongoDB collection based on filter criteria, sorting instructions, and projection fields, and db.collection.insertOne(), which is used to insert a single document into a MongoDB collection with the specified data. db.mycol.help()": If you need help using a collection, then you use this command. Example, db.mycol.help().
Rasam, Asli, Baraah, Motaz
-
NoSQL databases are non-relational databases. They have roughly the same characteristics as SQL databases (durable, resilient, persistent, replicated, distributed, and performant) except for the major difference of not enforcing schemas (or enforcing only very loose schemas). These databases provide flexible schemas and scale easily with large amounts of data and high user loads.
-
SQL uses tables and creates relations between data, NoSQL uses documents and most probably doesn't have relations between data. NoSQL databases is better with the huge applications because it is more flexible and cheap for add new features, it are also good with frequent data changes, SQL is slower but still reliable on huge apps, it has fixed data, it is expensive to grow up.
-
In SQL they use tables to store data and they create relations between tables, NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently than relational tables. NoSQL databases come in a variety of types based on their data model. The main types are document, key-value, wide-column, and graph.
-
MongoDB is a popular open-source NoSQL database that is designed to store and manage unstructured and semi-structured data. It is a document-oriented database that stores data in flexible and scalable JSON-like documents, which are known as BSON (Binary JSON) documents. MongoDB a document-oriented database because it focuses on storing and managing data as self-contained documents instead of using traditional relational database tables with rows and columns
-
- db.collection.insertOne(): This command is used to insert a single document into a collection in MongoDB
- db.collection.find(): This command is used to retrieve documents from a collection in MongoDB. It can be used to find all
documents in a collection or to find documents that match a specific condition
Q1.
NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently than relational tables. NoSQL databases come in a variety of types based on their data model. The main types are document, key-value, wide-column, and graph. They provide flexible schemas and scale easily with large amounts of data and high user loads.
Q2.
An SQL, or relational database, is excellent for data processing—creating granular connections between pieces of data. A NoSQL database is great for finding one piece of data quickly and operating on it. There's little to no searching; it just gives you the user data.
Q3.
SQL databases are relational, and NoSQL databases are non-relational.
SQL databases are table-based, while NoSQL databases are document, key-value, graph, or wide-column stores.
Q4.
Instead of storing data in fixed rows and columns, document databases use flexible documents. Document databases are the most popular alternative to tabular, relational databases.
A document is a record in a document database. A document typically stores information about one object and any of its related metadata.
Documents store data in field-value pairs. The values can be a variety of types and structures, including strings, numbers, dates, arrays, or objects. Documents can be stored in formats like JSON, BSON, and XML.
To run a command against the current database, use db.runCommand():
db.runCommand( { } )
To run an administrative command against the admin database, use db.adminCommand():
db.adminCommand( { } )
Show dbs:
displays a list of all databases on the MongoDB server.
db.createCollection(""):
creates a new collection in the current database.