Found 4219 Articles for MySQLi

How can we get the list of MySQL server-side help categories?

seetha
Updated on 11-Feb-2020 07:58:27

69 Views

We can get the list of MySQL server-side help categories by giving the keyword contents to the help command.mysql> help contents You asked for help about help category: "Contents" For more information, type 'help ', where is one of the following categories:    Account Management    Administration    Compound Statements    Data Definition    Data Manipulation    Data Types    Functions    Functions and Modifiers for Use with GROUP BY    Geographic Features    Help Metadata    Language Structure    Plugins    Procedures    Storage Engines    Table Maintenance    Transactions    User-Defined Functions    Utility

How to use MySQL Date functions with WHERE clause?

Ankith Reddy
Updated on 22-Jun-2020 05:02:53

1K+ Views

By using the WHERE clause with any of the MySQL date functions, the query will filter the rows based on the condition provided in the WHERE clause. To understand it, consider the data from ‘Collegedetail’ table as followsmysql> Select * from Collegedetail; +------+---------+------------+ | ID   | Country | Estb       | +------+---------+------------+ | 111  | INDIA   | 2010-05-01 | | 130  | INDIA   | 1995-10-25 | | 139  | USA     | 1994-09-25 | | 1539 | UK      | 2001-07-23 | | 1545 | Russia  | 2010-07-30 | +------+---------+------------+ 5 rows in ... Read More

How can I check how much time MySQL query, without printing it on the console, is taking?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

135 Views

To check this we need to have the profiling information which indicates resource usage for the statements executed during the course of the current session. Profiling information can get by SHOW PROFILE and SHOW PROFILES statement. Before running these statements, the profiling session variable must be set to 1 as follows − mysql> set profiling = 1; Query OK, 0 rows affected (0.00 sec) Now if we will run SHOW PROFILES statement then it will display the list of most recent statements sent to the server along with the duration and query id. mysql> show profiles; +----------+------------+--------------------------------------+ ... Read More

How can we use ORDER BY clause while calculating the Date?

Kumar Varma
Updated on 20-Jun-2020 13:53:46

96 Views

It would be more convenient to find a record if we will use ORDER BY clause while calculating the date. To understand it, we have the data from table ‘Collegedetail’ as follows −mysql> Select * from Collegedetail; +------+---------+------------+ | ID   | Country | Estb       | +------+---------+------------+ | 111  | INDIA   | 2010-05-01 | | 130  | INDIA   | 1995-10-25 | | 139  | USA     | 1994-09-25 | | 1539 | UK      | 2001-07-23 | | 1545 | Russia  | 2010-07-30 | +------+---------+------------+ 5 rows in set (0.00 sec)Now, suppose if ... Read More

How can we calculate the Date in MySQL using functions?

Ayyan
Updated on 20-Jun-2020 13:55:26

99 Views

In MySQL, we can use the following functions to calculate the Date −CURDATE() Function − Basically it returns the current date of the computer.YEAR() Function − It returns the year of the specified date.MONTH() function − It returns the month of the specified date.DAY() Function − It returns the day of the specified date.RIGHT() Function − It returns the number of character as specified within the function from the given date. The part of the expression that compares the returns from RIGHT() function evaluates 1 or 0.To understand it, consider the data, as follows, from a table named ‘Collegedetail’ −mysql> ... Read More

How can we capitalize only first letter of a string with the help of MySQL function/s?

Sharon Christine
Updated on 14-Sep-2023 21:21:45

25K+ Views

Actually, there is no single function in MySQL to capitalize only first letter of the string. We need to use nesting of functions and for this case, we can use UPPER() and LOWER() with SUBSTRING() functions. To understand it, we are using data, given as below, from ‘emp_tbl’.mysql> Select * from emp_tbl; +----+----------------+ | Id | Name           | +----+----------------+ | 1  | rahul singh    | | 2  | gaurav kumar   | | 3  | yashpal sharma | | 4  | krishan kumar  | | 5  | kuldeep rai    | | 6  | ... Read More

How can we get an idea about the server performance from the output of MySQL?

vanithasree
Updated on 11-Feb-2020 07:02:22

52 Views

After running a query, MySQL returns the number of rows and gives time in the output that shows how much it took for running that query. As for example, if we run the following querymysql> create table e1(id int); Query OK, 0 rows affected (0.23 sec)It is showing the time (0.23 sec).

How can we get “MySQL server-side help”?

radhakrishna
Updated on 20-Jun-2020 13:57:21

120 Views

MySQL provides help command to get server-side help. The syntax of this command is as follows −mysql> help search_stringMySQL uses the argument of help command as the search string for accessing the contents of MySQL reference manual. The search will fail if there would be no match for the search string.For example − suppose I want to get server-side help regarding INTEGER data type then the command for the same would be as follows −mysql> help INTEGER Name: 'INTEGER' Description: INTEGER[(M)] [UNSIGNED] [ZEROFILL] This type is a synonym for INT. URL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.htmlRead More

While adding the numbers contained in quotes, how MySQL evaluates if we write non-numeric text between numbers of a string?

Paul Richard
Updated on 20-Jun-2020 13:49:59

58 Views

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; +-------+ | Total | +-------+ | 1725  | +-------+ 1 row in set, 1 warning (0.00 sec)From the above query, it is clear that MySQL uses only first number i.e. 1525 for evaluating the addition and ignores the non-numeric text.

How can we return to windows command shell from MySQL command line tool?

mkotla
Updated on 11-Feb-2020 07:08:22

272 Views

The EXIT or QUIT commands take you returned to windows from MySQL command line tool.mysql> EXITORmysql> QUIT

Advertisements