<< < 1 2 3 4 5 6 7 8 9 > >>   ∑:316  Sort:Rank

Entering Boolean Values in MySQL
How To Enter Boolean Values in SQL Statements in MySQL? If you want to enter Boolean values in SQL statements, you use (TRUE), (FALSE), (true), or (false). Here are some good examples: SELECT TRUE, true, FALSE, false FROM DUAL; +------+------+-------+------- +| TRUE | TRUE | FALSE | FALSE | +------+...
2018-03-31, 1454🔥, 0💬

Entering Numeric Values in MySQL
How To Include Numeric Values in SQL statements in MySQL? If you want to include a numeric value in your SQL statement, you can enter it directly as shown in the following examples: SELECT 255 FROM DUAL; -- An integer 255 SELECT -6.34 FROM DUAL; -- A regular number -6.34 SELECT -32032.6809e+10 FROM ...
2018-03-31, 1398🔥, 0💬

Entering Numeric Values as HEX Numbers in MySQL
How To Enter Numeric Values as HEX Numbers in MySQL? If you want to enter numeric values as HEX numbers, you can quote HEX numbers with single quotes and a prefix of (X), or just prefix HEX numbers with (0x). A HEX number string will be automatically converted into a numeric value, if the expression...
2018-03-31, 1343🔥, 0💬

Converting Numeric Values to Character Strings in MySQL
How To Convert Numeric Values to Character Strings in MySQL? You can convert numeric values to character strings by using the CAST(value AS CHAR) function as shown in the following examples: SELECT CAST(4123.45700 AS CHAR) FROM DUAL; 4123.45700 -- How to get rid of the last 2 '0's? SELECT CAST(4.123...
2018-03-28, 3019🔥, 0💬

Converting Character Strings to Numeric Values in MySQL
How To Convert Character Strings to Numeric Values in MySQL? You can convert character strings to numeric values by using the CAST(string AS DECIMAL) or CAST(string AS SIGNED INTEGER) function as shown in the following examples: SELECT CAST('4123.45700' AS DECIMAL) FROM DUAL; 4123.46 -- Very poor co...
2018-03-28, 1464🔥, 0💬

Using IN Conditions in MySQL
How To Use IN Conditions in MySQL? An IN condition is single value again a list of values. It returns TRUE, if the specified value is in the list. Otherwise, it returns FALSE. Some examples are given in the tutorial exercise below: SELECT 3 IN (1,2,3,4,5) FROM DUAL; 1 SELECT 3 NOT IN (1,2,3,4,5) FRO...
2018-03-28, 1454🔥, 0💬

What Is NULL Value in MySQL
What Are NULL Values in MySQL? NULL is a special value that represents no value. Here are basic rules about NULL values: NULL presents no value. NULL is not the same as an empty string ''. NULL is not the same as a zero value 0. NULL can be used as any data type. NULL should not be used in any compa...
2018-03-28, 1446🔥, 0💬

Expressions with NULL Values in MySQL
What Happens If NULL Values Are Involved in Expressions in MySQL? If NULL values are used in expressions, the resulting values will be NULL values. In other words: Arithmetic expressions with NULL values result NULL values. Comparison expressions with NULL values result NULL values. Logical expressi...
2018-03-28, 1352🔥, 0💬

Using CASE Expression in MySQL
How To Use CASE Expression in MySQL? There are 2 ways to use the CASE expression. The first way is to return one of the predefined values based on the comparison of a given value to a list of target values. The second way is to return one of the predefined values based on a list of conditions. Here ...
2018-03-24, 1580🔥, 0💬

Using Regular Expression with REGEXP in MySQL
How To Use Regular Expression in Pattern Match Conditions in MySQL? If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern condition: REGEXP. The following tutorial exercise provides you some good examples: SELECT 'FYICenter.com' REGEXP '.*fyi.*' FRO...
2018-03-24, 1501🔥, 0💬

What are Date and Time Data Types in MySQL
What Are Date and Time Data Types in MySQL? MySQL supports the following date and time data types: DATE - A date in the range of '1000-01-01' and '9999-12-31'. Default DATE format is "YYYY-MM-DD". DATETIME - A date with the time of day in the range of '1000-01-01 00:00:00' and '9999-12-31 23:59:59'....
2018-03-24, 1468🔥, 0💬

Using LIKE Conditions in MySQL
How To Use LIKE Conditions in MySQL? A LIKE condition is also called pattern patch. There are 3 main rules on using LIKE condition: '_' is used in the pattern to match any one character. '%' is used in the pattern to match any zero or more characters. ESCAPE clause is used to provide the escape char...
2018-03-24, 1284🔥, 0💬

Date and Time Functions in MySQL
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time values: ADDDATE(date, INTERVAL expr unit) - Adding days to a date. Same as DATE_ADD(). ADDTIME(time1, time2) - Adding two time values together. CURDATE() - Returning the current date. Same as CURRENT_DATE...
2018-03-13, 3368🔥, 0💬

CREATE, ALTER and DROP Statements in MySQL
Where to find answers to frequently asked questions on CREATE, ALTER and DROP Statements in MySQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on CREATE, ALTER and DROP Statements in MySQL. Clear answers are provided with tutorial exercises on cr...
2018-03-13, 3118🔥, 0💬

Ways to Get the Current Time in MySQL
How Many Ways to Get the Current Time in MySQL? There are 8 ways to get the current time: SELECT NOW() FROM DUAL; 2006-07-01 10:02:41 SELECT CURRENT_TIME() FROM DUAL; 10:02:58 SELECT SYSDATE() FROM DUAL; 2006-07-01 10:03:21 mysql&gt; SELECT CURRENT_TIMESTAMP() FROM DUAL; 2006-07-01 10:04:03 SELE...
2018-03-13, 2770🔥, 0💬

What Is TIMESTAMP Data Type in MySQL
What Is TIMESTAMP Data Type in MySQL? A TIMESTAMP data type allows you to record a date and time like DATETIME data type. But it has some interesting features when used on a table column: The first TIMESTAMP column in a table will be assigned with the current date and time, if it is not listed in an...
2018-03-13, 1676🔥, 0💬

Extract Unit Values from a Date and Time in MySQL
How To Extract a Unit Value from a Date and Time in MySQL? If you want to extract a specific date or time unit value out of a date or a time, you can use the EXTRACT(unit FROM expression) function. The tutorial exercise below gives you some good examples: ELECT EXTRACT(DAY FROM NOW()) FROM DUAL; 28 ...
2018-03-13, 1520🔥, 0💬

CREATE Command Denied Error in MySQL
What Happens If You No CREATE Privilege in a Database in MySQL? In order to create tables in a database, your user account must have the CREATE privilege for that database. Otherwise you will get an error as shown in the following tutorial exercise: &gt;cd \mysql\bin &gt;mysql -u guest -ppub...
2018-03-10, 2336🔥, 0💬

Show All Columns of an Existing Table in MySQL
How To Get a List of Columns in an Existing Table in MySQL? If you have an existing table, but you don't remember what are the columns used in the table, you can use the "SHOW COLUMNS FROM tableName" command to get a list of all columns of the specified table. You can also use the "DESCRIBE tableNam...
2018-03-10, 1968🔥, 0💬

What Are DDL Statements in MySQL
What Are DDL Statements in MySQL? DDL (Data Definition Language) statements are statements to create and manage data objects in the database. The are 3 primary DDL statements: CREATE - Creating a new database object. ALTER - Altering the definition of an existing data object. DROP - Dropping an exis...
2018-03-10, 1551🔥, 0💬

Show All Tables in a Database in MySQL
How To Get a List of All Tables in a Database in MySQL? If you want to see the table you have just created, you can use the "SHOW TABLES" command to get a list of all tables in database. The tutorial script gives you a good example: mysql&gt; SHOW TABLES; +---------------+ | Tables_in_fyi | +---...
2018-03-10, 1500🔥, 0💬

CREATE TABLE Statement in MySQL
How To Create a New Table in MySQL? If you want to create a new table, you can use the "CREATE TABLE" statement. The following tutorial script shows you how to create a table called "tip": mysql&gt; CREATE TABLE tip (id INTEGER PRIMARY KEY, subject VARCHAR(80) NOT NULL, description VARCHAR(256) ...
2018-03-10, 1445🔥, 0💬

Rename an Existing Column in a Table in MySQL
How To Rename an Existing Column in a Table in MySQL? If you have an existing column in a table and you want to change the column name, you can use the "ALTER TABLE ... CHANGE" statement. This statement allows you to change the name of a column, and its definition. The tutorial script below gives yo...
2018-03-04, 1654🔥, 0💬

Add a New Column to an Existing Table in MySQL
How To Add a New Column to an Existing Table in MySQL? If you have an existing table with existing data rows, and want to add a new column to that table, you can use the "ALTER TABLE ... ADD COLUMN" statement. The tutorial script below shows you a good example: mysql&gt; ALTER TABLE tip ADD COLU...
2018-03-04, 1580🔥, 0💬

<< < 1 2 3 4 5 6 7 8 9 > >>   ∑:316  Sort:Rank