Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 41 of 81

How can I use another MySQL function/s with REPEAT() function?

Chandu yadav
Chandu yadav
Updated on 07-Feb-2020 150 Views

Suppose if we want to make the output of REPEAT() function more readable then we can use another function/s with it. For example, if we want to add space or some other character between the repeated values then we can use CONCAT() function.Examplemysql> Select REPEAT(CONCAT(' *', Subject, '* '), 3)AS Subject_repetition from student; +-----------------------------------------+ | Subject_repetition                      | +-----------------------------------------+ | *Computers* *Computers* *Computers*     | | *History* *History* *History*           | | *Commerce* *Commerce* *Commerce*        | | *Computers* *Computers* *Computers*     | ...

Read More

How can I use MySQL OCTET_LENGTH() function to count the number of characters stored in a data column?

Chandu yadav
Chandu yadav
Updated on 07-Feb-2020 143 Views

We need to pass the column name as the argument of OCTET_LENGTH() function to count the number of characters stored in a data column. It displays the number of characters when referenced in SELECT clause. It can also be used as comparison value to decide whether or not the row should returned by using it in WHERE clause. The contents of ‘Student’ table are used to demonstrate it −mysql> Select Name, OCTET_LENGTH(Name)As 'Str_Length' from Student; +---------+------------+ | Name    | Str_Length | +---------+------------+ | Gaurav  | 6          | | Aarav   | 5       ...

Read More

How MySQL SUM() function evaluates if it got the column, having character data type, as its argument?

Chandu yadav
Chandu yadav
Updated on 07-Feb-2020 191 Views

MySQL SUM() function will return 0, rather than NULL, along with a warning on getting the character type column as its argument. Following example using data from table named ‘Social’ will illustrate it −Examplemysql> Select * from Social; +------+-------+ | Id   | Name  | +------+-------+ | 100  | Rahul | +------+-------+ 1 row in set (0.00 sec) mysql> Select SUM(Name) From Social; +-----------+ | SUM(Name) | +-----------+ | 0         | +-----------+ 1 row in set, 1 warning (0.00 sec)

Read More

What MySQL INSERT() function returns if the number of characters to be removed exceeds the number of characters available in original string?

Chandu yadav
Chandu yadav
Updated on 06-Feb-2020 118 Views

In case if the number of characters to be removed exceeds the number of characters available in original string then MySQL INSERT() function will continue to remove the characters until the end of the original string.Examplemysql> Select INSERT('myteststring',3,15,'original'); +----------------------------------------+ | INSERT('myteststring',3,15,'original') | +----------------------------------------+ | myoriginal                             | +----------------------------------------+ 1 row in set (0.00 sec)

Read More

What MySQL returns on running the INSERT INTO statement without giving the column name and values both?

Chandu yadav
Chandu yadav
Updated on 05-Feb-2020 272 Views

When we run the INSERT INTO statement without giving the columns name/s and values both then MySQL will store NULL as the value of the column/s of table. Consider the example given below in which we have created a table ‘Student’ with the following query −mysql> Create table Student(RollNO INT, Name Varchar(20), Class Varchar(15)); Query OK, 0 rows affected (0.17 sec)Now, we can run INSERT INTO statement without giving the columns name/s and values both as follows −mysql> Insert into Student() Values(); Query OK, 1 row affected (0.02 sec)We can see from the query below MySQL stores NULL as the ...

Read More

How can we use MySQL INSTR() function with WHERE clause?

Chandu yadav
Chandu yadav
Updated on 04-Feb-2020 1K+ Views

When we use INSTR() function with MySQL WHERE clause, we need to provide column name of the table as the first argument and the substring as second argument along with a comparison operator. Following is an example using ‘Student’ table to demonstrate it −ExampleSuppose we have the following values in ‘Student’ table −mysql> Select * from Student; +------+---------+---------+-----------+ | Id   | Name    | Address | Subject   | +------+---------+---------+-----------+ | 1    | Gaurav  | Delhi   | Computers | | 2    | Aarav   | Mumbai  | History   | | 15   | Harshit | ...

Read More

Usage of CSS list-style-position property

Chandu yadav
Chandu yadav
Updated on 03-Feb-2020 92 Views

The list-style-position property indicates whether the marker should appear inside or outside of the box containing the bullet points. If the text goes onto a second line, the text will wrap underneath the marker, for the value inside.Example If the text goes onto a second line, the text will be aligned with the start of the first line, for the value outside.                            Maths          Science          

Read More

Set image for bullet style with CSS

Chandu yadav
Chandu yadav
Updated on 03-Feb-2020 533 Views

The list-style-image allows you to specify an image so that you can use your own bullet style.ExampleYou can try to run the following code to set an image for bullet with CSS                            Football          Cricket          

Read More

Set the top margin of an element with CSS

Chandu yadav
Chandu yadav
Updated on 03-Feb-2020 108 Views

The margin-top specifies the top margin of an element. It can have a value in length, % or auto. You can try to run the following code to set the top margin:Example                            This is a paragraph with a specified top margin                      This is another paragraph with a specified top margin in percent          

Read More

Usage of border-bottom-width property in CSS

Chandu yadav
Chandu yadav
Updated on 03-Feb-2020 62 Views

The border-bottom-width changes the width of the bottom border. You can try to run the following code to implement border-bottom-width property:Example                            This is demo content.          

Read More
Showing 401–410 of 810 articles
« Prev 1 39 40 41 42 43 81 Next »
Advertisements