EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials MySQL Tutorial Cheat Sheet MySQL
Secondary Sidebar
MySQL Tutorial
  • Basic
    • MySQL floor
    • MySQL DESCRIBE table
    • MySQL encryption
    • Introduction to MySQL
    • Is SQL Server a Database?
    • What is MySQL
    • Is MySQL Programming Language
    • MySQL Server
    • MySQL AB
    • MySQL Community Server
    • How To Install MySQL
    • MySQL Versions
    • MySQL OpenSource
    • MySQL GUI Tools
    • MySQL Grant
    • MySQL Error 1064
    • MySQL Drop Database
    • MySQL not equal
    • MySQL SELECT INTO Variable
    • MySQL Commands
    • MySQL Operators
    • What is MySQL Schema
    • Wildcards in MySQL
    • MySQL Constraints
    • MySQL Administration
    • MySQL Data Type
    • MYSQL COMMIT
    • MySQL FORMAT
    • Timestamp to Date in MySQL
    • MySQL DATEDIFF
    • MySQL?Incremental Backup
    • MySQL JSON Data Type
    • MySQL ENUM
    • MySQL Default Port
    • Cheat Sheet MySQL
  • Queries
    • MySQL Queries
    • MySQL Query Commands
    • SELECT in MySQL
    • MySQL INSERT IGNORE
    • MySQL having
    • ORDER BY in MySQL
    • MySQL Cheat Sheet
    • MySQL ORDER BY Random
    • MySQL ORDER BY DESC
    • MySQL GROUP BY
    • MySQL GROUP BY Count
    • MySQL GROUP BY month
    • MySQL WHERE Clause
    • MySQL WITH
    • MySQL FETCH
    • MySQL DDL
    • MySQL DML
    • MySQL WHERE IN Array
    • MySQL Fetch Array
    • MySQL ISNULL
    • MySQL Index Types
    • Mysql? Export Schema
    • Amazon RDS for MySQL
    • MySQL greatest
  • Database
    • What is Data Modeling
    • What is Data Processing
    • DBMS Architecture
    • DBMS Keys
    • Careers in Database Administration
    • What is MySQL Database
    • MySQL Relational Database
    • How to Connect Database to MySQL
    • MySQL Database Repair
    • RDBMS Interview Questions
    • DBMS Interview Questions
  • Functions
    • MySQL Function
    • MySQL Aggregate Function
    • MySQL String functions
    • MySQL Date Functions
    • MySQL Window Functions
    • MySQL Math Functions
    • MySQL Boolean
    • Cursor in MySQL
    • Condition in MySQL
    • MySQL BETWEEN
    • Insert in MySQL
    • MySQL IFNULL()
    • MySQL TIMESTAMPDIFF()
    • MySQL COALESCE()
    • MySQL count()
    • MIN() in MySQL
    • MySQL Numeric
    • MySQL field()
    • MySQL FIND_IN_SET()
    • MySQL avg()
    • MySQL MAX() Function
    • MySQL BIN()
    • MySQL Concat
    • MySQL DECODE()
    • MySQL REGEXP_REPLACE()
    • MySQL Asynchronous
    • MySQL innodb_buffer_pool_size
    • MySQL key_buffer_size
    • MySQL TRUNCATE()
    • MySQL ROW_NUMBER()
    • NOT in MySQL
    • MySQL IN Operator
    • LIKE in MySQL
    • ANY in MySQL
    • MySQL NOT IN
    • MySQL CHECK Constraint
    • MySQL DISTINCT
    • MySQL ALL
    • MySQL Union
    • MySQL UNION ALL
    • MySQL EXISTS
    • MySQL ON DELETE CASCADE
    • MySQL REGEXP
    • MySQL Index
    • MySQL Add Index
    • MySQL REINDEX
    • MySQL UNIQUE INDEX
    • MySQL Clustered Index
    • MySQL? InnoDB Cluster
    • Table in MySQL
    • ALTER TABLE MySQL
    • MySQL Temporary Table
    • MySQL Clone Table
    • MySQL Repair Table
    • MySQL Lock Table
    • MySQL Optimize Table
    • TRUNCATE TABLE MySQL
    • MySQL Table Dump
    • MySQL Update Set
    • MySQL ALTER TABLE Add Column
    • MySQL RANK()
    • MySQL CTE
    • MySQL LAG()
    • MySQL GROUP_CONCAT()
    • MySQL EXTRACT()
    • MySQL REPLACE
    • MySQL AUTO_INCREMENT
    • MySQL SYSDATE()
    • MySQL NULLIF()
    • MySQL Substring
    • MySQL SUBSTRING_INDEX()
    • MySQL LOWERCASE
    • MySQL Row
    • MySQL NOW
    • MySQL CEIL
    • MySQL Alias
    • MySQL Trigger
    • MySQL SHOW Triggers
    • MySQL UPDATE Trigger
    • MySQL DELETE Trigger
    • MySQL AFTER UPDATE Trigger
    • MySQL Stored Procedure
    • ROLLUP in MySQL
    • MySQL? INSTR()
    • MySQL Subquery
    • MySQL Timestamp
    • MySQL? Hour()
    • MySQL MOD()
    • MySQL DATE_FORMAT()
    • ALTER Column in MySQL
    • MySQL Rename Column
    • MySQL Interval
    • MySQL CURDATE
    • MySQL BIT
    • MySQL Binlog
    • MySQL Average
    • MySQL TEXT
    • MySQL SHOW
    • MySQL Offset
    • MySQL Timezone
    • mysql_real_escape_string
    • MySQL Datetime
    • MySQL DATE_SUB()
    • MySQL FULLTEXT
    • MySQL DATE_ADD()
    • MySQL sum()
    • MySQL Merge
    • MySQL BigInt
    • MySQL ROUND
    • MySQL VARCHAR
    • MySQL Decimal
    • MySQL Limit
    • MySQL today()
    • MySQL WEEKDAY
    • MySQL Split
    • MySQL Create Function
    • MySQL BLOB
    • MySQL encode()
    • MySQL Primary Key
    • MySQL Foreign Key
    • Unique Key in MySQL
    • MySQL Drop Foreign Key
    • MySQL DROP TRIGGER
    • MYSQL Database
    • Delete Database MySQL
    • MySQL Root
    • MySQL Root Password
    • MySQL Client
    • MySQL Users
    • MySQL?User Permissions
    • MySQL add user
    • MySQL List User
    • MySQL Show Users
    • MySQL User Password
    • MySQL?Cardinality
    • MySQL Workbench
    • MySQL Backup
    • MySQL REVOKE
    • MySQL Dump
    • MySQL Cluster
    • MySQL Partitioning
    • MySQL Full Text Search
    • MySQL Admin Tool
    • MySQL Export Database
    • MySQL Export to CSV
  • Joins
    • Joins in MySQL
    • MySQL Outer Join
    • Left Outer Join in MySQL
    • MySQL Self Join
    • Natural Join in MySQL
    • MySQL DELETE JOIN
    • MySQL Update Join
    • MySQL Cross Join
  • Advanced
    • MySQL Formatter
    • MySQL TINYINT
    • MySQL Grant All Privileges
    • MySQL DROP TABLE
    • MySQL rename database
    • MySQL Flush Privileges
    • MySQL super Privilege
    • MySQL Character Set
    • MySQL Log File
    • MySQL Flush Log
    • Grant Privileges MySQL
    • MySQL WHILE LOOP
    • IF Statement in MySQL
    • MySQL CASE Statement
    • MySQL IF Function
    • MySQL IF EXISTS
    • MySQL UUID
    • Views in MySQL
    • MySQL Replication
    • MySQL Partition
    • Toad for MySQL
    • Navicat for MySQL
    • MySQL AES_Encrypt
    • MySQL Performance Tuning
    • MySQL Transaction
    • MySQL? sort_buffer_size
    • MySQL? Sync
    • MySQL? Query Cache
    • MySQL Collation
    • MySQL ODBC Driver
    • MySQL Partitioning
    • MySQL InnoDB
    • MySQL Float vs Decimal
    • MySQL Union vs Union All
  • Interview Questions
    • MySQL Interview Questions

Related Courses

MS SQL Certification Courses

Oracle Certification Courses

PL/SQL Certification Courses

Cheat Sheet MySQL

By Priya PedamkarPriya Pedamkar

Cheat Sheet MySQL

Introduction to Cheatsheet MySQL

MySQL is an open-source database management system. Cheatsheet MySQL has a lot of features, which make it more flexible and extensible. MySQL is free and it means no need to pay for using it. It has the capacity to handle the large sets of the functionality of the expensive and powerful database packages. It mainly works quickly and well with a large set of data. One of the great features of cheat sheet MySQL is customizable, it can be modified into specific environments.

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,700 ratings)

MySQL

MySQL mainly works well with various programming languages like C, PHP, Perl, etc. PHP is mainly used with MySQL only. It is a most reliable database and it gives great and performance and ensures the security of data while connecting with programming language through different modes. MySQL is referred to as a relational database management system (RDBMS). MySQL database is mainly available only in one language that is the English language. It was developed by Oracle Corporation and released in the year 1995. It supports multiple operating systems like Windows, Mac OS, Linux, Solaris, Free BSD, etc. C and C++ were used for developing MySQL.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Commands and Content on Cheat Sheet MySQL

Cheatsheet MySQL has an extensive library, scalable, extendable, interactive, and contains many in-built methods to compute common operations. There are different commands available to perform command-line operations and each command has both short and long-form. The long-form is not case-sensitive but the short form is case-sensitive. Below are the Cheatsheet MySQL commands mentioned which perform different kinds of operations:

COMMAND DESCRIPTION
help, \h, \? It will display the available MySQL commands
Clear, \c It clears the user input
Connect,\r Connect to the server.
Delimiter, \d It set the statement delimiter.
Edit, \e Edit the command with $EDITOR.
Ego,\G It displays the result vertically.
Exit, \q It will exit or quit or close the MySQL.
Go,\g It will send a command to the SQL server.
Nopager, \n It displays the pager, print to stdout.
Notee, \t Don’t write to outfile.
Pager,\P Set pager and print the results via pager.
Print, \p It will print the current command
Prompt, \R Change the MySQL prompt.
Rehash, \# Rebuild completion hash.
Tee,\T Set outfile and append into outfile
Source, \. Execute an SQL script file.
Status, \s It will get the information of status from the server
System, \! Execute the system shell command
Use, \u Use another database, with help of DB name as an argument.
Charset, \C Defining the charset.
Warnings, \W It will show a warning at end of each statement.
Nowarning,\w It will not show a warning after every statement.
Resetconnection, \x It will clean the session context.

Data types: MySQL has different data types used for inserting the specific values in database columns. For integer using ‘int’. Similarly, other like float, double, timestamp, char, varchar, blob, enum is being used for inserting the specific values.

String functions: There are string functions available for using as well:

String function DESCRIPTION
strcmp(s1, s2) Comparing the strings
Lower(s) Convert to lowercase
Upper(s) Convert to upper case
Substring(s, index1, index2) Taking the substring od string
Ltrim(s) Left-trim
Curdate() Get today’s date
Curtime() Get the time.
Dayname(s) If we have to extract the name of the day.
Dayofweek(s) Extract the particular day number.
Monthname(s) If a month needs to be extracted.

Mathematical Functions: – The different functions available in MySQL’s math module are:

FUNCTION DESCRIPTION
COUNT(*) Count the rows per group
AVG(column) The average value of a group
MIN(column) A minimum value of a group
MAX(column) A maximum value of a group
SUM(column) Sum values in group
Abs(number) Absolute value
Round(number) Rounding number
Floor(number) The number is the largest integer but not greater
Ceiling(number) Smallest integer not smaller
Sqrt(number) Square root
Pow(base, exponent) nth power
Rand() Random number
Sin(number) Sin function
Cos(number) Cos function

Free Tips and Tricks of using Cheatsheet MySQL Commands

  1. In cheat sheet MySQL, if a list of all databases is required then use the command ‘SHOW DATABASES;’ to get the available databases.
  2. To create the database, ‘CREATE DATABASE dbname;’ command is used to create a new database.
  3. To use the particular database, command ‘USE database;’ is used.
  4. The ‘SHOW TABLES;’ command needs to use the list of all tables in the MySQL database.
  5. ‘Describe table; Show Columns from a table;’ commands are used to show the structure of the table.
  6. ‘DROP DATABASE dbname;’ command is used to delete a database. Please be careful in using this command, after executing the rollback cannot be done.
  7. If duplicate data is not required while selecting the data from a table, the DISTINCT keyword should be used to not to repeat the duplicate data. A query can be: Select a DISTINCT column from a table;
  8. There are other queries as well for Inserting, updating, deleting, ordering, grouping the columns, joins of two or more tables. These make the data processing faster and retrieved easily.
  • Inserting: Insert into table values (v1, v2);
  • Inserting column: Alter table tablename ADD column columntypeoptions;
  • Updating: update table set column1=x where 1=1 (conditions);
  • Deleting: Delete from table where 1=1(conditions);
  • Deleting the column: Alter table tablename Drop column columname;
  1. If there is forgot root password, use below commands:

$ /etc/init.d/mysql stop

$ mysqld_safe –skip-grant-tables &

$ mysql # on another terminal

mysql> UPDATE mysql.user SET password=PASSWORD(‘P@SSW0rd’) WHERE user=’root’;

$ /etc/init.d/mysql start

  1. If the table needs to repair after a shutdown is not proper:

mysqlcheck –all-databases –fast

  1. If the data needs to be loaded from the file, use the below command:

mysql> SOURCE input_file

$ mysql database < filename.sql

$ cat filename.sql | mysql database

Conclusion

Cheat sheet MySQL is easy to use and its syntax is easier to remember and the queries cane written easily. It can be used with any web technology to store the data. It is secure and faster to perform. Its structure is easy to work on and understand. The simple language is used which makes it easier to learn for beginners.

MySQL is mainly used for UNIX like operating systems and is integrated very easily. This can be used on cloud platforms, which is the latest thing in the market. It can be easily moved or hosted on Amazon or Azure cloud platform services.

Recommended Articles

This has been a guide to Cheatsheet MySQL here we have discussed the content and command as well as free tips and tricks of cheat sheet MySQL. you may also look at the following article to learn more –

  1. Cheat sheet for UNIX
  2. Cheat Sheet CCNA
  3. Cheat Sheet Java
  4. Cheat sheet CSS3
Popular Course in this category
SQL Training Program (7 Courses, 8+ Projects)
  7 Online Courses |  8 Hands-on Projects |  73+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

MS SQL Training (16 Courses, 11+ Projects)4.9
Oracle Training (14 Courses, 8+ Projects)4.8
PL SQL Training (4 Courses, 2+ Projects)4.7
5 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more