Nitya Raut

Nitya Raut

158 Articles Published

Articles by Nitya Raut

Page 8 of 16

What is the meaning of 'empty set' in MySQL result set?

Nitya Raut
Nitya Raut
Updated on 22-Jun-2020 5K+ Views

If there is ‘empty set’ in the result set of MySQL query then it means that MySQL is returning no rows and no error also in the query. It can be understood with the help of the following example −mysql> Select * from Student_info WHERE Name = 'ABCD'; Empty set (0.00 sec)We can see the empty set and execution time as output. It means that the query is correct but the MySQL table is not having the name ‘ABCD’.

Read More

In MySQL, how we can write Multiple-line statement?

Nitya Raut
Nitya Raut
Updated on 22-Jun-2020 5K+ Views

We can write multiple-line statements because MySQL determines the end of a statement by looking for the termination semicolon, not by looking for the end of the input line.Examplemysql> Select *     -> from     -> stock_item; +------------+-------+----------+ | item_name  | Value | Quantity | +------------+-------+----------+ | Calculator | 15    | 89      | | Notebooks  | 63    | 40      | | Pencil     | 15    | 40      | | Pens       | 65    | 32      | | Shirts     | 13   ...

Read More

What are the advantages and disadvantages of using MySQL stored procedures?

Nitya Raut
Nitya Raut
Updated on 22-Jun-2020 3K+ Views

There are numerous advantages and disadvantages of using MySQL stored procedures which are as follows −MySQL Stored Procedure AdvantagesFollowings are the advantages of using MySQL Stored Procedures −Increasing the performance of applications − As we know that after creating the stored procedure it is compiled and stored in the database. But MySQL implements stored procedures slightly different which helps in increasing the performance of the applications. MySQL stored procedures are compiled on demand. After compiling a stored procedure, MySQL puts it into a cache. And MySQL maintains its own stored procedure cache for every single connection. If an application uses ...

Read More

Which MySQL query can be used with the help of which we can see the list of MySQL databases?

Nitya Raut
Nitya Raut
Updated on 20-Jun-2020 166 Views

With the help of following MySQL query, we can see the list of MySQL database −mysql> SELECT schema_name FROM information_schema.schemata; +--------------------+ | schema_name | +--------------------+ | information_schema | | gaurav | | mysql | | performance_schema | | query | | query1 | | sys | | tutorials | +--------------------+ 8 rows in set (0.00 sec)We can also use WHERE clause with this query as follows −mysql> SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE '%schema' OR schema_name LIKE '%s'; +--------------------+ | schema_name | +--------------------+ | information_schema | | performance_schema | | sys | | tutorials | +--------------------+ 4 rows in set (0.00 sec)

Read More

How MySQL LEFT JOIN can be used to simulate the MySQL MINUS query?

Nitya Raut
Nitya Raut
Updated on 20-Jun-2020 1K+ Views

Since we cannot use MINUS query in MySQL, we will use LEFT JOIN to simulate the MINUS query. It can be understood with the help of the following example:ExampleIn this example, we are two tables namely Student_detail and Student_info having the following data −mysql> Select * from Student_detail; +-----------+---------+------------+------------+ | studentid | Name    | Address    | Subject    | +-----------+---------+------------+------------+ | 101       | YashPal | Amritsar   | History    | | 105       | Gaurav  | Chandigarh | Literature | | 130       | Ram     | Jhansi   ...

Read More

How can we store a value in user-defined variable?

Nitya Raut
Nitya Raut
Updated on 20-Jun-2020 357 Views

We can store a value in a user-defined variable in a statement and then refer to it afterward in other statements. Followings are the ways to store a value in user-defined variable −With SET statementwe can store a user-defined variable by issuing a SET statement as follows −SyntaxSET @var_name = expr[, @var_name = expr]…In this @var_name is the variable name which consists of alphanumeric characters from current character set. We can use either = or := assignment operator with SET statement.For example following queries can store the user variables with SET statement −mysql> SET @value = 500; Query OK, 0 ...

Read More

What MySQL returns when we alter AUTO_INCREMENT value which is less than current sequence number?

Nitya Raut
Nitya Raut
Updated on 20-Jun-2020 189 Views

When we use AUTO_INCREMENT on a MySQL column, the sequence number always increases in ascending order starting from the default value 1 or from the value we specify.That is the reason, MySQL does not allow changing the AUTO_INCREMENT value to a value which is less than the current sequence number. It can be understood with the help of the following example −ExampleIn this example suppose we have a table named ‘emp1’ and while creating the table we specify the AUTO_INCREMENT VALUE to 100. Hence after inserting the values in table, the sequence would start from 100 onwards as can be ...

Read More

Websites every Java developer should bookmark

Nitya Raut
Nitya Raut
Updated on 17-Jun-2020 193 Views

There are many sites which are a good resource to learn java. Following is the list of most popular websites.Tutorialspoint - www.tutorialspoint.comStackOverflow - www.stackoverflow.comDZone - www.dzone.comWikipedia - www.wikipedia.orgIBM Developer Works - www.ibm.com/developerworks/java/TechGig - www.techgig.comGitHub - www.github.comJava documentation - docs.oracle.com/javase/Coursera - www.coursera.org/JavaWorld - www.javaworld.com/

Read More

How to read and parse CSV files in C++?

Nitya Raut
Nitya Raut
Updated on 11-Feb-2020 3K+ Views

You should really be using a library to parsing CSV files in C++ as there are many cases that you can miss if you read files on your own. The boost library for C++ provides a really nice set of tools for reading CSV files. For example, example#include vector parseCSVLine(string line){ using namespace boost; std::vector vec; // Tokenizes the input string tokenizer tk(line, escaped_list_separator ('', ', ', '"')); for (auto i = tk.begin(); i!=tk.end(); ++i) ...

Read More

What is the ?-->? operator in C++?

Nitya Raut
Nitya Raut
Updated on 10-Feb-2020 417 Views

There is no such operator in C++. Sometimes, we need to create wrapper types. For example, types like unique_ptr, shared_ptr, optional and similar. Usually, these types have an accessor member function called .get but they also provide the operator→ to support direct access to the contained value similarly to what ordinary pointers do.The problem is that sometimes we have a few of these types nested into each other. This means that we need to call .get multiple times or to have a lot of dereference operators until we reach the value.Something like this −wrapper wp; wp.get().get().length(); wp.get()->length();This can be a ...

Read More
Showing 71–80 of 158 articles
« Prev 1 6 7 8 9 10 16 Next »
Advertisements