Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql show foreign keys

SELECT 
  TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_SCHEMA = '<database>' AND
  REFERENCED_TABLE_NAME = '<table>';
Comment

mysql show foreign keys column

SELECT 
  TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_SCHEMA = '<database>' AND
  REFERENCED_TABLE_NAME = '<table>' AND
  REFERENCED_COLUMN_NAME = '<column>';
Comment

PREVIOUS NEXT
Code Example
Sql :: close external port 3306 with iptables 
Sql :: sql server update top n records 
Sql :: soql update query 
Sql :: concat all rows in sql postgres 
Sql :: alter table query in mysql 
Sql :: sql insert into statement 
Sql :: alter boolean column postgresql 
Sql :: Drop check constraint in ms sql 
Sql :: Write SQL in ruby on rails 
Sql :: count weekend days between two dates sql 
Sql :: sql server python connection 
Sql :: list mysql tables and views 
Sql :: count sql 
Sql :: get month sql 
Sql :: pl sql create function 
Sql :: how to find first 3 highest salary in sql 
Sql :: sql server inner join convert collation 
Sql :: connect to mysql server mac terminal 
Sql :: create postgres role and database for bitbucket 
Sql :: switch users mysql 
Sql :: sql server fn_dblog 
Sql :: tsql generate rows 
Sql :: Question 7: Write an SQL query to print details of the Workers who have joined in Feb’2014. 
Sql :: delete row mysql 
Sql :: To log postgres db in without a password 
Sql :: use of undefined constant mysql_assoc - assumed 
Sql :: take sql dump in to file 
Sql :: create a table from one field of another table 
Sql :: postgres advance table id count 
Sql :: mysql select non integer values 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =