Sreemaha has Published 68 Articles

How Can MySQL CASE statement be used in stored procedure?

Sreemaha

Sreemaha

Updated on 22-Jun-2020 06:10:19

1K+ Views

Actually, the CASE statement has the functionality of an IF-THEN-ELSE statement. It has the following syntax −CASE WHEN condition_1 THEN    {...statements to execute when condition_1 is TRUE...} [ WHEN condition_2 THEN    {...statements to execute when condition_2 is TRUE...} ] [ WHEN condition_n THEN    {...statements to execute when ... Read More

How can we see the list of stored procedures and stored functions in a particular MySQL database?

Sreemaha

Sreemaha

Updated on 22-Jun-2020 05:22:34

171 Views

We can see the list of the stored procedure and stored functions in a particular database by using the following query on INFORMATION_SCHEMA.ROUTINES as follows −mysql> SELECT ROUTINE_TYPE, ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'query'; +--------------+--------------+ | ROUTINE_TYPE | ROUTINE_NAME | +--------------+--------------+ | PROCEDURE    | allrecords   | | ... Read More

How can we get only the name having no other details about the tables in MySQL database?

Sreemaha

Sreemaha

Updated on 22-Jun-2020 05:12:48

71 Views

With the help of SHOW TABLES command, we can get only the name having no other information about the tables. For example, we can see the list of tables in a database named tutorial as follows −mysql> show tables; +--------------------+ | Tables_in_tutorial | +--------------------+ | student           ... Read More

How can I restore a file created by mysqldump?

Sreemaha

Sreemaha

Updated on 20-Jun-2020 10:39:45

97 Views

Suppose if we want to restore a file that has been created by mysqldump then we can restore in an existing database or in a new database after creating it. Then with the help of SOURCE statement, we can restore it. We can illustrate it by an example:ExampleIn this example, ... Read More

What is the difference between YEAR(2) and YEAR(4) in MySQL?

Sreemaha

Sreemaha

Updated on 19-Jun-2020 13:41:15

434 Views

YEAR(2) stores a year in 2-digit format. For example, we can write 69 to store 1969 a year. In YEAR (2), the year can be specified from 1970 to 2069 (70 to 69).YEAR(4) stores a year in 4-digit format. For example, we need to write 19669 to store 1969 as ... Read More

What is onmouseleave event in JavaScript?

Sreemaha

Sreemaha

Updated on 19-Jun-2020 11:06:19

181 Views

The onmouseenter event triggers when after the mouse hover is moved out.ExampleYou can try to run the following code to learn how to work with an onmouseleave event in JavaScript −                                         This is demo text for mouseleave event.    

How to create HTML link that doesnt follow the link?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 13:15:46

292 Views

Use “nofollow” to create HTML link that doesn’t follow the link. In HTML, while adding an external link, you can set the attribute “rel” as “nofollow” or “dofollow” −The “nofollow” value tells the search engine − “Don't follow links on this page" or "Don't follow this specific link."Another WebsiteWhile using ... Read More

How to set a cookie and get a cookie with JavaScript?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 11:56:32

3K+ Views

Set CookieThe simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this:document.cookie = "key1=value1;key2=value2;expires=date";Here the “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or ... Read More

What is lexical this in JavaScript?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 06:24:31

1K+ Views

Fat arrow function solves the issue of lexical binding “this”. It gets the context of “this “and you can fulfill the same purpose since fast arrow does not have its own this. Fat arrow function as the name suggests helps in decreasing line of code. The syntax => shows fat ... Read More

Create JS Radial gradient with matrix in HTML

Sreemaha

Sreemaha

Updated on 02-Jun-2020 07:40:33

157 Views

JSRadial gradient with matrix is created in the following way. You can try to run the following way to create JS Radial gradient with matrix −var canvas1 = document.getElementById("canvas"); //canvas1 variable to identify given canvas var ctx1 = canvas.getContext("2d"); //This is used to tell context is 2D   var ... Read More

Advertisements