Ankith Reddy has Published 1070 Articles

Can I find out the next auto_increment to be used?

Ankith Reddy

Ankith Reddy

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

66 Views

Yes, you can find out the next auto_increment with SELECT AUTO_INCREMENT as shown in the below syntax −SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= yourDatabaseName AND TABLE_NAME=yourTableName;Let us first create a table −mysql> create table DemoTable (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientName varchar(20),    ClientAge int ... Read More

What is difference between GET and POST method in HTTP protocol?

Ankith Reddy

Ankith Reddy

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

381 Views

GET methodThe GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character as follows −http://www.test.com/hello?key1=value1&key2=value2The GET method is the default method to pass information from the browser to the web server and it produces a long ... Read More

8086 program for selection sort

Ankith Reddy

Ankith Reddy

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

775 Views

In this program we will see how to sort array elements in ascending order by using selection sort.Problem StatementWrite 8086 Assembly language program to sort the elements in a given array using selection sort technique. The array is started from memory offset 501. The size of the series is stored ... Read More

C Program to validate an IP address

Ankith Reddy

Ankith Reddy

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

7K+ Views

In this program we will see how to validate an IP address using C. The IPv4 addresses are represented in dot-decimal notation. There are four decimal numbers (all are ranging from 0 to 255). These four numbers are separated by three dots.An example of a valid IP is: 192.168.4.1To validate ... Read More

MongoDB equivalent of WHERE IN(1,2,…)?

Ankith Reddy

Ankith Reddy

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

178 Views

The MongoDB equivalent of WHERE IN(1, 2, ....) is $in operator. The syntax is as followsdb.yourCollectionName.find({yourFieldName:{$in:[yourValue1, yourValue2, ....N]}}).pretty();Let us first create a collection with documents> db.whereInDemo.insertOne({"StudentName":"John", "StudentMathScore":57}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca281ec6304881c5ce84ba5") } > db.whereInDemo.insertOne({"StudentName":"Larry", "StudentMathScore":89}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca281f56304881c5ce84ba6") } ... Read More

The listIterator() method of CopyOnWriteArrayList in Java starting at a specified position

Ankith Reddy

Ankith Reddy

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

85 Views

The listIterator() method CopyOnWriteArrayList class returns a list iterator over the elements in this list, beginning at the specified position in the list.The syntax is as followspublic ListIterator listIterator(int index)Here, index is the index of the first element to be returned from the list iterator.To work with CopyOnWriteArrayList class, you ... Read More

Calculate age from date of birth in MySQL?

Ankith Reddy

Ankith Reddy

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

665 Views

To calculate age from date of birth, you can use the below syntax −select timestampdiff(YEAR, yourColumnName, now()) AS anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentDOB datetime ); Query OK, 0 rows affected (0.61 sec)Insert ... Read More

Convert number INT in minutes to TIME in MySQL?

Ankith Reddy

Ankith Reddy

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

6K+ Views

To convert number INT in minutes to TIME in MySQL, you can use SEC_TO_TIME() function.The syntax is as followsselect SEC_TO_TIME(yourIntColumnName*60) AS `anyAliasName` from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table convertNumberToMinute    -> (    -> ... Read More

How to drop a numeric collection from MongoDB?

Ankith Reddy

Ankith Reddy

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

93 Views

In order to remove the numeric collection name, use the following syntaxdb.getCollection("yourNumericCollectionName").drop();First, create a numeric collection. Following is the query> db.createCollection("2536464"); { "ok" : 1 }Now insert some documents in the above collection. Following is the query> db.getCollection("2536464").insertOne({"Record":1}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca254a46304881c5ce84b8e") } > db.getCollection("2536464").insertOne({"Record":2}); ... Read More

C program to print digital clock with current time

Ankith Reddy

Ankith Reddy

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

3K+ Views

In this section we will see how to make a digital clock using C. To work with time we can use the time.h header file. This header file has some function signatures that are used to handle date and time related issues.The four important components of time.h is like belowsize_t ... Read More

Advertisements