Next: Código fuente programa qlistview.cpp Up: Código fuente programas en Previous: Código fuente programa qtscribble.cpp Contents

##
Creación de la base de datos courses

  ### create the table structure for the course registration

  #Drop the database and create it a new

  DROP DATABASE courses;

  CREATE DATABASE courses;

  USE courses;

  #Create the courses table

  CREATE TABLE courses

  {

  id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,

  name VARCHAR(50) NOT NULL,

  description TEXT,

  start_date DATE NOT NULL,

  end_date DATE NOT NULL,

  location VARCHAR(50) NOT NULL

  };

  CREATE INDEX courses_name_index ON courses (name);

  USE courses;

  INSERT INTO courses
  ( name, description, start_date, end_date, location )

  values
  ( `HTML para Principiantes`, `Una introducción a HTML`,
  `2001-10-08`, `2001-10-12`,`Moscow, Russia` );

  INSERT INTO courses
  (name, description, start_date, end_date, location )

  Values
  (`HTML para avanzados`, `Todo lo que se debe saber de
  HTML`,`2002-05-03`,`2002-05-07`,`Stockholm,Sweden`);