×
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
Rishi Rathor
has Published
184
Answers
How to adjust display settings of MySQL command line?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 14:34:26
To adjust display settings of MySQL command line, use the /G at the end of MySQL queries instead of semicolon(;).The syntax is as follows −SELECT *FROM yourTableName \GThe above syntax adjusts the display settings. Here we will display records in row format from our sample ‘studenttable’ table which we created ...
Read More
MySQL Sum Query with IF Condition?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 14:24:01
The Sum() is an aggregate function in MySQL. You can use sum query with if condition. To understand the sum query with if condition, let us create a table.The query to create a table −mysql> create table SumWithIfCondition −> ( −> ModeOfPayment varchar(100) −> , −> ...
Read More
How do I create a view in MySQL?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 14:05:13
To create a view in MySQL, you can use CREATE VIEW command. The syntax is as follows −CREATE VIEW yourViewName as SELECT yourColumName1, yourColumName2, yourColumName3, ...... yourColumNameN from yourTableName;To understand the above syntax, let us create a table first. The following is the query to create a table −mysql> create ...
Read More
MySQL Query to change lower case to upper case?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 13:05:18
You can use in-built function UPPER() from MySQL to change a lower case to upper case. The syntax is as follows with select statement.SELECT UPPER(‘yourStringValue’);The following is an example showing string in lower case −mysql> select upper('john');Here is the output displaying string in upper case −+---------------+ | upper('john') | +---------------+ ...
Read More
How to display the value of a variable on command line in MySQL?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 12:58:43
To display the value of a variable, you can use select statement. The syntax is follows −SELECT @yourVariableName;Let us first create a variable. This can be done using SET command. The following is the syntax to create a variable −SET @yourVariableName = yourValue;Let us check the above syntax to create ...
Read More
MySQL add days to a date?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 12:47:35
To add days to a date, you can use DATE_ADD() function from MySQL. The syntax is as follows to add days to a date −INSERT INTO yourTableName VALUES(DATE_ADD(now(), interval n day));In the above syntax, you can use curdate() instead of now(). The curdate() will store only date while now() will ...
Read More
Display all tables inside a MySQL database using Java?
MySQL
MySQLi
Database
Java 8
Programming
Rishi Rathor
Published on 16-Jan-2019 12:25:25
We will see here how to display all tables inside a MySQL database using Java. You can use show command from MySQL to get all tables inside a MySQL database.Let’s say our database is ‘test’. The Java code is as follows to show all table names inside a database ‘test’.The ...
Read More
Set column charset in MySQL?
MySQL
MySQLi
Database
Rishi Rathor
Published on 16-Jan-2019 12:13:54
Set column charset using character SET command. The syntax is as follows −ALTER TABLE yourTableName MODIFY youColumName type CHARACTER SET anyCharcaterSetName;You can use character set name utf8 or something elsE. To set column charset, let us first create a table. The query to create a table is as follows −mysql> ...
Read More
How to get a list of MySQL user hosts?
Database
MySQL
MySQLi
Rishi Rathor
Published on 11-Jan-2019 16:03:19
Firstly, get a list of MySQL user accounts, using MySQL.user table. You can use select user column from MySQL.user table to get a list of MySQL user accounts.The query is as follows −mysql> select user from MySQL.user;The following output displays all the users −+------------------+ | user ...
Read More
Using MySQL, can I sort a column but allow 0 to come last?
MySQL
MySQLi
Database
Rishi Rathor
Published on 11-Jan-2019 15:54:12
You can sort a column, with 0 come last with the help of ORDER BY. The syntax is as follows −select *from yourTableName order by yourFieldName = 0, yourFieldName;To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table ...
Read More
Previous
1
2
3
4
5
6
7
...
19
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout