Anvi Jain has Published 569 Articles

How can we get the summary output of a column in MySQL result set itself?

Anvi Jain

Anvi Jain

Updated on 22-Jun-2020 11:46:57

627 Views

We can get the summary output of a column in MySQL result set by using the “WITH ROLLUP” modifier. This modifier is used with GROUP BY CLAUSE. It gives the summary output to include extra rows that represent higher-level summary operations.ExampleIn this example, the WITH ROLLUP modifier gave the summary ... Read More

Create a MySQL stored procedure which fetches the rows from a table by using a cursor?

Anvi Jain

Anvi Jain

Updated on 22-Jun-2020 07:51:44

566 Views

Following is a stored procedure which fetches the records from name column of table ‘student_info’ having the following data −mysql> Select * from Student_info; +-----+---------+------------+------------+ | id  | Name    | Address    | Subject    | +-----+---------+------------+------------+ | 101 | YashPal | Amritsar   | History    | | ... Read More

How can we see the source code of a particular MySQL stored procedure?

Anvi Jain

Anvi Jain

Updated on 22-Jun-2020 05:31:49

598 Views

With the help of SHOW CREATE PROCEDURE statement, we can see the source code of a stored procedure. To make it understand we are using the stored procedure named allrecords() in the query as follows −mysql> Show Create Procedure allrecords\G *************************** 1. row *************************** Procedure: allrecords sql_mode:ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ... Read More

What are the basic rules and idioms for operator overloading in C++?

Anvi Jain

Anvi Jain

Updated on 19-Jun-2020 05:21:04

452 Views

When it comes to operator overloading in C++, there are 3 basic rules you should follow. like all such rules, there are so exceptions. These 3 rules are −1.  Whenever the meaning of an operator is not obviously clear and undisputed, it should not be overloaded. Instead, provide a function ... Read More

How to format a rounded number to N decimals using JavaScript?

Anvi Jain

Anvi Jain

Updated on 17-Jun-2020 06:45:36

461 Views

Use the toFixed() method to format a rounded number to N decimals. The toFixed() method formats a number with a specific number of digits to the right of the decimal.ExampleYou can try to run the following code to form a rounded number to N decimals −Live Demo       ... Read More

How to create domain-based cookies using JavaScript?

Anvi Jain

Anvi Jain

Updated on 16-Jun-2020 11:58:59

349 Views

To create a domain-based cookie, set the domain and path attribute on your cookie, like −domain=.example.comExampleYou can try to run the following code to learn how to create domain-based cookies −Live Demo                                                  Enter name:                    

How do I split a string, breaking at a particular character in JavaScript?

Anvi Jain

Anvi Jain

Updated on 16-Jun-2020 09:18:37

212 Views

To split a string on every occurrence of ~, split the array. After splitting, add a line break i.e. for each occurrence of ~.For example, This is demo text 1!~This is demo text 2!~~This is demo text 3!After the split and adding line breaks like the following for ~ ... Read More

How to add an audio player to an HTML webpage?

Anvi Jain

Anvi Jain

Updated on 16-Jun-2020 07:34:20

5K+ Views

The HTML element is used to add audio to web page. To add an audio player, add the controls attribute.The following three audio formats are supported in HTML − MP3, Wav, and Ogg.ExampleYou can try to run the following code to add an audio player to an HTML web ... Read More

What is Bitwise OR Assignment Operator (|=) in JavaScript?

Anvi Jain

Anvi Jain

Updated on 13-Jun-2020 09:25:03

249 Views

It performs OR operation on the right operand with the left operand and assigns the result to the left operand.ExampleYou can try to run the following code to learn how to work with Bitwise OR Assignment Operator −                    var a ... Read More

What is Addition Operator (+) in JavaScript?

Anvi Jain

Anvi Jain

Updated on 13-Jun-2020 08:19:52

298 Views

The addition operator is used to add two operands.ExampleYou can try to run the following code to work with Addition Operator −                    var a = 33;          var b = 10;          document.write("a + b = ");          result =a + b;          document.write(result);          

Advertisements