<< < 1 2 3 4 5 > >>   Sort: Date

How To Name Query Output Columns
How To Name Query Output Columns? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries Each column in the query output has a default name. If you don't like the default name, you can specify a new name for any column in the query output by using the AS clause. The following statement shows ...
2007-05-11, 4876👍, 0💬

How To Add a New Column to an Existing Table
How To Add a New Column to an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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 ...
2007-05-11, 4875👍, 0💬

Can Group Functions Be Used in the ORDER BY Clause
Can Group Functions Be Used in the ORDER BY Clause? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If the query output is aggregated as groups, you can sort the groups by using group functions in the ORDER BY clause. The following statement returns how many links were created in each year ...
2007-05-11, 4866👍, 0💬

Can the Query Output Be Sorted by Multiple Columns
Can the Query Output Be Sorted by Multiple Columns? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value: mysql> SELECT ...
2007-05-11, 4850👍, 0💬

What Are the Differences between BINARY and VARBINARY
What Are the Differences between BINARY and VARBINARY? - MySQL FAQs - Introduction to SQL Basics Both BINARY and VARBINARY are both binary byte data types. But they have the following major differences: BINARY stores values in fixed lengths. Values are padded with 0x00. VARBINARY stores values in va...
2007-05-11, 4836👍, 0💬

How To Use Values from Other Tables in UPDATE Statements
How To Use Values from Other Tables in UPDATE Statements? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to update values in one table with values from another table, you can use a subquery as an expression in the SET clause. The subquery should return only one row...
2007-05-11, 4814👍, 0💬

How To Drop an Existing Index
How To Drop an Existing Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you don't need an existing index any more, you should delete it with the "DROP INDEX indexName ON tableName" statement. Here is an example SQL script: mysql> DROP INDEX tip_subject ON tip; Query OK, ...
2007-05-11, 4810👍, 0💬

How To Use Group Functions in the SELECT Clause
How To Use Group Functions in the SELECT Clause? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If group functions are used in the SELECT clause, they will be used on the rows that meet the query selection criteria, the output of group functions will be returned as output of the query. The...
2007-05-11, 4804👍, 0💬

Is the Order of Columns in the SET Clause Important
Is the Order of Columns in the SET Clause Important? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements Yes. The order of columns in the SET clause of the UPDATE statement is important. There is a BIG DIFFERENCE between MySQL and Oracle on update columns with previous values: Orac...
2007-05-11, 4791👍, 0💬

How To Add More Data to the Testing Table
How To Add More Data to the Testing Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to continue with other tutorial exercises in this FAQ collection, you need to add more data to the testing table. Follow the script below to add a new column and : mysql> ALTER TABLE fyi_l...
2007-05-11, 4778👍, 0💬

How To Update Values on Multiple Rows
How To Update Values on Multiple Rows? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows. This rule allows you to update values on multiple rows in a single UPDATE statement...
2007-05-11, 4768👍, 0💬

How To Insert a New Row into a Table
How To Insert a New Row into a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements To insert a new row into a table, you should use the INSERT INTO statement with values specified for all columns as shown in the following example: mysql> INSERT INTO fyi_links VALUES (101, 'd...
2007-05-11, 4768👍, 0💬

How To Select Some Columns from a Table
How To Select Some Columns from a Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want explicitly tell the query to return some columns, you can specify the column names in the SELECT clause. The following select statement returns only two columns, "id" and "url" from the tabl...
2007-05-11, 4765👍, 0💬

How To Create a Table Index
How To Create a Table Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have a table with a lots of rows, and you know that one of the columns will be used often as a search criteria, you can add an index for that column to improve the search performance. To add an ind...
2007-05-11, 4759👍, 0💬

How To See the CREATE TABLE Statement of an Existing Table
How To See the CREATE TABLE Statement of an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to know how an existing table was created, you can use the "SHOW CREATE TABLE" command to get a copy of the "CREATE TABLE" statement back on an existing table. T...
2007-05-11, 4758👍, 0💬

How To Drop an Existing View
How To Drop an Existing View? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing view, and you don't want it anymore, you can delete it by using the "DROP VIEW viewName" statement as shown in the following script: mysql> DROP VIEW faqComment; Query OK, 0 rows ...
2007-05-11, 4756👍, 0💬

How To Delete Multiple Rows from a Table
How To Delete Multiple Rows from a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements You can delete multiple rows from a table in the same way as deleting a single row, except that the WHERE clause will match multiple rows. The tutorial exercise below deletes 3 rows from t...
2007-05-11, 4752👍, 0💬

What Are Date and Time Data Types
What Are Date and Time Data Types? - MySQL FAQs - Introduction to SQL Basics 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:...
2007-05-11, 4752👍, 0💬

How To Specify Default Values in INSERT Statement
How To Specify Default Values in INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial ...
2007-05-11, 4746👍, 0💬

How To Create a Testing Table with Test Data
How To Create a Testing Table with Test Data? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to follow the tutorial exercises presented in this collection, you need to create a testing table and insert some test data, as shown in the following sample script: mysql> CREATE TABLE...
2007-05-11, 4741👍, 0💬

What Are DML Statements
What Are DML Statements? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements DML (Data Manipulation Language) statements are statements to change data values in database tables. The are 3 primary DML statements: INSERT - Inserting new rows into database tables. UPDATE - Updating ex...
2007-05-11, 4737👍, 0💬

How To Use CASE Expression
How To Use CASE Expression? - MySQL FAQs - Introduction to SQL Basics 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 bas...
2007-05-11, 4734👍, 0💬

How To Convert Character Strings to Numeric Values
How To Convert Character Strings to Numeric Values? - MySQL FAQs - Introduction to SQL Basics 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) F...
2007-05-11, 4733👍, 0💬

What Are Group Functions
What Are Group Functions? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY Group functions are functions applied to a group of rows. Examples of group functions are: COUNT(*) - Returns the number of rows in the group. MIN(exp) - Returns the minimum value of the expression evaluated on each r...
2007-05-11, 4729👍, 0💬

<< < 1 2 3 4 5 > >>   Sort: Date