Ankith Reddy has Published 996 Articles

SELECT a FLOAT with given precision in MySQL

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

1K+ Views

You can use ROUND() function.The syntax is as followsSELECT ROUND(yourColumnName, yourPrecisionIntegerValue) from yourTableName;To understand the concept, let us create a table. The query to create a table is as followsmysql> create table givenPrecisionDemo -> ( -> Amount float -> ); Query ... Read More

How to determine whether a field exists in MongoDB?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

172 Views

You need to use $exists operator to determine whether a field exists in MongoDB. Let us first create a collection with documents> db.determineFieldExistsDemo.insertOne({"ClientName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb245d628fa4220163b75") } > db.determineFieldExistsDemo.insertOne({"ClientName":"Larry", "ClientAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb25cd628fa4220163b76") } > db.determineFieldExistsDemo.insertOne({"ClientName":"Mike", "ClientCountryName":"UK"}); { ... Read More

The contains() method of the Java KeyValue Tuple

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

119 Views

Use the contains() method to search for a value in the KeyValue tuple. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package.import org.javatuples.KeyValue;Note Download JavaTuples Jar library to run JavaTuples program. If you are ... Read More

How to delete Session data in JSP?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

4K+ Views

When you are done with a user's session data, you have several options −Remove a particular attribute − You can call the public void removeAttribute(String name) method to delete the value associated with the particular key.Delete the whole session − You can call the public void invalidate() method to discard ... Read More

How to find two random documents in a MongoDB collection of 6?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

206 Views

Let us first create a collection and add some documents to it> db.twoRandomDocumentDemo.insertOne({"StudentId":10}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9aad628fa4220163b87") } > db.twoRandomDocumentDemo.insertOne({"StudentId":100}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9add628fa4220163b88") } > db.twoRandomDocumentDemo.insertOne({"StudentId":45}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9b0d628fa4220163b89") } > db.twoRandomDocumentDemo.insertOne({"StudentId":55}); { ... Read More

How to create a Hit Counter in JSP?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

195 Views

Click the Below link to know how to create a hit Counter in Jsphttps://www.tutorialspoint.com/jsp/jsp_hits_counter.htm

How to terminate a MongoDB shell script earlier?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

506 Views

In order to terminate a MongoDB shell script earlier, you need to use quit. Following is the syntaxquit() quit(1)Let us create a script and try to write quit() or quit(1) in shell. At first, we will create the following collection with documents> db.flightInformation.insertOne({"FlightName":"Flight-1", "ArrivalTime":new ISODate("2019-03-12")}); {    "acknowledged" : true, ... Read More

8086 program to add the content of one segment to another segment

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

810 Views

In this program we will see how to add two 8-bit numbers which are in different segments.Problem StatementWrite 8086 Assembly language program to add content of memory location 2000:500 and 3000:600, and store the final result at 5000:700.DiscussionHere we are initializing the CX register with the base address of first ... Read More

Find minimum unused value in a MySQL table?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

254 Views

You can use LEFT JOIN to find minimum unused value in a MySQL table. Let us first create a tablemysql> create table FindValue    -> (    -> SequenceNumber int    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command. The query ... Read More

The contains() method of the Java Decade Tuple

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

106 Views

The contains() method is used to search for a value in the Decade Tuple. Let us first see what we need to work with JavaTuples. To work with Decade class in JavaTuples, you need to import the following packageimport org.javatuples.Decade;Note Download JavaTuples Jar library to run JavaTuples program. If you ... Read More

Advertisements