
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can I view cascades in MySQL?
To view cascades, use SHOW CREATE TABLE in MySQL. Let us first create a table −
mysql> create table DemoTable1378 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> EmployeeId varchar(20), -> EmployeeFirstName varchar(20), -> EmployeeLastName varchar(20), -> EmployeeCountryName varchar(40), -> EmployeeAge int, -> EmployeeSalary int, -> UNIQUE(EmployeeFirstName,EmployeeSalary), -> INDEX First_Last_NameIndex(EmployeeFirstName,EmployeeLastName) -> ); Query OK, 0 rows affected (0.93 sec)
Let us now view cascades in MySQL −
mysql> show create table DemoTable1378;
This will produce the following output −
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | DemoTable1378 | CREATE TABLE `demotable1378` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `EmployeeId` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `EmployeeFirstName` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `EmployeeLastName` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `EmployeeCountryName` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `EmployeeAge` int(11) DEFAULT NULL, `EmployeeSalary` int(11) DEFAULT NULL, PRIMARY KEY (`Id`), UNIQUE KEY `EmployeeFirstName` (`EmployeeFirstName`,`EmployeeSalary`), KEY `First_Last_NameIndex` (`EmployeeFirstName`,`EmployeeLastName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | +---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.02 sec)
- Related Articles
- How can I view the indexes I have set up in MySQL?
- How do I create a view in MySQL?
- How can we create a MySQL view based on another existing view?
- How can we modify a MySQL view with CREATE OR REPLACE VIEW statement?
- How can I dynamically set the position of view in android?
- How can we update any value in MySQL view as we can update the values in MySQL table?
- How do I view the auto_increment value for a table in MySQL?
- How can we drop a MySQL view from the database?
- How can we create a MySQL view with LEFT JOIN?
- How can we create a MySQL view with INNER JOIN?
- How can we create a MySQL view with RIGHT JOIN?
- How can we create a MySQL view with a subquery?
- How can I tell if table row is in view using jQuery?
- How do I see what a MySQL view is made of?
- How can we create a MySQL view with GROUP BY clause?

Advertisements