Nancy Den has Published 335 Articles

How can we combine the values of two or more columns of MySQL table?

Nancy Den

Nancy Den

Updated on 22-Jun-2020 12:28:19

81 Views

For combining the values of two or more columns of MySQL table, we can use CONCAT() string function. Basically, MySQL CONCAT() function is used to combine two or more strings.SyntaxCONCAT(String1, String2, …, StringN)Here, the arguments of CONCAT functions are the strings that need to be combined.Examplemysql> select CONCAT('Ram', 'is', 'a', ... Read More

How can we combine ROW selection with COLUMN selection in MySQL?

Nancy Den

Nancy Den

Updated on 22-Jun-2020 08:27:42

118 Views

For combining ROW selection with COLUMN selection, we can use the ‘WHERE’ clause. For example, we have a table below −mysql> Select * from Student; +--------+--------+--------+ | Name   | RollNo | Grade  | +--------+--------+--------+ | Gaurav | 100    | B.tech | | Aarav  | 150    | M.SC ... Read More

How are actions that take place inside stored procedure and functions replicated?

Nancy Den

Nancy Den

Updated on 22-Jun-2020 07:27:48

104 Views

Actually standard actions carried out in stored procedures and functions are replicated from a master MySQL server to a slave MySQL server. Even the creation of stored procedures and functions carried out through normal DDL statements on a master MySQL server are replicated to a slave MySQL server. In this ... Read More

Create a stored procedure to get the detail of a particular MySQL table stored in a database?

Nancy Den

Nancy Den

Updated on 22-Jun-2020 06:51:49

230 Views

Following example will create a procedure named ‘tabledetails’ which gives all the details of a particular table stored in database.Examplemysql> DELIMITER // mysql> Create Procedure tabledetails()    -> BEGIN    -> DESCRIBE Student_detail;    -> END // Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> ... Read More

How can I use the arithmetic operators (+,-,*,/) with unit values of INTERVAL keyword in MySQL?

Nancy Den

Nancy Den

Updated on 20-Jun-2020 06:24:28

131 Views

We can use arithmetic operators (+, -, *, /) with the unit values of INTERVAL keyword as follows −Use of Addition (+)mysql> Select date('2017-10-22' + INTERVAL 2+2 Year) AS 'Date After (2+2)Years'; +------------------------+ | Date After (2+2) Years | +------------------------+ | 2021-10-22             | +------------------------+ ... Read More

What is the difference between MySQL DATETIME and TIMESTAMP data type?

Nancy Den

Nancy Den

Updated on 19-Jun-2020 13:33:54

9K+ Views

Both the data types store data in “YYYY-MM-DD HH:MM:SS” format and include date as well as time. In spite of these similarities they are having the following differences −Range − Datetime data type supports a date along with time in the range between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. But timestamp ... Read More

How to call a function in JavaScript?

Nancy Den

Nancy Den

Updated on 19-Jun-2020 11:24:12

811 Views

JavaScript allows us to write our own functions as well. To invoke a function somewhere later in the script, you would simply need to write the name of that function.ExampleYou can try to run the following code to learn how to call a function in JavaScript −       ... Read More

Nested interface in Java

Nancy Den

Nancy Den

Updated on 17-Jun-2020 07:36:17

3K+ Views

We can declare an interface in another interface or class. Such an interface is termed as a nested interface.The following are the rules governing a nested interface.A nested interface declared within an interface must be public.A nested interface declared within a class can have any access modifier.A nested interface is ... Read More

How to get a number value of a string in Javascript?

Nancy Den

Nancy Den

Updated on 17-Jun-2020 06:24:14

365 Views

To get an integer in the string “abcde 30”, use the following regex in JavaScript, else it will return NaN. With that, use parseInt() to get the numbers with regex under String match() method −ExampleLive Demo                    var myStr = "abcdef 30";          var num = parseInt(myStr.match(/\d+/))          alert(num);          

How to show image in alert box using JavaScript?

Nancy Den

Nancy Den

Updated on 16-Jun-2020 13:14:55

2K+ Views

To show an image in alert box, try to run the following code. Here, an alert image is added to the custom alert box −ExampleLive Demo                                function functionAlert(msg, myYes) {   ... Read More

Previous 1 ... 6 7 8 9 10 ... 34 Next
Advertisements