Get Count of Each Distinct Value in a Column in MySQL

Chandu yadav
Updated on 30-Jul-2019 22:30:23

4K+ Views

Let us see an example to get the count of each distinct value in a column. Firstly, we will create a table. The CREATE command is used to create a table. mysql> create table DistinctDemo1 - > ( - > id int, - > name varchar(100) - > ); Query OK, 0 rows affected (0.43 sec) Inserting records mysql> insert into DistinctDemo1 values(1, 'John'); Query OK, 1 row affected (0.34 sec) mysql> insert into DistinctDemo1 values(2, 'John'); Query OK, 1 row affected (0.20 sec) ... Read More

MOV M, R Instruction in 8085 Microprocessor

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

8K+ Views

In 8085 Instruction set, this instruction MOV M, r will copy 8-bit value from the register r to the memory location as pointed by HL register pair.This instruction uses register addressing for specifying the data. As “r” can have any one of the seven values − r = A, B, C, D, E, H, or L Thus there are seven opcodes for this type of instruction. It occupies only 1-Byte in memory. Mnemonics, Operand Opcode(in HEX) Bytes MOV M, A 77 1 MOV M, B 70 1 MOV M, C ... Read More

Cable Television

George John
Updated on 30-Jul-2019 22:30:23

1K+ Views

Cable television is a popular television system that delivers television programming services through cables. This is different from terrestrial television (where radio waves are transmitted over air and received by antennas) and satellite television (where signals are sent by communication satellites and received by satellite dish). Types of cables used in cable TV coaxial cables through which radio-frequency signals are transmitted fiber optic cables through which light pulses are sent Services offered by Cable TV Originally used for broadcasting television services, the functionalities of cable TV has now been extended for providing different services of computer ... Read More

Instruction Type LXI RP D16 in 8085 Microprocessor

Samual Sam
Updated on 30-Jul-2019 22:30:23

29K+ Views

In the 8085 Instruction set there are four instructions, which belong to the type LXI rp, d16. These instructions are used to load the 16-bit address into the register pair. We can use this instruction to load data from memory location using the memory address, which is stored in the register pair rp. For an example, if the instruction is LXI H, FE50. It means that the FE50 is loaded into the HL register pair. The rp can be BC, DE, HL or SP. The LXI instructions and their Hex-codes are as follows. Mnemonics, Operand Opcode (in HEX) ... Read More

Shortcomings of MySQL real_escape_string

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

171 Views

The shortcoming of mysql_real_escape_string is as follows − It has main shortcoming in the modern API while we are making prepared statement. This has another shortcoming for every possible attack when you will typecast. Let us see the typecast syntax in MySQL − (TypeCast)mysql_real_escape_string($_REQUEST['anyColumnName'])); In the above syntax, we are typecasting, but in this case, it is not safer for every possible attack. The other cases include the following − It is not type safe. It is not for injection attack.

Community Antenna Television

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

1K+ Views

Cable television in their early days were called Community Antenna Television (CATV) or sometimes as Community Access Television. It was originally conceived as a method to provide cable TV services to rural areas and hilly terrains. The subscribers who want to avail the cable TV services need to pay a specified monthly subscription charge as well as an initial establishment charge. System Layout The system comprises of a big sized community antenna, installed on a hilltop that can receive broadcast signals from communication satellites. The signals received are amplified, corrected and strengthened by a device attached to the antenna, popularly ... Read More

Best Data Type for Storing Currency Values in MySQL Database

George John
Updated on 30-Jul-2019 22:30:23

811 Views

For representation of money, we need to use Decimal (TotalDigitsinteger, DigitsAfterDecimalinteger) method. Let’s say, we need to display the value 345.66. For that, count how many digits are available. In value 345.66, there are 5 digits in total and 2 digits after decimal point, which is 66. We can represent the same with the help of Decimal() method from MySQL. Here is the exact representation. DECIMAL(5, 2) Let us first create a table and consider the same above representation for our example − mysql> create table MoneyRepresentation -> ( -> Money ... Read More

C# Equivalent to Java's instanceof

George John
Updated on 30-Jul-2019 22:30:23

861 Views

The java.lang.Class.isInstance() determines if the specified Object is assignment-compatible with the object represented by this Class Java’s isInstance() method’s equivalent in C# is IsAssignableFrom(). Another simplest way for isInstance() equivalent is − bool res = (ob is DemoClass); You can also work with Type.IsInstanceOfType for the same result − ob.GetType().IsInstanceOfType(otherOb)

List Down All Running Queries in MySQL

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

5K+ Views

To list running queries, we need to use the ‘show processlist’ command. The following is the query. mysql> SHOW processlist; The following is the output of the above query. +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info ... Read More

Remove a MySQL Database

Chandu yadav
Updated on 30-Jul-2019 22:30:23

356 Views

To remove any database, we need to use DROP command in MySQL. Here is the syntax. DROP DATABASE yourDatabaseName; First, let us check how many databases are present in MySQL. Here is the query for the same. mysql> SHOW DATABASES; The following is the output. +--------------------+ | Database | +--------------------+ | business | | database1 | | databasesample | | education ... Read More

Advertisements