Seetha has Published 81 Articles

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

2K+ 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

432 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

187 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

444 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

113 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

381 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

160 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

108 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

How can we create a MySQL user account by omitting the hostname?

seetha

seetha

Updated on 20-Jun-2020 11:47:50

416 Views

If we omit the hostname part of the user account, MySQL will accept it and allow the user to connect from any host. Its syntax would be as follows −Use mysql; CREATE USER user_name IDENTIFIED BY password;Here, user_name is the name of the user we wish to take account of.Password is ... Read More

Advertisements