Home Discussion Discuss: Mysql Alter Foreign Key

  • an error discussionHarish Gyanani February 15, 2013 at 1:29 PM

    publisher CREATE TABLE `publisher` ( `publisher_id` decimal(10,0) NOT NULL, `publisher_name` varchar(50) NOT NULL, `contact_name` varchar(50) default NULL, PRIMARY KEY (`publisher_id`); ) above query did not work,if we remove single quotes from table name and column names then it works right query is- CREATE TABLE publisher ( publisher_id decimal(10,0) NOT NULL, publisher_name varchar(50) NOT NULL, contact_name varchar(50) default NULL, PRIMARY KEY (publisher_id) );

  • About Foreign key constraintswati May 10, 2012 at 4:05 PM

    I have 2 tables,bus(bno int pk,capacity) & route(rno pk,source char(20)) having many to 1 relationship,but at the time table creation i forgot to add foreign key constraint so how to add fk constraint? please help me.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java Beginners

alter table add foreign key mysql
alter table add foreign key mysql  Hi, How to add foreign key in mysql using the query 'alter table add foreign key mysql' Thanks   Hi, We can use the following query: ALTER TABLE emp_address ADD FOREIGN KEY (emp_id 

SQL Tutorial

Mysql Alter Foreign Key
Mysql Alter Foreign Key     ... from 'Mysql Alter Foreign Key'. To understand with example we create a table... "book": Query to Alter table Book Add Foreign Key contraint: mysql> 

Mobile Applications Questions

Foreign key update table
Foreign key update table  How to update table that has the foreign key in SQL..?   ALTER TABLE YourTable ADD CONSTRAINT FK_YourForeignKey FOREIGN KEY (YourForeignKeyColumn) REFERENCES YourPrimaryTable 

JDBC Questions

how tohow to create a table with primary key and foreign keyhow to create a table with primary key and foreign key
how tohow to create a table with primary key and foreign keyhow to create a table with primary key and foreign key  how to create a table using java language with primary key and foreign key   Hi Friend, A foreign 

SQL Question

Foreign key in mysql
Foreign key in mysql  Hi I am creating a website and linking it to a database using php and mysql. I need to create the databases in phpmyadmin... the foreign key of one table into another table within phpmyadmin so the database 

SQL Question

foreign key error in sql
foreign key error in sql  create table matchdetails(mid varchar2(10... varchar2(10),sixes varchar2(10),primary key(mid.pid), foreign key(mid... on foreign key can any one tell me plz how to reference matchdetails 

Hibernate Questions

hibernate Foreign key
), KEY P_Id (P_Id), CONSTRAINT orders_ibfk_1 FOREIGN KEY (P_Id) REFERENCES... using set methods in orders table in feild P_Id which is foreign key. How to insert...hibernate Foreign key  sir, I am using hibernate in netbeans. I have 

JDBC Questions

crud operations with foreign key constraint.
crud operations with foreign key constraint.  I neeed to know how to perform crud operations in mysql with foreign key constraint using mvc architecture i.e using servlet jsp and bean. please provide all the code so that i can 

JDBC Questions

how to use foreign key in java
how to use foreign key in java  I have two tables in my MySQL... varchar(30), CONSTRAINT fkid FOREIGN KEY(idfk) REFERENCES table1(id) ON DELETE CASCADE ) The point is that table2 has a foreign key referencing the primary key 

Quartz Tutorials

SQL Alter Table Primary Key
SQL Alter Table Primary Key       Alter a Table Primary Key in SQL modifies the existing table... on which primary key is created. ALTER TABLE 

SQL Tutorial

SQL Alter Table Syntax
a index key on column of a table. Alter Table Name  | ADD [CONSTRAINT... on Primary Key. Alter Table Name  ADD FULLTEXT [INDEX|KEY... [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name 

SQL Tutorial

SQL Alter Column Syntax
name and add a index key on column of a table. Alter Table Name  | ADD... on Primary Key. Alter Table Name  ADD FULLTEXT [INDEX|KEY] [index_name](index_col... [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name 

SQL Tutorial

Mysql Alter Unique Key
Mysql Alter Unique Key       Mysql Alter Unique is used to change the table structure and add... with Example The Tutorial illustrate an example from 'Mysql Alter Unique Key 

SQL Tutorial

Mysql Alter Table Primary Key
Mysql Alter Table Primary Key       Mysql Alter Table Primary Key is used to remove... Alter Table Primary Key'. To understand this example, we create a table 

SQL Tutorial

Mysql Alter Column Primary Key
Mysql Alter Column Primary Key       Mysql Alter Column Primary Key is used to modify table... The Tutorial illustrate an example from 'Mysql Alter Column Primary Key 

SQL Tutorial

SQL Alter Table Primary Key tutorial
SQL Alter Table Primary Key       Alter a Table Primary Key in SQL modifies the existing table... on which primary key is created. ALTER TABLE 

SQL Tutorial

Mysql Alter Command
Mysql Alter Command       Mysql Alter Command define the list of Command used for removing... with Example The Tutorial illustrate an example from 'Mysql Alter Command 

Programming Tutorials

Mysql Alter Table
Mysql Alter Table       Mysql Alter Table is used to redefine the existing table. Understand with Example The Tutorial illustrate an example from 'Mysql Alter Table'. To grasp 

MySQL

Mysql Alter Autoincrement
Mysql Alter Autoincrement       Mysql Alter Autoincrement is used to modify the definition of ...; example from 'Mysql Alter Autoincrement'. To understand this example we create 

SQL Tutorial

Mysql Alter Table Identity
Mysql Alter Table Identity       Mysql Alter Table Identity is used to change the existing structure... an example from 'Mysql Alter Table Identity'. To understand and elaborate an example 

Quartz Tutorials

SQL Alter Column Default Value
SQL Alter Column Default Value       Alter Column Default Value in  SQL Server... | Type | Null | Key | Default | Extra 

Programming Tutorials

Mysql Alter Column
Mysql Alter Column       Mysql Alter Column is used to redefine the table and change the datatype... from 'Mysql Alter Column'. To understand an example from 'Mysql Alter Column', we 

MySQL

MySql Alter Database
MySql Alter Database This example illustrates how to alter database.... To alter the database we create the query "ALTER DATABASE test CHARACTER SET... default NULL,                   PRIMARY KEY  (`emp_id 

Programming Tutorials

Mysql Alter Data Type
Mysql Alter Data Type       Mysql  Alter Date Type is used to modify or change the Column datatype in a table. Understand with Example The Tutorial cover an example on 'Mysql 

SQL Tutorial

SQL Alter Table
Primary Key: The  Query Alter given below is used to modify the existing table...; Alter Table Stu add primary key (id) ; Describe Stu... SQL Alter Table       

SQL Tutorial

Mysql Alter Table Syntax
Mysql Alter Table Syntax       Mysql Alter Table is used to redefine the existing table... Understand with Example The Tutorial illustrate an example from 'Mysql Alter 

Programming Tutorials

SQL Alter Column type
SQL Alter Column type       Alter Column type in SQL is used to change or recreate the data type... the simplest and easiest example, which helps you to understand SQL Alter Column 

SQL Tutorial

Mysql Alter Data Type
Mysql Alter Data Type       Mysql  Alter Date Type is used to modify or change the Column... on 'Mysql Alter Date Type'.To understand this example we create a table 

SQL Tutorial

Mysql Alter Column Datatype
Mysql Alter Column Datatype       Mysql Alter Column Datatype is used to modify the table... an example from 'Mysql Alter Column  Datatype'. To understand 

SQL Tutorial

Mysql Alter Column Size
Mysql Alter Column Size       Mysql Alter Column Size is used to change the data size... from 'Mysql Alter Column Size'. To understand example we create table 

DMCA.com