Chandu yadav has Published 1163 Articles

Write down the MySQL query which shows inequality condition?

Chandu yadav

Chandu yadav

Updated on 12-Feb-2020 07:09:16

69 Views

Inequality means NOT EQUAL TO and MySQL have two inequality operator, ‘’ and ‘!=’. following MySQL queries shows the inequality conditionsmysql> Select tender_value From estimated_cost1 WHERE Name_company != 'Chd Ltd.';The above query shows inequality condition because it have != operator.mysql> Select tender_value From estimated_cost1 WHERE Name_company 'Chd Ltd.';The above ... Read More

What is "Argument-Dependent Lookup" ("Koenig Lookup") in C++?

Chandu yadav

Chandu yadav

Updated on 12-Feb-2020 06:34:31

189 Views

Argument-dependent lookup(ADL) is a protocol for looking up unqualified function names in function-call expressions.These function call expressions include implicit function calls to overloaded operators.The function names are looked up in the namespaces of their arguments in addition to the scopes and namespaces considered by the usual unqualified name lookup. Argument-dependent ... Read More

How do I declare a two-dimensional array in C++ using new?

Chandu yadav

Chandu yadav

Updated on 11-Feb-2020 11:07:10

1K+ Views

A dynamic 2D array is basically an array of pointers to arrays. So you first need to initialize the array of pointers to pointers and then initialize each 1d array in a loop.example#include using namespace std; int main() {    int rows = 3, cols = 4;    int** ... Read More

How do you set, clear, and toggle a bit in C/C++?

Chandu yadav

Chandu yadav

Updated on 11-Feb-2020 10:52:13

7K+ Views

You can set clear and toggle bits using bitwise operators in C, C++, Python, and all other programming languages that support these operations. You also need to use the bitshift operator to get the bit to the right place.Setting a bitTo set a bit, we'll need to use the bitwise ... Read More

Why is not sizeof for a struct equal to the sum of sizeof of each member in C/C++?

Chandu yadav

Chandu yadav

Updated on 11-Feb-2020 10:37:42

145 Views

The difference between sizeof for a struct and the sum of sizeof of each member of that struct is due to byte padding and alignment. Every data type in C/C++ has a alignment requirement. A processor will have processing word length of its architecture. On a 32 bit machine, the ... Read More

How can we combine functions in MySQL?

Chandu yadav

Chandu yadav

Updated on 10-Feb-2020 10:43:23

439 Views

Combining of functions in MySQL is quite possible by providing a function as the argument of other function. It is also called nesting of functions. To understand it, consider some examples belowmysql> Select UPPER(CONCAT('www.', 'tutorialspoint', '.com'))As Tutorials; +------------------------+ | Tutorials              | +------------------------+ | WWW.TUTORIALSPOINT.COM ... Read More

How can MySQL SUBSTRING() function be used with FROM and FOR keywords?

Chandu yadav

Chandu yadav

Updated on 10-Feb-2020 07:46:15

131 Views

The syntax of SUBSTRING() function using FROM and FOR keywords is the standard MySQL syntax.SyntaxSUBSTRING(str FROM pos FOR len)Here,  str is the string from which substring would be returned.Pos is the starting position of substring.Len is the length of substring i.e. the total number of characters fetched from str.Examplemysql> Select ... Read More

How can we split an IP Address into four respective octets by using MySQL SUBSTRING_INDEX() function?

Chandu yadav

Chandu yadav

Updated on 10-Feb-2020 07:11:38

628 Views

Suppose we have a table named ‘ipaddress’ which contains the IP addresses as its values in column ‘IP’ as follows −mysql> Select * from ipaddress; +-----------------+ | ip              | +-----------------+ | 192.128.0.5     | | 255.255.255.255 | | 192.0.255.255   | | 192.0.1.5 ... Read More

How can we replace all the occurrences of a substring with another substring within a string in MySQL?

Chandu yadav

Chandu yadav

Updated on 07-Feb-2020 10:37:00

258 Views

MySQL REPLACE() function can replace all the occurrences of a substring with another substring within a string.SyntaxREPLACE(str, find_string, replace_with)Here Str is a string which have the substring.Find_string is a substring which is present one or more times within the strung str.Replace_with is a substring which will replace every time it finds ... Read More

How can I use another MySQL function/s with REPEAT() function?

Chandu yadav

Chandu yadav

Updated on 07-Feb-2020 10:09:17

59 Views

Suppose if we want to make the output of REPEAT() function more readable then we can use another function/s with it. For example, if we want to add space or some other character between the repeated values then we can use CONCAT() function.Examplemysql> Select REPEAT(CONCAT(' *', Subject, '* '), 3)AS ... Read More

Advertisements