Quantcast
Channel: CodeFari
Browsing all 265 articles
Browse latest View live

Join between two collections in MongoDB

$lookup command used to perform join between two collections. This is new feature of MongoDB version 3.2$lookup perform the left outer join between two collections in same database. For the each input...

View Article


MongoDB 3.4: What’s New

In the age of digital transformation and disruption, your ability to thrive depends on how quickly you adapt to a constantly changing market environment. MongoDB 3.4 is the latest release of the...

View Article


Image may be NSFW.
Clik here to view.

Transaction Logs in SQL server. Why we need and how can we read transaction...

Problem: As we know SQL server Master DB store all the information of table, schema, stored procedures, function, triggers etc. But what is about the operational information, if any problem like error...

View Article

GOTO Statement in SQL Server

After a condition/statement execution, if we need to altered flow of execution to a particular label then GOTO statement will help you. Basically GOTO keyword use to skip statement process and continue...

View Article

Image may be NSFW.
Clik here to view.

How to get name, data type and fields size of table in SQL Server

Sometimes we need to see the column details like name, data type and size, this article may help you to find the details of column is database table.Suppose we have an”Inventory” table as...

View Article


Image may be NSFW.
Clik here to view.

Shorthand way to return values that might be null

Problem: Suppose we have get-only property as below. In this we have a private variable and a public property both are list type.        privateList<User> _usr ;        publicList<User> lst...

View Article

Image may be NSFW.
Clik here to view.

How to get absolute value in MongoDB

To get absolute value we can use $abs operator. $abs is the arithmetic aggregate operator which returns absolute value of number.Absolute value means it always returns positive value while number may...

View Article

Image may be NSFW.
Clik here to view.

Query to subtract in MongoDB

We can use $subtract operator to subtract tow numbers. $subtract is arithmetic aggregation operator which subtract two number and returns the difference. $subtract can be use to get differences between...

View Article


Image may be NSFW.
Clik here to view.

Order by with dynamic columns in LINQ c#

Hi Guys, sometimes we need to sort the data dynamically with dynamic column, suppose we are sowing data in grid and after click on column data should be sort, on first click it should be descending and...

View Article


Image may be NSFW.
Clik here to view.

How can we identify used space in log file?

Many times we face this question in interview “How can we identify used space in log file”. Using following DBCC command you can identify the used space in log file.DBCCSQLPERF('LOGSPACE')Result:You...

View Article

Image may be NSFW.
Clik here to view.

Insert multiple rows in single SQL Query

There are many different way you can insert multiple rows in single SQL Query.When I was fresher, many times I face this question in interview, can you please write a script which can insert multiple...

View Article

Image may be NSFW.
Clik here to view.

Interview Question and answer - SQL Server Day 1

Question: What is Stored Procedure?Answer: Stored Procedure is the collection of Structured Query Language (SQL) statements with an assigned name which stored in database in compiled form. Store...

View Article

Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 2

Question: What is an index in SQL Server?Answer: Index is responsible to arrange data physically to speed up the query performance. Index is the physical structure containing to the pointers of the...

View Article


Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 3

Question: What is difference between Function and Stored Procedure in SQL Server?Answer:Some basic difference between stored procedure and function is described below.The main difference between stored...

View Article

Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 4

Question: What is Primary and foreign key in SQL server?Answer: Primary key ensures the row have unique identity. Primary key have unique values and but can’t be null. A table can have only one primary...

View Article


Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 5

Question: What is difference between Truncate and Delete in SQL Server?Answer: If you wish to removes rows basis on condition then we have to use DELETE command while truncate will remove all the rows...

View Article

Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 6

Question: When we used UPDATE_STATISTICS commands in SQL server?Answer: When bulk changes done in your data base like INSERT, UPDATE and DELETE because bulk changes may increase your index view...

View Article


Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 7

Question: What are ACID properties in SQL Server?Answer: The ACID rules of transaction in any database ensure the reliability of data in all transactions in the database.AtomicityAtomicity shows the...

View Article

Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 8

Question: What is schema in SQL Server? How can we create schema in SQL Server?Answer: Schema introduced in SQL Server 2005 which is used for separation, Management and Ownership of database object....

View Article

Image may be NSFW.
Clik here to view.

Interview Questions and answers - SQL Server Day 9

Question: What is the difference between char, nchar, varchar, and nvarchar in SQL Server?Answer: nchar and nvarchar can store Unicode characters. char and varchar cannot store Unicode characters.char...

View Article
Browsing all 265 articles
Browse latest View live