×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Manikanth Mani
has Published
71
Answers
How can REPLACE() be used with UPDATE clause to make permanent changes to a table?
MySQL
MySQLi
Database
Manikanth Mani
Published on 21-Feb-2018 15:14:46
As we know that REPLACE () function is used to replace the occurrences of a substring with another substring within a string. We can also use the REPLACE function with the UPDATE statement to update the table. Following example will demonstrate it −Examplemysql> Update Student set Father_Name = REPLACE(Father_Name, 'Mr.', ...
Read More
In function INSERT(str, Pos, len, newstr), what would be the result if ‘Pos’ is not within the length of the string?
MySQL
MySQLi
Database
Manikanth Mani
Published on 21-Feb-2018 13:30:03
MySQL INSERT() function performs no insertion if the position of insertion is not within the length of the string. There are certain cases like we pass a negative or 0(zero) value or the value goes beyond the value of a total number of characters in an original string by 2 ...
Read More
How can we use MySQL SUM() function to calculate the sum of only dissimilar values of the column?
MySQL
MySQLi
Database
Manikanth Mani
Published on 21-Feb-2018 11:40:39
For calculating the sum of only dissimilar values of the column we can use ‘DISTINCT’ keyword along with the name of the column. To understand SUM() function for dissimilar values, consider an ‘employee_tbl’ table, which is having the following records −mysql> SELECT * FROM employee_tbl; +------+------+------------+--------------------+ | id | ...
Read More
How can column data values of a table be compared using MySQL STRCMP() function?
MySQL
MySQLi
Database
Manikanth Mani
Published on 20-Feb-2018 16:35:07
If we want to compare the data values of two columns then we need to provide the name of the columns as arguments of MySQL STRCMP() function. Suppose we have a table named ‘Marks’ which contains the name of the student and their secured marks in different subjects. Now, if ...
Read More
How can we extract a substring from the value of a column in MySQL table?
MySQL
MySQLi
Database
Manikanth Mani
Published on 20-Feb-2018 14:37:32
We can apply any of the functions like SUBSTRING(), MID() or SUBSTR() to extract a substring from the value of a column. In this case, we must have to provide the name of the column as the first argument of the function i.e. at the place of string we have ...
Read More
How can I remove the leading and trailing spaces both at once from a string by using MySQL LTRIM() and RTRIM() functions?
MySQL
MySQLi
Database
Manikanth Mani
Published on 20-Feb-2018 13:27:14
For removing both leading and trailing spaces at once from a string by using LTRIM() and RTRIM() functions, we must have to use one function as an argument for other function. In other words, we must have to pass either LTRIM() function as an argument of RTIM() function or vice ...
Read More
What happens if I will use integer values as arguments of MySQL LOCATE() function?
MySQL
MySQLi
Database
Manikanth Mani
Published on 20-Feb-2018 11:25:07
MySQL allows us to use integer values as the arguments of the LOCATE() function. We do not need to use quotes. It can be demonstrated with the help of the following example −Examplemysql> Select LOCATE(5, 1698235); +-------------------+ | LOCATE(5, 1698235) | +-------------------+ | ...
Read More
How can CONCAT() function be applied on columns of MySQL table?
MySQL
MySQLi
Database
Manikanth Mani
Published on 19-Feb-2018 18:43:53
We can use CONCAT() function to combine the values of two or more columns. In this case, the arguments of the CONCAT() functions would be the name of the columns. For example, suppose we have a table named ‘Student’ and we want the name and address of the student collectively ...
Read More
How can we update the values in one MySQL table by using the values of another MySQL table?
MySQL
MySQLi
Database
Manikanth Mani
Published on 19-Feb-2018 16:34:54
For updating the values in one MySQL table by using the values from another MySQL table, we need to use sub-query as an expression in the SET clause of the UPDATE statement.ExampleIn this example, we have two table ‘student’ and ‘info’. We will update the value of column ‘grade’ of ...
Read More
How can I see the CREATE TABLE statement of an existing MySQL table?
MySQL
MySQLi
Database
Manikanth Mani
Published on 19-Feb-2018 12:43:45
We can see the create table statement of an existing table by using SHOW CREATE TABLE query.SyntaxSHOW CREATE TABLE table_name;Examplemysql> Show create table employee\G *************************** 1. row *************************** Table: employee Create Table: CREATE TABLE `employee` ( `Id` int(11) DEFAULT NULL, `Name` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ...
Read More
Previous
1
2
3
4
5
6
7
8
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout