Seetha has Published 86 Articles

When a MySQL arithmetic expression returns NULL?

seetha

seetha

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

71 Views

As we know that a NULL is not a value and it is also not the same as zero. MySQL arithmetic expression returns NULL if we will use NULL in it. It can be understood with the help of the following example −Examplemysql> Select 100*NULL; +----------+ | 100*NULL | +----------+ ... Read More

How it is possible to insert a zero or an empty string into a MySQL column which is defined as NOT NULL?

seetha

seetha

Updated on 22-Jun-2020 11:44:55

1K+ Views

Declaring a column ‘NOT NULL’ means that this column would not accept NULL values but zero (0) and an empty string is itself a value. Hence there would be no issue if we want to insert zero or an empty string into a MySQL column which is defined as NOT ... Read More

CSS overflow: auto

seetha

seetha

Updated on 22-Jun-2020 09:30:23

304 Views

The CSS overflow: auto, adds a scrollbar only when it's needed, unlike overflow:scroll. You can try to run the following code to implement CSS overflow: auto property:ExampleLive Demo                    div {             background-color: orange;     ... Read More

How can we sort multiple columns in a single query?

seetha

seetha

Updated on 22-Jun-2020 08:36:05

108 Views

We can sort multiple columns in a single query by giving more than one column name with ORDER BY Clause. The syntax of the above is as follows −SyntaxSelect Col1, Col2, … from table_name ORDER BY Col1, Col2, …ExampleSuppose we want to sort the table named ‘Student’ by columns ‘Name’ ... Read More

How can we delete a MySQL stored function from the database?

seetha

seetha

Updated on 22-Jun-2020 08:17:16

254 Views

If we have ALTER ROUTINE privileges then with the help of DROP FUNCTION statement, we can delete a MySQL stored function. Its syntax can be as follows −SyntaxDROP FUNCTION [IF EXISTS] function_nameHere function_name is the name of the function which we want to delete from our database.Examplemysql> DROP FUNCTION if ... Read More

Does MySQL preserve the environment at the time the stored procedure created?

seetha

seetha

Updated on 22-Jun-2020 07:37:13

38 Views

Actually, MySQL preserves the environment at the time the stored procedure is created. It can be understood with the help of following the example in which we are using two bars for concatenating strings. This is only legal while SQL mode is ansi. But if we change the SQL mode ... Read More

How can I create a stored procedure to select values on the basis of some conditions from a MySQL table?

seetha

seetha

Updated on 22-Jun-2020 05:42:36

266 Views

We can create a stored procedure with IN and OUT operators to SELECT records, based on some conditions, from MySQL table. To make it understand we are taking an example of a table named ‘student_info’ having the following data −mysql> Select * from student_info; +------+---------+------------+------------+ | id   | Name ... Read More

Set the width of the left border using CSS

seetha

seetha

Updated on 21-Jun-2020 10:20:40

71 Views

To set the width of the left border, use the border-left-width property in CSS. You can try to run the following code to implement the border-left-width property −ExampleLive Demo                    p {             border-style: dashed; ... Read More

How can we drop an existing database by using mysqladmin?

seetha

seetha

Updated on 20-Jun-2020 13:43:10

75 Views

We would need special privileges to create or to delete a MySQL database. Following is the syntax of dropping a database using mysqladmin binary −Syntax[root@host]# mysqladmin -u root -p drop db_name Enter password:******Here, db_name is the name of the database we want to delete.ExampleFollowing is an example to delete a database ... Read More

How can I check the list of MySQL tables, in a different database than we are using currently, along with table type in the result set using IN operator?

seetha

seetha

Updated on 20-Jun-2020 12:59:46

41 Views

It can be done with the SHOW FULL TABLES statement. Its Syntax would be as follows −SyntaxSHOW FULL TABLES IN db_nameHere db_name is the name of the database from which we want to see the list of tables.ExampleWe are currently using the database named ‘query’ and the MySQL query below ... Read More

Advertisements