×
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
Paul Richard
has Published
109
Answers
How can we have multiple virtuals GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
MySQL
MySQLi
Database
Paul Richard
Published on 22-Feb-2018 16:36:18
It is quite possible to add multiple virtual generated columns in a MySQL table. It can be illustrated with the following example as follows −Examplemysql> Create table profit(cost int, price int, profit int AS (price-cost), price_revised int AS (price-2)); Query OK, 0 rows affected (0.73 sec) mysql> Describe profit; ...
Read More
How can we RENAME an existing MySQL event?
MySQL
MySQLi
Database
Paul Richard
Published on 22-Feb-2018 12:40:07
With the help of ALTER EVENT statement along with the RENAME keyword, we can RENAME an existing event. To illustrate it we are having the following example in which we are renaming the event ‘Hello’ to ‘Hello_renamed’ −Examplemysql> ALTER EVENT Hello RENAME TO Hello_renamed; Query OK, 0 rows affected (0.00 ...
Read More
What are MySQL subqueries and its general categories?
MySQL
MySQLi
Database
Paul Richard
Published on 21-Feb-2018 17:04:18
A subquery is best defined as a query within a query. Subqueries enable you to write queries that select data rows for criteria that are actually developed while the query is executing at runtime. More formally, it is the use of a SELECT statement inside one of the clauses of ...
Read More
How can I convert 1st January of the current year into epoch?
MySQL
MySQLi
Database
Paul Richard
Published on 21-Feb-2018 16:18:50
It can be done by using UNIX_TIMESTAMP() function as follows −mysql> Select UNIX_TIMESTAMP(CONCAT(YEAR(CURDATE()), '-01-01')); +--------------------------------------------------+ | UNIX_TIMESTAMP(CONCAT(YEAR(CURDATE()), '-01-01')) | +--------------------------------------------------+ | 1483209000 | +--------------------------------------------------+ 1 row in set (0.03 sec)It can ...
Read More
What is the advantage of CONCAT_WS() function over CONCAT() function when we want to concatenate the values from the column and any of the columns have NULL as its value?
MySQL
MySQLi
Database
Paul Richard
Published on 21-Feb-2018 15:44:47
As we know that CONCAT() function returns NULL if any of the arguments is NULL but CONCAT_WS() function returns NULL only if the first argument i.e. the separator is NULL and it ignores any other NULL. We can say this is the advantage of CONCAT_WS() function over CONCAT() function when ...
Read More
What happens if we provide NULL as an argument to MySQL CHAR() function?
MySQL
MySQLi
Database
Paul Richard
Published on 21-Feb-2018 12:53:54
MySQL CHAR() function will ignore NULL if it is provided as an argument to it. To understand it, consider the following examples −mysql> Select CHAR(65, 66, 67, NULL); +---------------------+ | CHAR(65, 66, 67, NULL) | +---------------------+ | ABC | +---------------------+ 1 row ...
Read More
While adding the numbers contained in quotes, how MySQL evaluates if we write non-numeric text between numbers of a string?
MySQL
MySQLi
Database
Paul Richard
Published on 21-Feb-2018 11:06:05
Suppose if we are trying to add the numbers having non-numeric text between numbers of a string, then MySQL simply use the first number of that string to evaluate the addition along with a warning. Following example will exhibit this −Examplemysql> Select '1525 * 2' + '200'As Total; +-------+ | ...
Read More
How can I use RAND() function in an ORDER BY clause to shuffle MySQL set of rows?
MySQL
MySQLi
Database
Paul Richard
Published on 20-Feb-2018 19:03:16
When we use MySQL ORDER BY clause with RAND() function then the result set would have the shuffled set of rows. In other words, the result set would be in a random order. To understand it considers a table ‘Employee’ having the following records −mysql> Select * from employee; +----+--------+--------+ ...
Read More
How can we stuff a string with another one using MySQL functions?
MySQL
MySQLi
Database
Paul Richard
Published on 20-Feb-2018 18:41:01
MySQL have two functions namely LPAD() and RPAD() with the help of which we can stuff a string with another string.LPAD() function, as the name suggests, left stuff a string with another string. Following is the syntax for using it in MySQL −SyntaxLPAD(original_string, @length, pad_string)Here, original_string is the string in ...
Read More
How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?
MySQL
MySQLi
Database
Paul Richard
Published on 20-Feb-2018 13:48:44
When MySQL SUM() function got a column, having no values, an argument then it will return NULL, rather than 0, as output. But if we want to customize this output to show 0 as output then we can use MySQL COALESCE() function which accepts two arguments and returns the second ...
Read More
Previous
1
...
3
4
5
6
7
8
9
...
11
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout