MongoDB Drop Database

In this post, We will learn How to delete the existing mongo database. MongoDB shell command `db.dropDatabase()` is used to drop an existing database and their associated data files. It will block other operations While dropping a database. The basic syntax for deleting a database is Syntax: db.dropDatabase() This command will drop the currently selected […]

MongoDB Insert Document

This post will help us to learn How to add document in the MongoDB collection. MongoDB has `insert()` and `save()` method to add a document into collection. Syntax: db.COLLECTION_NAME.insert(document) Insert Single record: Example: > use learnmongodb switched to db learnmongodb > db.books.insert({ ‘title’:’MongoDB’, ‘description’:’Learn MongoDB with NoSQL’, ‘version’:’4.x’ }) WriteResult({ “nInserted” : 1 }) [OR] […]

MongoDB Query Document

This tutorial will help you to get a clear understanding to use the query operations using the db.collection.find() function. Sample Collection Query Documents Query on Embedded/Nested Documents Query an Array Query an Array of Embedded Documents Sample Collection I am going to use the below `books` collection for all the sample query. db.books.insertMany([ { “name” […]

MYSQL Date And Time Types

This tutorial will help you to understand about “MYSQL Date and Time Data Types”. Storage Required For Date And Time Types YEAR Type TIME Type DATE, DATETIME AND TIMESTAMP Type Storage Requirements for Date and Time Types TIME, DATETIME, TIMESTAMP storage details showed in following table. Data Type Storage Required YEAR 1 byte DATE 3 […]

MYSQL Numeric Data Types

This tutorial will help you to understand about “MYSQL Numeric Data Types”. Storage Required For Numeic Types Integer Types Storage Required For Numeic Types Data Type Storage Required TINY INT 1 byte SMALL INT 2 bytes MEDIUM INT 3 bytes INT INTEGER 4 bytes BIGINT 8 bytes FLOAT(p) 4 bytes DOUBLE[PRECISION], REAL 8 bytes DECIMAL(M,D), […]

MYSQL Server Connection

MYSQL Connection To Server MYSQL Disconnect From Server MYSQL Connection To Server Host, user and password parameters are needed to connect the mysql server. We have to connect server like this shell>mysql -h host -u user -p Enter Password: ******* host – Where MYSQL server is running user – username of MYSQL server password – […]

MYSQL String Data Types

This tutorial will help you to understand about “MYSQL String Types”. It contains the storage required for string types, CHAR type, VARCHAR type, TEXT types, BLOB types, ENUM type and SET TYPE. Storage Required For String Types CHAR ,VARCHAR TYPE TEXT TYPES BLOB TYPES ENUM TYPE SET TYPE Storage Requirements for String Types In the […]