MySQL Evaluation of Non-Numeric Text After Numbers in Quotes

Rama Giri
Updated on 20-Jun-2020 13:47:16

91 Views

Suppose if we are trying to add the numbers having non-numeric text after them, then MySQL simply discard the non-numeric text and evaluates the addition of numeric values along with warnings. Following example will exhibit this −Examplemysql> Select '1525 Kg' + '200 Oz'As Total; +-------+ | Total | +-------+ | 1725  | +-------+ 1 row in set, 2 warnings (0.00 sec)

How MySQL Evaluates Adding Two Numbers in Quotes

Lakshmi Srinivas
Updated on 20-Jun-2020 13:46:39

114 Views

If we are trying to add two numbers that are contained in quotes, means we are treating the string as a number. In this case, MySQL converts the value into the closet numeric equivalent and evaluates the result. Following example will demonstrate it.Examplemysql> Select '1525' + '200'As Total; +-------+ | Total | +-------+ | 1725  | +-------+ 1 row in set (0.00 sec)

String Comparison in MySQL: Case Sensitive or Not

Vikyath Ram
Updated on 20-Jun-2020 13:46:14

248 Views

MySQL cannot perform a case-sensitive comparison when comparing characters. It can be illustrated with the following example from table ‘Employee’ having the following data −mysql> Select * from Employee; +----+--------+--------+ | ID | Name   | Salary | +----+--------+--------+ | 1  | Gaurav | 50000  | | 2  | Rahul  | 20000  | | 3  | Advik  | 25000  | | 4  | Aarav  | 65000  | | 5  | Ram    | 20000  | | 6  | Mohan  | 30000  | | 7  | Aryan  | NULL   | | 8  | Vinay  | NULL   | +----+--------+--------+ 8 rows in set (0.09 sec)The result set of the following query shows that MySQL is not case sensitive when comparing characters.mysql> Select * from Employee WHERE Name IN ('gaurav','RAM'); +----+--------+--------+ | ID | Name   | Salary | +----+--------+--------+ | 1  | Gaurav | 50000  | | 5  | Ram    | 20000  | +----+--------+--------+ 2 rows in set (0.00 sec)

Signal Overflowed Content to Users with CSS

usharani
Updated on 20-Jun-2020 13:45:08

146 Views

The text-overflow property is used to determine how overflowed content that is not displayed is signaled to users with CSS.ExampleYou can try to run the following code to implement a text-overflow property in CSS:Live Demo                    p.text1 {             white-space: nowrap;             width: 200px;             border: 1px solid #000000;             overflow: hidden;             text-overflow: clip;          }          p.text2 { ... Read More

Use Column Data Within MySQL CASE Statement

Rishi Raj
Updated on 20-Jun-2020 13:43:50

179 Views

To understand it consider the data, as follows, from the table ‘Students’ −mysql> Select * from Students; +----+-----------+-----------+----------+----------------+ | id | Name      | Country   | Language | Course         | +----+-----------+-----------+----------+----------------+ | 1  | Francis   | UK        | English  | Literature     | | 2  | Rick      | USA       | English  | History        | | 3  | Correy    | USA       | English  | Computers      | | 4  | Shane     | France    | ... Read More

Drop an Existing Database Using mysqladmin

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

176 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 named TUTORIALS −[root@host]# mysqladmin -u root -p drop TUTORIALS Enter password:******The above statement will give you a warning and it will confirm if you really want to delete this database or not.Dropping the database is potentially a very bad thing to do. Any data stored in the database will be ... Read More

Emphasis Text and Color with CSS

Nikitha N
Updated on 20-Jun-2020 13:42:36

268 Views

Use the text-emphasis property to emphasis text and color with CSS.Let us see an example:text-emphasis: text-emphasis-style text-emphasis-color;Here,text-emphasis-color: foreground color of the emphasis marktext-emphasis-style: emphasis marks on the element's text

Select Database from MySQL Command Prompt

Prabhas
Updated on 20-Jun-2020 13:42:08

170 Views

Once we get connected to the MySQL server, it is required to select a database to work with. This is because there might be more than one database available with the MySQL Server.It is very simple to select a database from the mysql> prompt. We can use SQL command ‘use’ to select a database. To illustrate it we are selecting the database named ‘Tutorials’ in the following example −Example[root@host]# mysql -u root -p Enter password:****** mysql> use TUTORIALS; Database changed mysql>Now, we have selected the TUTORIALS database and all the subsequent operations will be performed on the TUTORIALS database.Read More

Align the Last Line of the Text with CSS

George John
Updated on 20-Jun-2020 13:41:54

350 Views

The text-align-last property is used to align the last line of the text. You can try to run the following code to align the last line of the text with CSSExampleLive Demo                    .mydiv {             text-align-last: right;          }                     text-align-last Property                This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text.           Output

Establish MySQL Database Using MySQL Binary at Command Prompt

Sravani S
Updated on 20-Jun-2020 13:41:12

133 Views

You can establish the MySQL database using the mysql binary at the command prompt. It can be understood with the help of the following example −ExampleWe can use following statements to connect to the MySQL server from the command prompt −[root@host]# mysql -u root -p Enter password:******This will give us the mysql> command prompt where we will be able to execute any SQL command. Following is the result of above command −The following code block shows the result of above code −Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.20 MySQL ... Read More

Advertisements