Category: My SQL
-
MySQL DROP
DROP TABLE In MySQL, DROP TABLE command removes one or more tables from an existing database. The user who is using the DROP command, must have DROP privilege for each table(s) he wants to drop. The command removes all the data and table definition from the database. Syntax:DROP [TEMPORARY] TABLE [IF EXISTS] table_name [, table_name]…
-
MySQL SHOW COMMANDS
SHOW COMMANDS There are various forms of MySQL SHOW commands, which provides information about databases, tables, columns, or status information about the commands. See the following section: Version: MySQL 5.6 Table of contents MySQL SHOW RELAYLOG EVENTS MySQL SHOW BINARY LOGS MySQL SHOW ERRORS MySQL SHOW SLAVE HOSTS MySQL SHOW BINLOG EVENTS MySQL SHOW EVENTS…
-
MySQL Security
Security Database security entails allowing or disallowing user actions on the database and the objects within it. When you will create an database application, the security policy is the first step. An application security policy is a list of application security requirements and rules that regulate user access to database objects. This chapter discusses aspects…
-
MySQL Views
Views View is a data object which does not contain any data. Contents of the view are the resultant of a base table. They are operated just like base table but they don’t contain any data of their own. The difference between a view and a table is that views are definitions built on top…
-
MySQL Transaction
Introduction on Transaction A transaction is a logical unit of work that contains one or more SQL statements. Transactions are atomic units of work that can be committed or rolled back. When a transaction makes multiple changes to the database, either all the changes succeed when the transaction is committed, or all the changes are undone when…
-
MySQL Triggers
Introduction on Triggers A trigger is a set of actions that are run automatically when a specified change operation (SQL INSERT, UPDATE, or DELETE statement) is performed on a specified table. Triggers are useful for tasks such as enforcing business rules, validating input data, and keeping an audit trail. Contents: Uses for triggers: Benefits of…
-
MySQL Stored Procedure
Stored Procedure A procedure (often called a stored procedure) is a subroutine like a subprogram in a regular computing language, stored in database. A procedure has a name, a parameter list, and SQL statement(s). All most all relational database system supports stored procedure, MySQL 5 introduce stored procedure. In the following sections we have discussed…
-
MySQL Subqueries
Subqueries A subquery is a SQL query nested inside a larger query. Contents: MySQL Subqueries with EXISTS or NOT EXISTS MySQL Correlated Subqueries MySQL Subqueries in the FROM Clause Subquery Syntax: Subquery syntax as specified by the SQL standard and supported in MySQLDELETE FROM t1 WHERE s11 > ANY (SELECT COUNT(*) /* no hint */…
-
MySQL JOINS
Understanding JOINs in MySQL A join enables you to retrieve records from two (or more) logically related tables in a single result set. JOIN clauses are used to return the rows of two or more queries using two or more tables that shares a meaningful relationship based on a common set of values. These values…
-
Find duplicate data in MySQL
Objective There are many occasions when you need to find duplicate values available in a column of a MySql table. Often, you may want to count the number of duplicate values in a MySQL table. In this article, we have discussed a query where you can find duplicates, triplicates, quadruplicates (or more) data from a MySQL…