Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 16 to 19 of 19
Thread: SQL creates high server load?
10-17-2012, 07:29 AM #16
- Join Date
- Oct 2012
- Thanked 0 Times in 0 Posts
Please suggest me with some more example with this load problems>
can any one tell me the peak load point for an server?
12-06-2012, 09:27 PM #17
- Join Date
- Jul 2011
- Thanked 1 Time in 1 Post
CREATE TABLE Customers(
custid INT AUTO_INCREMENT PRIMARY KEY ,
coid INT FOREIGN KEY REFERENCES countries( coid ) ,
custname VARCHAR( 100 )
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOREIGN KEY REFERENCES countries(coid),
)' at line 3
Last edited by markman641; 12-06-2012 at 09:33 PM.
12-06-2012, 10:25 PM #18
Look at what I wrote:
The syntax there for the foreign keys isn't quite correct for MySQL, but it's a compact form that easy to read for a post like this.
CREATE TABLE Customers ( custid INT AUTO_INCREMENT PRIMARY KEY , coid INT, custname VARCHAR( 100 ), CONSTRAINT FOREIGN KEY fk_customers_coid ( coid ) REFERENCES countries( coid ) );Code:
SHOW CREATE TABLE Customers;Be yourself. No one else is as qualified.
12-06-2012, 10:28 PM #19
Here's an example of the name MySQL generates if you omit it. This is from SHOW CREATE TABLE:
CREATE TABLE `customers` ( `custid` int(11) NOT NULL AUTO_INCREMENT, `coid` int(11) DEFAULT NULL, `custname` varchar(100) DEFAULT NULL, PRIMARY KEY (`custid`), KEY `coid` (`coid`), CONSTRAINT `customers_ibfk_1` FOREIGN KEY (`coid`) REFERENCES `countries` (`coid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1Be yourself. No one else is as qualified.