Chandu yadav has Published 1091 Articles

8086 program to find the factorial of a number

Chandu yadav

Chandu yadav

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

15K+ Views

In this program we will see how to find the factorial of a number.Problem StatementWrite 8086 Assembly language program to find the factorial of a number stored in memory offset 500. Store the result at 600 and 601 memory offset.DiscussionTo find the factorial of a number n we have to ... Read More

Why should we use MySQL CASE Statement?

Chandu yadav

Chandu yadav

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

191 Views

Use MySQL CASE for a fixed number of arguments.The syntax is as followsSELECT *, CASE WHEN yourColumName1>yourColumName2 THEN 'yourMessage1' ELSE 'yourMessage2' END 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 CaseFunctionDemo    -> ( ... Read More

DoubleStream boxed() method in Java

Chandu yadav

Chandu yadav

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

171 Views

The boxed() method of the DoubleStream class returns a Stream consisting of the elements of this stream, boxed to Double.The syntax is as followsStream boxed()Here, Double is the class that wraps a value of the primitive type double in an object. To work with DoubleStream class in Java, import the ... Read More

MySQL query to add 0's to numbers with less than 9 digits?

Chandu yadav

Chandu yadav

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

332 Views

Use LPAD() to add 0's to numbers with less than 9 digits. Let us first create a table −mysql> create table DemoTable (    Value varchar(20) ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('3646465'); Query OK, 1 ... Read More

MySQL index on column of int type?

Chandu yadav

Chandu yadav

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

604 Views

Adding an index on column of int type is a good choice to run your query faster whenever your table has lots of records.If your table has less records then it is not a good choice to use index on column of int type.To understand the concept, let us create ... Read More

How to refresh a JSP page at regular interval?

Chandu yadav

Chandu yadav

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

332 Views

Following example would use setIntHeader() method to set Refresh header to simulate a digital clock −           Auto Refresh Header Example                        Auto Refresh Header Example               ... Read More

8086 program to convert binary to Grey code

Chandu yadav

Chandu yadav

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

2K+ Views

In this program we will see how to find the gray code from a binary number.Problem StatementWrite 8086 Assembly language program to find the equivalent gray code from a binary number. The number is stored at location 2500 and store the result at 2600.DiscussionTo convert binary to gray code, we ... Read More

IntStream findFirst() method in Java

Chandu yadav

Chandu yadav

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

403 Views

The findFirst() method in Java returns an OptionalInt describing the first element of this stream. If the stream is empty, an empty OptionalInt is returned.The syntax is as followsOptionalInt findFirst()Here, OptionalInt is a container object which may or may not contain an int value.To work with the IntStream class in ... Read More

How to add a where clause in a MySQL Insert statement?

Chandu yadav

Chandu yadav

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

246 Views

You need to use UPDATE statement for this.The syntax is as followsupdate yourTableName set yourColumnName1=yourValue1, yourColumnName2=yourValue2, ....N where yourCondition;Let us create a table for our examplemysql> create table addWhereClauseDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(30),    -> StudentPassword varchar(40)   ... Read More

Update one column data to another column in MySQL if the second column is NOT NULL?

Chandu yadav

Chandu yadav

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

3K+ Views

To update one column data to another column, you can use UPDATE command. Let us first create a table −mysql> create table DemoTable (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserFirstName varchar(20),    ListOfName varchar(20) ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table ... Read More

Advertisements