![]() ![]() You can save the cheat sheet in PDF format by clicking the Download MySQL Cheat Sheet button below. This article includes a one-page MySQL commands reference sheet. NULLIF – If the first argument is equal to the second argument, the result returns NULL (if not, it returns the first argument).IFNULL – Return the first argument if it is NOT NULL (or the second if it is).IF – Return a value based on a specified condition.CASE – A case operator that allows you to add if-else logic to a query.IS_NOT_NULL – Test for NOT NULL values.BETWEEN.AND – Value is within the specified range.>= – Value is greater than or equal to.TRIM– Return a string without any prefixes or suffixes.LOG– Returns the natural logarithm of a specified number.BIN– Return a binary representation of a number.ASCII– Return ASCII value of left-most character.TRUNCATE– Truncate a number to the specified number of decimal places.DATE_FORMAT – Format a date based on the specified format. Creates a backup of a set of SQL statements that can be used to recreate the original database object definitions and table data.DATE_SUB – Subtract a time/date interval from a data value.DATE_ADD – Add a time/date interval to a date value.DAY– Return the day of the month of the specified date.These are the most commonly used MySQL commands and statements that will help you work with MySQL. DATEDIFF– Calculate the number of days between two dates. MYSQL Cheatsheet a quick and easy way to memorize MYSQL code.Some of the most commonly used MySQL functions include: These functions allow you to manipulate data. MySQL comes with many built-in functions. Note: Instead of setting up a separate MySQL server, you can also deploy MySQL in a Docker container. TEXT– Stores character strings, typically those with in a longer form (up to 65535 characters).DATETIME– Contains both date and time, but has a range from 00:00:01' UTC to ' 03:14:07' UTC.DATE– Stores data values in the format YYYY-MM-DD. ![]() VARCHAR– Variable-length strings that specify the maximum number of characters it stores (up to 65535).CHAR- Fixed-length character strings that specify the maximum number of characters it stores (up to 254 characters).DECIMAL- Exact decimal values specified in the format (M, D) the maximum number of digits for M is 65, while for D it is 35.Use MySQL data types to specify what kind of value the column will store. When creating columns in a table, you need to specify their name and data type. Working With Views in MySQLĬreate a view (virtual table) with the specified content: CREATE VIEW view_name ASĭelete a view: DROP VIEW view_name MySQL Data Types Learn how to backup and restore a MySQL database. ![]()
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |