George John has Published 1081 Articles

Query MySQL database to echo highest auto incremented number?

George John

George John

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

140 Views

Let us first create a table with Id as auto_increment −mysql> create table DemoTable (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserName varchar(20) ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(UserName) values('John'); Query OK, 1 ... Read More

How to revert rows to default column value in MySQL?

George John

George John

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

219 Views

To revert rows to default column value, let us first create a demo tablemysql> create table defaultDemo    -> (    -> Id int    -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into defaultDemo values(10); ... Read More

What are copy elision and return value optimization in C++?

George John

George John

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

333 Views

The Copy Elision is also known as the Copy Omission. This is one of the compiler optimization technique. It avoids the unnecessary copying of objects. Almost any current compiler uses this Copy Elision technique.Let us see how it works by the help of one example code.Example Code#include using namespace ... Read More

C++ Scope of Variables

George John

George John

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

351 Views

A scope is a region of the program and broadly speaking there are three places, where variables can be declared −Inside a function or a block which is called local variables, In the definition of function parameters which is called formal parameters.Outside of all functions which is called global variables.We ... Read More

8085 Program to perform selection sort in ascending order

George John

George John

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

867 Views

Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to sort a sequence of numbers using selection sort.Problem Statement:Write 8085 Assembly language program to sort a given sequence using selection sort in ascending order. The numbers are stored at 8001H onwards. 8000H ... Read More

How to count number of specific symbols in a row in MySQL?

George John

George John

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

507 Views

You can use LENGTH() to count number of specific symbols in a row. Let us first create a table −mysql> create table DemoTable (    Value varchar(200) ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('?1234?6789?5656?324?'); Query OK, ... Read More

How to display the bit(1) fields in MySQL?

George John

George John

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

775 Views

Let us first create a table. Here, our columns is of type bit(1) −mysql> create table DemoTable (    isCaptured bit(1) ); Query OK, 0 rows affected (1.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(0); Query OK, 1 row affected (0.26 sec) mysql> ... Read More

Complex numbers in C++

George John

George John

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

9K+ Views

In this section we will see how to create and use complex numbers in C++. We can create complex number class in C++, that can hold the real and imaginary part of the complex number as member elements. There will be some member functions that are used to handle this ... Read More

Extract the user ID from the username only in MySQL?

George John

George John

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

1K+ Views

To extract the User ID only from MySQL, you can use SUBSTRING_INDEX(), which extracts the part of a string from the Username to get the User ID. Let us first display the user −mysql> SELECT USER();This will produce the following output −+----------------+ | USER() ... Read More

Why does the order in which libraries are linked sometimes cause errors in GCC?

George John

George John

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

184 Views

Basically this kind of errors are originated from the linker in the compilation phase. The default behavior of a linker is to take the code from archive libraries when the current program needs it.To work properly the libraries must be present in order. We can say that it must be ... Read More

Advertisements