Anvi Jain has Published 629 Articles

Setting similar value for a column in a MySQL table?

Anvi Jain

Anvi Jain

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

54 Views

You can set value for a column of all records with the help of update command.The syntax is as follows if you want set NULL value for all the records in a column −update yourTableName set yourColumnName = NULL;Or if you want to use empty string, the following is the ... Read More

How to select an empty result set in MySQL?

Anvi Jain

Anvi Jain

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

850 Views

Select an empty result set with the help of dummy table ‘dual’ from MySQL. The query is as follows −mysql> select 1 from dual where false; Empty set (0.00 sec)In the above query, “dual” is a dummy table and the above condition false. Therefore, it returns empty set.Let us check ... Read More

List of non-empty tables in all your MySQL databases?

Anvi Jain

Anvi Jain

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

731 Views

To list non-empty tables in MySQL database, use “information_schema.tables”. The following is the query for all database tables −mysql> select table_type, table_name from information_schema.tables    −> where table_rows >= 1;Above, we have considered only the table that have 1 or more than 1 rows i.e. non-empty table.The following is the ... Read More

How to check multiple columns for a single value in MySQL?

Anvi Jain

Anvi Jain

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

2K+ Views

You can check multiple columns for one value with the help of IN operator. The syntax is as follows −select *from yourTableName where value IN(yourColumnName1, yourColumnName2, ......N);To understand the above concept, let us create a table with some columns. The query to create a table is as follows −mysql> create ... Read More

8085 program to count total even numbers in series of 10 numbers

Anvi Jain

Anvi Jain

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

860 Views

In this program we will see how to count number of even numbers in a block of elements.Problem StatementWrite 8085 Assembly language program to count number of even numbers in a block of data, where the block size is 10D. The block is starting from location8000H.DiscussionThe Odd Even checking is ... Read More

Get a list of non-empty tables in a particular MySQL database?

Anvi Jain

Anvi Jain

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

438 Views

To get a list of non-empty tables in a particular MySQL database, the following is the syntax −SELECT table_type, table_name, table_schema from information_schema.tables where table_rows >= 1 and table_schema = 'yourDatabaseName';Implement the above syntax for your database. Here, our database is “test”. The query is as follows −mysql> select table_type, ... Read More

8085 program to find 2's complement of the contents of Flag Register

Anvi Jain

Anvi Jain

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

332 Views

In this program we will see how to find 2's complement of the content of flag register.Problem StatementWrite 8085 Assembly language program to find 2's complement of the content of flag register.DiscussionWe cannot access the total flag register directly. To use them we have to push the PSW(Accumulator-Flag) into stack, ... Read More

8085 program to find smallest number between two numbers

Anvi Jain

Anvi Jain

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

2K+ Views

In this program we will see how to find the smallest of two numbers.Problem StatementWrite 8085 Assembly language program to find the smallest number of two 8-bit number stored at location 8000H and 8001H.DiscussionThis checking is done by using the CMP instruction. This instruction is very similar to the SUB ... Read More

How to decrement a value in MySQL keeping it above zero?

Anvi Jain

Anvi Jain

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

4K+ Views

You can decrement value in MySQL with update command. With this, you can also restrict the value to not reach below 0.The syntax is as follows −update yourTableName set yourColumnName = yourColumnName - 1 where yourColumnName > 0;To avoid the value to go below zero, you can use yourColumnName > ... Read More

8085 program to swap two 16-bit numbers using Direct addressing mode

Anvi Jain

Anvi Jain

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

839 Views

In this program we will see how to swap two 16-bit numbers in direct addressing mode.Problem StatementWrite 8085 Assembly language program to swap two 16-bit number stored at location 8000H – 8001H and 8002H – 8003H using direct addressing mode.DiscussionHere we are swapping the values using XCHG instruction. This instruction ... Read More

Advertisements