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

How To Insert Multiple Rows with One INSERT Statement
How To Insert Multiple Rows with One INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to insert multiple rows with a single INSERT statement, you can use a subquery instead of the VALUES clause. Rows returned from the subquery will be inserted the t...
2007-05-11, 4582👍, 0💬

How To Create a New Table by Selecting Rows from Another Table
How To Create a New Table by Selecting Rows from Another Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements Let's say you have a table with many data rows, now you want to create a backup copy of this table of all rows or a subset of them, you can use the "CREATE TABLE ... SEL...
2007-05-11, 4582👍, 0💬

How To Update Values in a Table
How To Update Values in a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to update some values in one row or multiple rows in a table, you can use the UPDATE statement. The tutorial script below shows a good example: mysql> UPDATE fyi_links SET counts = 999,...
2007-05-11, 4580👍, 0💬

What Happens If You No CREATE Privilege in a Database
What Happens If You No CREATE Privilege in a Database? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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 ex...
2007-05-11, 4568👍, 0💬

How To Filter Out Duplications in the Returning Rows
How To Filter Out Duplications in the Returning Rows? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If there are duplications in the returning rows, and you want to remove the duplications, you can use the keyword DISTINCT in the SELECT clause. The DISTINCT applies to the combination of a...
2007-05-11, 4566👍, 0💬

How To Write a Query with a Left Outer Join
How To Write a Query with a Left Outer Join? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want to query from two tables with a left outer join, you can use the LEFT OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a left outer join from two...
2007-05-11, 4557👍, 0💬

How To Get a List of Columns in an Existing Table
How To Get a List of Columns in an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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 th...
2007-05-11, 4554👍, 0💬

What Are String Data Types
What Are String Data Types? - MySQL FAQs - Introduction to SQL Basics MySQL supports the following string data types: CHAR(n) same as CHARACTER(n) - Fixed width and " " padded characters strings. Default character set is ASCII. NCHAR(n) same as NATIONAL CHARACTER(n) - Fixed width and " " padded char...
2007-05-11, 4550👍, 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, 4548👍, 0💬

How To Delete an Existing Row from a Table
How To Delete an Existing Row from a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to delete an existing row from a table, you can use the DELETE statement with a WHERE clause to identify that row. Here is good sample of DELETE statements: mysql> INSERT INT...
2007-05-11, 4532👍, 0💬

Can SELECT Statements Be Used on Views
Can SELECT Statements Be Used on Views? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY Select (query) statements can be used on views in the same way as tables. The following tutorial exercise helps you creating a view and running a query statement on the view: mysql> CREATE VIEW myLinks A...
2007-05-11, 4529👍, 0💬

How To Get a List of All Tables in a Database
How To Get a List of All Tables in a Database? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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> SH...
2007-05-11, 4529👍, 0💬

How To Use LIKE Conditions
How To Use LIKE Conditions? - MySQL FAQs - Introduction to SQL Basics 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 i...
2007-05-11, 4529👍, 0💬

What Are DDL Statements
What Are DDL Statements? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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 defi...
2007-05-11, 4521👍, 0💬

How To Create a New Table
How To Create a New Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements 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> CREATE TABLE tip (id INTEGER PRIMARY KEY, subj...
2007-05-11, 4501👍, 0💬

How To Drop an Existing Table
How To Drop an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below: mysql> SELECT * FROM tipBackup; +----+-------------+---------- ---...
2007-05-11, 4497👍, 0💬

How To Delete an Existing Column in a Table
How To Delete an Existing Column in a Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing column in a table and you do not need that column any more, you can delete it with "ALTER TABLE ... DROP COLUMN" statement. Here is a tutorial script to delete an e...
2007-05-11, 4495👍, 0💬

How Many Groups of Data Types
How Many Groups of Data Types? - MySQL FAQs - Introduction to SQL Basics MySQL support 3 groups of data types as listed below: String Data Types - CHAR, NCHAR, VARCHAR, NVARCHAR, BINARY, VARBINARY, TINYBLOB, TINYTEXT, BLOB, TEXT, MEDIUMBLOB, MEDIUMTEXT, LONGBLOB, LONGTEXT, ENUM, SET Numeric Data Typ...
2007-05-11, 4487👍, 0💬

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

How To Rename an Existing Table
How To Rename an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to rename an existing table, you can use the "ALTER TABLE ... RENAME TO" statement. The tutorial script below shows you a good example: mysql> ALTER TABLE tip RENAME TO faq; Query OK, 0 ro...
2007-05-11, 4456👍, 0💬

How To Create a Testing Table
How To Create a Testing Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to practice DML statements, like INSERT, UPDATE and DELETE, you should create a testing table. The tutorial exercise shows you a good example: mysql> CREATE TABLE fyi_links (id INTEGER PR...
2007-05-11, 4456👍, 0💬

How To Join Two Tables in a Single Query
How To Join Two Tables in a Single Query? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries Two tables can be joined together in a query in 4 ways: Inner Join: Returns only rows from both tables that satisfy the join condition. Left Outer Join: Returns rows from both tables that satisfy ...
2007-05-11, 4454👍, 0💬

What Is a SELECT Query Statement
What Is a SELECT Query Statement? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY The SELECT statement is also called the query statement. It is the most frequently used SQL statement in any database application. A SELECT statement allows you to retrieve data from one or more tables or view...
2007-05-11, 4446👍, 0💬

How To Use IN Conditions
How To Use IN Conditions? - MySQL FAQs - Introduction to SQL Basics 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; ...
2007-05-11, 4443👍, 0💬

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