Arjun Thakur has Published 1109 Articles

Select the table name as a column in a UNION select query with MySQL?

Arjun Thakur

Arjun Thakur

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

434 Views

You can use AS command for this. Let us first create a table −mysql> create table DemoTable    (    Name varchar(20)    ); Query OK, 0 rows affected (0.56 sec)Insert records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.18 sec)Display ... Read More

8086 program to generate G.P. series of n numbers

Arjun Thakur

Arjun Thakur

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

263 Views

In this program we will see how to find GP series using 8086.Problem StatementWrite 8086 Assembly language program to find GP series. The limit of the series is stored at 500, First term is stored at 501, and the common ratio is stored at 502.DiscussionGP generation is simple task. We ... Read More

8085 programs to find 2’s compliment with carry | Set 2

Arjun Thakur

Arjun Thakur

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

1K+ Views

Here we will see how to find 2’s complement with carry.Problem StatementWrite 8085 Assembly language program to find 2’s complement of a number stored in F100 with the carry, and store at F150 and F151.DiscussionIn 8085, there is CMA instruction to complement a number. Then we can add 01 with ... Read More

Java Program to set the extent in JSlider

Arjun Thakur

Arjun Thakur

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

167 Views

To set the extent of the slider, use the setExtent() method. It sets the size of the range covered by the knob −JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 70); slider.setMinorTickSpacing(5); slider.setMajorTickSpacing(20); slider.setPaintTicks(true); slider.setPaintLabels(true); slider.setExtent(20);The following is an example to set the extent in JSlider −Examplepackage my; import javax.swing.JFrame; import ... Read More

8259 PIC Microprocessor

Arjun Thakur

Arjun Thakur

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

20K+ Views

The 8259 is known as the Programmable Interrupt Controller (PIC) microprocessor. In 8085 and 8086 there are five hardware interrupts and two hardware interrupts respectively. Bu adding 8259, we can increase the interrupt handling capability. This chip combines the multi-interrupt input source to single interrupt output. This provides 8-interrupts from ... Read More

How to select the maximum value of a column in MySQL?

Arjun Thakur

Arjun Thakur

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

10K+ Views

You can use ORDER BY clause or aggregate function MAX() to select the maximum value.Using ORDER BYFollowing is the syntax −select yourColumnName from yourTableName order by yourColumnName desc limit 0, 1;Let us first create a table −mysql> create table DemoTable    (    Number int    ); Query OK, 0 ... Read More

8086 program to sort an integer array in descending order

Arjun Thakur

Arjun Thakur

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

3K+ Views

In this program we will see how to sort array elements in descending order.Problem StatementWrite 8086 Assembly language program to sort in descending order of the elements in a given array, which is starts from memory offset 501. The size of the series is stored at memory offset 500.DiscussionHere we ... Read More

How to add some rows to a table through DefaultTableModel in Java

Arjun Thakur

Arjun Thakur

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

460 Views

Let us first create a demo table −JTable table = new JTable(tableModel);Now, add a column to it −tableModel.addColumn("Languages");Add some rows to the table using insertRow() method −tableModel.insertRow(0, new Object[] { "CSS" }); tableModel.insertRow(0, new Object[] { "HTML5" }); tableModel.insertRow(0, new Object[] { "JavaScript" }); tableModel.insertRow(0, new Object[] { "jQuery" }); ... Read More

MySQL query to count frequency of students with the same age?

Arjun Thakur

Arjun Thakur

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

832 Views

You can use COUNT(*) along with GROUP BY for this. Let us first create a table −mysql> create table DemoTable    (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentAge int    ); Query OK, 0 rows affected (0.59 sec)Insert records in the table using insert command −mysql> ... Read More

How to update all dates in a Table?

Arjun Thakur

Arjun Thakur

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

89 Views

You can use UPDATE with DATE_ADD() to update all dates. Let us first create a table −mysql> create table DemoTable    (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientProjectDueDate date    ); Query OK, 0 rows affected (1.19 sec)Insert records in the table using insert command −mysql> ... Read More

Advertisements