topical media & game development

talk show tell print

basic-mysql-15-ch15-TryItOut.sql / sql



  
  /* Chapter 15 - Try It Out sections */
  
  /* Try It Out: Optimizing Performance of a SELECT Statement */
  
  CREATE TABLE Cities
  (
     CityID SMALLINT NOT NULL PRIMARY KEY,
     CityName VARCHAR(20) NOT NULL
  )
  ENGINE=INNODB;
  
  INSERT INTO Cities
  VALUES (101, 'Seattle'), (102, 'Redmond'), (103, 'Bellevue'),
  (104, 'Kent'), (105, 'Kirkland');
  
  CREATE TABLE CustCity
  (
     CustID SMALLINT NOT NULL,
     CityID SMALLINT NOT NULL
  )
  ENGINE=INNODB;
  
  INSERT INTO CustCity
  VALUES (1, 104), (2, 101), (3, 104),
  (4, 103), (5, 102), (6, 105);
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.