<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   ∑:321  Sort:Rank

What Are DML Statements in MySQL
What Are DML Statements in MySQL? 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 existing rows in database tables . DELETE - Deleting existing r...
2018-01-24, 1542🔥, 0💬

Drop an Existing View in MySQL
How To Drop an Existing View in MySQL? 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&gt; DROP VIEW faqComment; Query OK, 0 rows affected (0.00 sec) mysql&gt; SELECT * FROM faq...
2018-01-24, 1471🔥, 0💬

Creating a Test Table in MySQL
How To Create a Testing Table in MySQL? 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&gt; CREATE TABLE fyi_links (id INTEGER PRIMARY KEY, url VARCHAR(80) NOT NULL, notes VARCHAR(102...
2018-01-24, 1460🔥, 0💬

Create a New View in MySQL
How To Create a New View in MySQL? You can create a new view based on one or more existing tables by using the "CREATE VIEW viewName AS selectStatement" statement as shown in the following script: mysql&gt; CREATE TABLE comment (faqID INTEGER, message VARCHAR(256)); Query OK, 0 rows affected (0....
2018-01-24, 1444🔥, 0💬

Difference between BINARY and VARBINARY in MySQL
What Are the Differences between BINARY and VARBINARY in MySQL? 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 variable lengths. Values are not pa...
2018-01-19, 1906🔥, 0💬

Difference between CHAR and NCHAR in MySQL
What Are the Differences between CHAR and NCHAR in MySQL? Both CHAR and NCHAR are fixed length string data types. But they have the following differences: CHAR's full name is CHARACTER. NCHAR's full name is NATIONAL CHARACTER. By default, CHAR uses ASCII character set. So 1 character is always store...
2018-01-19, 1849🔥, 0💬

Difference between CHAR and VARCHAR in MySQL
What Are the Differences between CHAR and VARCHAR in MySQL? CHAR and VARCHAR are both ASCII character data types by default. But they have the following major differences: CHAR stores values in fixed lengths. Values are padded with space characters to match the specified length. VARCHAR stores value...
2018-01-19, 1723🔥, 0💬

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-01-19, 1673🔥, 0💬

Numeric Data Types in MySQL
What Are Numeric Data Types in MySQL? MySQL supports the following numeric data types: BIT(n) - An integer with n bits. BOOL same as BOOLEAN - Boolean values stored in 1 bit. TINYINT - A small integer stored in 1 byte. SMALLINT - A small integer stored in 2 bytes. MEDIUMINT - A medium integer stored...
2018-01-19, 1546🔥, 0💬

Omitting Columns in INSERT Statements in MySQL
How To Omit Columns with Default Values in INSERT Statement in MySQL? If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you can provide a column list in the INSERT statement. If a column...
2018-01-16, 1810🔥, 0💬

Using Column Default Values in MySQL
How To Specify Default Values in INSERT Statement in MySQL? 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 exercise gives a good example: mysql&gt; INSERT INTO fyi_...
2018-01-16, 1641🔥, 0💬

Violation of Unique Value Constraint in MySQL
What Happens If Unique Value Constraints Are Violated in MySQL? If you are inserting a new record that has values violating a unique constraint, you will get an error. Note that primary key column has a unique value constraint by default. The following tutorial exercise gives you some good examples:...
2018-01-16, 1558🔥, 0💬

Inserting a New Row into a Table in MySQL
How To Insert a New Row into a Table in MySQL? 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&gt; INSERT INTO fyi_links VALUES (101, 'dev.fyicenter.com', NULL, 0, '2006-04-30'); Query OK, 1...
2018-01-16, 1557🔥, 0💬

Insert Multiple Rows with 1 INSERT Statement in MySQL
How To Insert Multiple Rows with One INSERT Statement in MySQL? 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 target table. The following tutorial exercise gives a good exa...
2018-01-16, 1501🔥, 0💬

UPDATE Using Data from Other Tables in MySQL
How To Use Values from Other Tables in UPDATE Statements in MySQL? 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 for each row in the update table that matches the WHERE clau...
2018-01-13, 2097🔥, 0💬

Order of Columns in the SET Clause in MySQL
Is the Order of Columns in the SET Clause Important in MySQL? 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: Oracle provides you the existing values from the database on colu...
2018-01-13, 1585🔥, 0💬

Update Column Values on Multiple Rows in MySQL
How To Update Column Values on Multiple Rows in MySQL? 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. Here is a good example: mysql&gt; UPDATE fyi_lin...
2018-01-13, 1570🔥, 0💬

Use Existing Column Values in the SET Clause in MySQL
How To Use Existing Column Values in the SET Clause in MySQL? If a row matches the WHERE clause in a UPDATE statement, existing values in this row can be used in expressions to provide new values in the SET clause. Existing values are represented by column names in the expressions. The tutorial exer...
2018-01-13, 1561🔥, 0💬

Updating Values in a Table in MySQL
How To Update Values in a Table in MySQL? 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&gt; UPDATE fyi_links SET counts = 999, notes = 'Good.' WHERE id = 101; Query OK, 1 row affec...
2018-01-13, 1411🔥, 0💬

Error: Subquery Returns More than 1 Row in MySQL
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDATE statement, it must return exactly one row for each row in the update table that matches the WHERE clause. If it returns multiple rows, MySQL server will give you an error message. To test this out, ...
2018-01-08, 7192🔥, 0💬

UPDATE with Subquery Returning No Rows in MySQL
What Happens If the UPDATE Subquery Returns No Rows in MySQL? If you use a subquery to assign new values in the SET clause in an UPDATE statement, and the subquery returns no rows for an outer row, MySQL will provide a NULL value to the SET clause. The tutorial exercise below shows you a good exampl...
2018-01-08, 2203🔥, 0💬

Deleting Multiple Rows from a Table in MySQL
How To Delete Multiple Rows from a Table in MySQL? 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 the fyi_links table: mysql&gt; SELECT id, url, notes, coun...
2018-01-08, 1642🔥, 0💬

Deleting an Existing Row from a Table in MySQL
How To Delete an Existing Row from a Table in MySQL? 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&gt; INSERT INTO fyi_links (url, id) VALUES ('www.myspace.com', 301);...
2018-01-08, 1582🔥, 0💬

Deleting All Rows in a Table in MySQL
How To Delete All Rows in a Table in MySQL? If you want to delete all rows from a table, you have two options: Use the DELETE statement with no WHERE clause. Use the TRUNCATE TABLE statement. The TRUNCATE statement is more efficient the DELETE statement. The tutorial exercise shows you a good exampl...
2018-01-08, 1485🔥, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   ∑:321  Sort:Rank