-- http://www.phpmyadmin.net
-- 
-- Erstellungszeit: 09. März 2008 um 07:00
-- Server Version: 4.1.18
-- PHP-Version: 4.4.2
-- 
-- Datenbank: `niki_2007_results`
-- 

-- --------------------------------------------------------

-- 
-- Tabellenstruktur für Tabelle `drivers`
-- 

CREATE TABLE IF NOT EXISTS `drivers` (
  `d_id` int(11) NOT NULL auto_increment,
  `d_lname` varchar(20) NOT NULL default '',
  `d_fname` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`d_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ;

-- 
-- Daten für Tabelle `drivers`
-- 

INSERT INTO `drivers` (`d_id`, `d_lname`, `d_fname`) VALUES (1, 'ALONSO', 'Fernando'),
(2, 'HAMILTON', 'Lewis'),
(3, 'FISICHELLA', 'Giancarlo'),
(4, 'KOVALAINEN', 'Heikki'),
(5, 'MASSA', 'Felipe'),
(6, 'RAIKKONEN', 'Kimi'),
(7, 'BUTTON', 'Jenson'),
(8, 'BARRICHELLO', 'Rubens'),
(9, 'HEIDFELD', 'Nick'),
(10, 'KUBICA', 'Robert'),
(11, 'SCHUMACHER', 'Ralf'),
(12, 'TRULLI', 'Jarno'),
(14, 'COULTHARD', 'David'),
(15, 'WEBBER', 'Mark'),
(16, 'ROSBERG', 'Nico'),
(17, 'WURZ', 'Alexander'),
(18, 'LIUZZI', 'Vitantonio'),
(19, 'SPEED', 'Scott'),
(20, 'ALBERS', 'Christijan'),
(21, 'SUTIL', 'Adrian'),
(22, 'SATO', 'Takuma'),
(23, 'DAVIDSON', 'Anthony'),
(24, 'DE LA ROSA', 'Pedro'),
(25, 'PAFFETT', 'Gary'),
(26, 'PIQUET', 'Nelson Jr.'),
(27, 'ZONTA', 'Ricardo'),
(28, 'BADOER', 'Luca'),
(29, 'KLIEN', 'Christian'),
(30, 'ROSSITER', 'James'),
(31, 'VETTEL', 'Sebastian'),
(32, 'GLOCK', 'Timo'),
(33, 'MONTAGNY', 'Franck'),
(34, 'DOORNBOS', 'Robert'),
(35, 'AMMERMUELLER', 'Michael'),
(36, 'KARTHIKEYAN', 'Narain'),
(37, 'NAKAJIMA', 'Kazuki'),
(38, 'JANI', 'Neel'),
(39, 'WINKELHOCK', 'Markus'),
(40, 'FAUZY', 'Fairuz'),
(41, 'VAN DER GARDE', 'Giedo'),
(42, 'VALLES', 'Adrian'),
(43, 'YAMAMOTO', 'Sakon');

-- --------------------------------------------------------

-- 
-- Tabellenstruktur für Tabelle `events`
-- 

CREATE TABLE IF NOT EXISTS `events` (
  `e_id` int(11) NOT NULL auto_increment,
  `e_type` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`e_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- 
-- Daten für Tabelle `events`
-- 

INSERT INTO `events` (`e_id`, `e_type`) VALUES (1, 'QUALIFYING'),
(2, 'RACE');

-- --------------------------------------------------------

-- 
-- Tabellenstruktur für Tabelle `gps`
-- 

CREATE TABLE IF NOT EXISTS `gps` (
  `g_id` int(11) NOT NULL auto_increment,
  `g_name` varchar(40) NOT NULL default '',
  `g_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `g_flag` varchar(20) NOT NULL default '',
  `g_circuit` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`g_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;

-- 
-- Daten für Tabelle `gps`
-- 

INSERT INTO `gps` (`g_id`, `g_name`, `g_datetime`, `g_flag`, `g_circuit`) VALUES (1, 'AUSTRALIA (Melbourne)', '2007-03-18 04:00:00', 'flag_AUSTRALIA.gif', 'circuit_AUSTRALIA.gif'),
(2, 'MALAYSIA (Sepang)', '2007-04-08 08:00:00', 'flag_MALAYSIA.gif', 'circuit_MALAYSIA.gif'),
(3, 'BAHRAIN (Sakhir)', '2007-04-15 13:30:00', 'flag_BAHRAIN.gif', 'circuit_BAHRAIN.gif'),
(4, 'SPAIN (Barcelona)', '2007-05-13 14:00:00', 'flag_SPAIN.gif', 'circuit_SPAIN.gif'),
(5, 'MONACO (Monte Carlo)', '2007-05-27 14:00:00', 'flag_MONACO.gif', 'circuit_MONACO.gif'),
(6, 'CANADA (Montreal)', '2007-06-10 19:00:00', 'flag_CANADA.gif', 'circuit_CANADA.gif'),
(7, 'USA (Indianapolis)', '2007-06-17 19:00:00', 'flag_USA.gif', 'circuit_USA.gif'),
(8, 'FRANCE (Magny-Cours)', '2007-07-01 14:00:00', 'flag_FRANCE.gif', 'circuit_FRANCE.gif'),
(9, 'GREAT BRITAIN (Silverstone)', '2007-07-08 14:00:00', 'flag_UK.gif', 'circuit_UK.gif'),
(10, 'GERMANY (Nuerburgring)', '2007-07-22 14:00:00', 'flag_GERMANY.gif', 'circuit_GERMANY_(Nuerburgring).gif'),
(11, 'HUNGARY (Budapest)', '2007-08-05 14:00:00', 'flag_HUNGARY.gif', 'circuit_HUNGARY.gif'),
(12, 'TURKEY (Istanbul)', '2007-08-26 14:00:00', 'flag_TURKEY.gif', 'circuit_TURKEY.gif'),
(13, 'ITALY (Monza)', '2007-09-09 14:00:00', 'flag_ITALY.gif', 'circuit_ITALY.gif'),
(14, 'BELGIUM (Spa)', '2007-09-16 14:00:00', 'flag_BELGIUM.gif', 'circuit_BELGIUM.gif'),
(15, 'JAPAN (Fuji)', '2007-09-30 06:30:00', 'flag_JAPAN.gif', 'circuit_JAPAN_(Fuji).gif'),
(16, 'CHINA (Shanghai)', '2007-10-07 08:00:00', 'flag_CHINA.gif', 'circuit_CHINA.gif'),
(17, 'BRASIL (Sao Paolo)', '2007-10-21 18:00:00', 'flag_BRASIL.gif', 'circuit_BRASIL.gif');

-- --------------------------------------------------------

-- 
-- Tabellenstruktur für Tabelle `results`
-- 

CREATE TABLE IF NOT EXISTS `results` (
  `r_g_id` int(11) NOT NULL default '0',
  `r_e_id` int(11) NOT NULL default '0',
  `r_d_id_p1` int(11) NOT NULL default '0',
  `r_d_id_p2` int(11) NOT NULL default '0',
  `r_d_id_p3` int(11) NOT NULL default '0',
  `r_sc` int(11) NOT NULL default '0',
  PRIMARY KEY  (`r_g_id`,`r_e_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Daten für Tabelle `results`
-- 

INSERT INTO `results` (`r_g_id`, `r_e_id`, `r_d_id_p1`, `r_d_id_p2`, `r_d_id_p3`, `r_sc`) VALUES (1, 1, 6, 1, 9, 0),
(1, 2, 6, 1, 2, 0),
(2, 1, 5, 1, 6, 0),
(2, 2, 1, 2, 6, 0),
(3, 1, 5, 2, 6, 0),
(3, 2, 5, 2, 6, 1),
(4, 1, 5, 1, 6, 0),
(4, 2, 5, 2, 1, 0),
(5, 1, 1, 2, 5, 0),
(5, 2, 1, 2, 5, 0),
(6, 1, 2, 1, 9, 0),
(6, 2, 2, 9, 17, 1),
(7, 1, 2, 1, 5, 0),
(7, 2, 2, 1, 5, 0),
(8, 1, 5, 2, 6, 0),
(8, 2, 6, 5, 2, 0),
(9, 1, 2, 6, 1, 0),
(9, 2, 6, 1, 2, 0),
(10, 1, 6, 1, 5, 0),
(10, 2, 1, 5, 15, 1),
(11, 1, 2, 9, 6, 0),
(11, 2, 2, 6, 9, 0),
(12, 1, 5, 2, 6, 0),
(12, 2, 5, 6, 1, 0),
(13, 1, 1, 2, 5, 0),
(13, 2, 1, 2, 6, 1),
(14, 1, 6, 5, 1, 0),
(14, 2, 6, 5, 1, 0),
(15, 1, 2, 1, 6, 0),
(15, 2, 2, 4, 6, 1),
(16, 1, 2, 6, 5, 0),
(16, 2, 6, 1, 5, 0),
(17, 1, 5, 2, 6, 0),
(17, 2, 6, 5, 1, 0);

-- --------------------------------------------------------

-- 
-- Tabellenstruktur für Tabelle `tips`
-- 

CREATE TABLE IF NOT EXISTS `tips` (
  `t_u_id` int(11) NOT NULL default '0',
  `t_g_id` int(11) NOT NULL default '0',
  `t_e_id` int(11) NOT NULL default '0',
  `t_d_id_p1` int(11) NOT NULL default '0',
  `t_d_id_p2` int(11) NOT NULL default '0',
  `t_d_id_p3` int(11) NOT NULL default '0',
  `t_sc` int(11) NOT NULL default '0',
  `t_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `t_score` int(11) NOT NULL default '0',
  PRIMARY KEY  (`t_u_id`,`t_g_id`,`t_e_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Daten für Tabelle `tips`
-- 

INSERT INTO `tips` (`t_u_id`, `t_g_id`, `t_e_id`, `t_d_id_p1`, `t_d_id_p2`, `t_d_id_p3`, `t_sc`, `t_timestamp`, `t_score`) VALUES (4, 1, 1, 6, 5, 1, 0, '2007-03-15 08:41:10', 3),
(4, 1, 2, 5, 1, 6, 0, '2007-03-15 08:41:31', 4),
(2, 1, 1, 5, 6, 17, 0, '2007-03-16 17:19:52', 1),
(2, 1, 2, 5, 6, 1, 1, '2007-03-16 17:20:12', 1),
(1, 1, 1, 5, 6, 1, 0, '2007-03-17 00:09:21', 2),
(1, 1, 2, 6, 1, 2, 0, '2007-03-17 14:29:09', 7),
(3, 1, 2, 6, 3, 8, -1, '2007-03-18 01:32:01', 2),
(1, 2, 1, 5, 6, 1, 0, '2007-04-06 19:58:14', 4),
(4, 2, 1, 5, 6, 3, 0, '2007-04-06 21:15:10', 3),
(2, 2, 1, 6, 5, 2, 0, '2007-04-07 07:48:55', 2),
(2, 2, 2, 5, 6, 1, 0, '2007-04-07 08:59:42', 3),
(1, 2, 2, 6, 5, 1, 0, '2007-04-07 09:16:15', 3),
(4, 2, 2, 5, 1, 6, 0, '2007-04-07 09:31:37', 4),
(4, 3, 1, 6, 2, 5, 0, '2007-04-13 21:03:59', 4),
(1, 3, 1, 6, 1, 2, 0, '2007-04-14 12:10:54', 2),
(2, 3, 1, 5, 2, 6, 0, '2007-04-14 12:52:10', 6),
(2, 3, 2, 5, 2, 6, 0, '2007-04-14 13:58:25', 5),
(1, 3, 2, 2, 6, 1, 0, '2007-04-14 13:59:53', 1),
(4, 3, 2, 5, 6, 1, 0, '2007-04-15 10:10:44', 2),
(4, 4, 1, 1, 5, 6, 0, '2007-05-11 17:26:24', 4),
(1, 4, 1, 1, 5, 2, 0, '2007-05-12 10:42:58', 2),
(2, 4, 1, 6, 2, 1, 0, '2007-05-12 13:55:14', 2),
(2, 4, 2, 5, 6, 1, 0, '2007-05-12 15:03:58', 5),
(4, 4, 2, 1, 5, 6, 0, '2007-05-13 10:21:21', 3),
(1, 4, 2, 5, 1, 6, 0, '2007-05-13 10:53:43', 4),
(4, 5, 1, 1, 6, 2, 0, '2007-05-25 16:52:38', 3),
(1, 5, 1, 6, 2, 1, 0, '2007-05-26 12:13:58', 3),
(2, 5, 1, 6, 1, 2, 0, '2007-05-26 12:59:10', 2),
(1, 5, 2, 1, 2, 5, 1, '2007-05-26 15:05:17', 5),
(4, 5, 2, 5, 1, 2, 1, '2007-05-26 15:09:43', 2),
(2, 5, 2, 2, 1, 5, 1, '2007-05-27 13:46:34', 3),
(1, 6, 1, 1, 2, 5, 0, '2007-06-09 09:29:44', 2),
(4, 6, 1, 1, 6, 5, 0, '2007-06-09 17:08:55', 1),
(2, 6, 1, 6, 2, 1, 0, '2007-06-09 18:40:52', 2),
(2, 6, 2, 2, 1, 6, 1, '2007-06-09 20:05:48', 3),
(1, 6, 2, 1, 2, 6, 1, '2007-06-09 20:08:15', 2),
(4, 6, 2, 6, 5, 1, 0, '2007-06-10 12:18:17', -1),
(4, 7, 1, 1, 2, 5, 0, '2007-06-16 08:52:35', 4),
(1, 7, 1, 2, 1, 9, 0, '2007-06-16 18:37:17', 4),
(2, 7, 1, 1, 2, 9, 0, '2007-06-16 18:46:57', 2),
(2, 7, 2, 2, 1, 5, 1, '2007-06-16 20:01:45', 5),
(4, 7, 2, 1, 2, 6, 0, '2007-06-17 11:57:41', 3),
(1, 7, 2, 2, 1, 6, 0, '2007-06-17 15:44:03', 5),
(4, 8, 1, 1, 5, 2, 0, '2007-06-30 10:58:13', 2),
(1, 8, 1, 2, 5, 6, 0, '2007-06-30 12:05:57', 4),
(2, 8, 1, 5, 2, 6, 0, '2007-06-30 14:03:24', 6),
(2, 8, 2, 5, 2, 6, 0, '2007-06-30 15:01:03', 4),
(1, 8, 2, 2, 5, 6, 0, '2007-06-30 15:13:27', 5),
(4, 8, 2, 6, 10, 1, 1, '2007-06-30 17:56:36', 1),
(4, 9, 1, 6, 2, 5, 0, '2007-07-07 08:29:24', 2),
(1, 9, 1, 6, 1, 5, 0, '2007-07-07 12:00:55', 2),
(2, 9, 1, 6, 1, 2, 0, '2007-07-07 12:01:50', 3),
(4, 9, 2, 2, 6, 5, 0, '2007-07-07 15:03:00', 3),
(1, 9, 2, 2, 1, 6, 0, '2007-07-07 15:03:04', 5),
(2, 9, 2, 6, 1, 2, 0, '2007-07-08 13:52:16', 7),
(1, 10, 1, 6, 2, 1, 0, '2007-07-21 11:24:13', 3),
(4, 10, 1, 2, 6, 1, 0, '2007-07-21 13:47:43', 2),
(2, 10, 1, 6, 2, 5, 0, '2007-07-21 13:53:35', 4),
(2, 10, 2, 6, 1, 5, 0, '2007-07-21 15:33:38', 1),
(4, 10, 2, 6, 1, 5, 0, '2007-07-21 15:34:50', 1),
(1, 10, 2, 6, 5, 1, 0, '2007-07-22 12:21:10', 2),
(4, 11, 1, 1, 2, 6, 0, '2007-08-03 21:26:49', 3),
(4, 11, 2, 1, 6, 2, 0, '2007-08-03 21:27:03', 4),
(1, 11, 1, 2, 1, 6, 0, '2007-08-04 11:10:00', 4),
(2, 11, 1, 5, 1, 6, 0, '2007-08-04 12:08:47', 2),
(1, 11, 2, 1, 2, 6, 0, '2007-08-04 15:01:27', 3),
(2, 11, 2, 2, 6, 9, 0, '2007-08-05 13:31:34', 7),
(4, 12, 1, 6, 2, 1, 0, '2007-08-25 09:38:55', 3),
(2, 12, 1, 2, 1, 5, 0, '2007-08-25 11:03:02', 2),
(1, 12, 1, 2, 5, 1, 0, '2007-08-25 11:04:26', 2),
(1, 12, 2, 2, 6, 5, 0, '2007-08-25 14:15:02', 4),
(4, 12, 2, 5, 2, 6, 0, '2007-08-25 16:50:49', 4),
(2, 12, 2, 6, 1, 5, 0, '2007-08-26 13:40:41', 4),
(4, 13, 1, 6, 1, 5, 0, '2007-09-07 18:17:47', 3),
(1, 13, 1, 1, 2, 5, 0, '2007-09-08 11:57:01', 6),
(2, 13, 1, 1, 2, 6, 0, '2007-09-08 12:47:38', 4),
(4, 13, 2, 1, 2, 5, 0, '2007-09-08 14:41:22', 3),
(1, 13, 2, 1, 2, 5, 1, '2007-09-08 15:01:06', 5),
(2, 13, 2, 1, 2, 5, 0, '2007-09-09 13:38:32', 3),
(4, 14, 1, 1, 2, 6, 0, '2007-09-15 11:16:52', 2),
(1, 14, 1, 6, 1, 2, 0, '2007-09-15 11:58:48', 3),
(2, 14, 1, 6, 1, 5, 0, '2007-09-15 12:02:52', 4),
(2, 14, 2, 6, 5, 1, 0, '2007-09-15 15:02:04', 7),
(1, 14, 2, 6, 1, 5, 0, '2007-09-15 15:10:38', 5),
(4, 14, 2, 1, 6, 2, 0, '2007-09-16 13:07:04', 3),
(4, 15, 1, 1, 2, 6, 0, '2007-09-28 19:34:26', 4),
(1, 15, 1, 2, 1, 6, 0, '2007-09-28 22:23:11', 6),
(2, 15, 1, 6, 1, 2, 0, '2007-09-29 06:55:29', 4),
(1, 15, 2, 2, 1, 6, 1, '2007-09-29 08:07:06', 5),
(4, 15, 2, 2, 6, 1, 0, '2007-09-29 15:02:09', 2),
(2, 15, 2, 1, 2, 6, 1, '2007-09-30 05:46:28', 4),
(4, 16, 1, 6, 1, 5, 0, '2007-10-05 17:43:04', 3),
(1, 16, 1, 6, 1, 2, 0, '2007-10-06 06:40:21', 2),
(1, 16, 2, 2, 6, 1, 1, '2007-10-06 09:01:42', 1),
(4, 16, 2, 2, 1, 6, 1, '2007-10-06 12:06:33', 2),
(2, 16, 1, 1, 6, 2, 0, '2007-10-06 05:10:13', 3),
(2, 16, 2, 6, 2, 5, 1, '2007-10-07 07:45:30', 3),
(4, 17, 1, 6, 5, 2, 0, '2007-10-20 16:03:45', 3),
(1, 17, 1, 5, 2, 6, 0, '2007-10-20 16:22:50', 6),
(2, 17, 1, 5, 6, 2, 0, '2007-10-20 17:15:48', 4),
(1, 17, 2, 6, 2, 5, 0, '2007-10-20 19:09:35', 4),
(4, 17, 2, 5, 2, 6, 0, '2007-10-21 13:43:07', 3),
(2, 17, 2, 6, 5, 2, 0, '2007-10-21 17:42:45', 5);
        