├── README.md ├── index.html ├── logo.png └── tables ├── boys.sql ├── cartable.sql ├── clown_info.sql ├── cookie_sales.sql ├── doughnut_ratings.sql ├── drink_info.sql ├── easy_drinks.sql ├── fish_info.sql ├── fish_records.sql ├── girls.sql ├── hooptie.sql ├── movie_table.sql ├── my_contacts_ch2.sql ├── projekts.sql ├── superheros.sql ├── toys.sql ├── toys_second_normal_form.sql ├── toys_third_normal_form.sql └── your_table.sql /README.md: -------------------------------------------------------------------------------- 1 | ## Example files for the title: 2 | 3 | # Head First SQL, by Lynn Beighley 4 | 5 | [![Head First SQL, by Lynn Beighley](http://akamaicovers.oreilly.com/images/9780596526849/cat.gif)](https://www.safaribooksonline.com/library/view/title/9780596526849//) 6 | 7 | The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website. 8 | 9 | O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission. 10 | 11 | We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. 12 | 13 | If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at . 14 | 15 | Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind. 16 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Head First SQL Downloads 5 | 6 | 7 | 8 |
9 |
10 | 11 |
12 | 13 |
14 |

Head First SQL

15 | 16 |

Downloads

17 | 19 | Individual tables: 20 | 40 | 41 | 42 |

< Go back to Head First SQL

43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobertKalo/HeadFirstSQL/d6e1aa9a3d7e2353991539db610f0dae5a2ee371/logo.png -------------------------------------------------------------------------------- /tables/boys.sql: -------------------------------------------------------------------------------- 1 | # Dump of table boys 2 | # ------------------------------------------------------------ 3 | 4 | CREATE TABLE `boys` ( 5 | `boy_id` int(11) default NULL, 6 | `boy` varchar(20) default NULL, 7 | `toy_id` int(11) default NULL 8 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 9 | 10 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('1','Davey','3'); 11 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('2','Bobby','5'); 12 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('3','Beaver','2'); 13 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('4','Richie','1'); 14 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('6','Johnny','4'); 15 | INSERT INTO `boys` (`boy_id`,`boy`,`toy_id`) VALUES ('5','Billy','2'); 16 | 17 | -------------------------------------------------------------------------------- /tables/cartable.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-07 12:28:32 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table car_table 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `car_table` ( 14 | `VIN` varchar(16) default NULL, 15 | `make` varchar(20) default NULL, 16 | `model` varchar(20) default NULL, 17 | `color` varchar(20) default NULL, 18 | `price` decimal(7,2) default NULL, 19 | `year` varchar(4) default NULL, 20 | `car_id` int(11) NOT NULL auto_increment, 21 | PRIMARY KEY (`car_id`) 22 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; 23 | 24 | INSERT INTO `car_table` (`VIN`,`make`,`model`,`color`,`price`,`year`,`car_id`) VALUES (NULL,'Porsche','Boxter','silver','39393939392E3939','1998','1'); 25 | INSERT INTO `car_table` (`VIN`,`make`,`model`,`color`,`price`,`year`,`car_id`) VALUES (NULL,'Jaguar','XJ',NULL,'39393939392E3939','2000','2'); 26 | INSERT INTO `car_table` (`VIN`,`make`,`model`,`color`,`price`,`year`,`car_id`) VALUES (NULL,'Cadillac','Escalade','red','39393939392E3939','2002','3'); 27 | 28 | 29 | -------------------------------------------------------------------------------- /tables/clown_info.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobertKalo/HeadFirstSQL/d6e1aa9a3d7e2353991539db610f0dae5a2ee371/tables/clown_info.sql -------------------------------------------------------------------------------- /tables/cookie_sales.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE cookie_sales ( 2 | ID int(11) NOT NULL auto_increment, 3 | first_name varchar(20) NOT NULL, 4 | sales decimal(4,2) NOT NULL, 5 | sale_date date NOT NULL, 6 | PRIMARY KEY (ID) 7 | ); 8 | 9 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('1','Lindsey',32.02,'2007-03-12'); 10 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('2','Nicole',26.53,'2007-03-12'); 11 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('3','Britney',11.25,'2007-03-12'); 12 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('4','Ashley',18.96,'2007-03-12'); 13 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('5','Lindsey',9.16,'2007-03-11'); 14 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('6','Nicole',1.52,'2007-03-11'); 15 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('7','Britney',43.21,'2007-03-11'); 16 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('8','Ashley',8.05,'2007-03-11'); 17 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('9','Lindsey',17.62,'2007-03-10'); 18 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('10','Nicole',24.19,'2007-03-10'); 19 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('11','Britney',3.40,'2007-03-10'); 20 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('12','Ashley',15.21,'2007-03-10'); 21 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('13','Lindsey',0.00,'2007-03-09'); 22 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('14','Nicole',31.99,'2007-03-09'); 23 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('15','Britney',2.58,'2007-03-09'); 24 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('16','Ashley',0.00,'2007-03-09'); 25 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('17','Lindsey',2.34,'2007-03-08'); 26 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('18','Nicole',13.44,'2007-03-08'); 27 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('19','Britney',8.78,'2007-03-08'); 28 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('20','Ashley',26.82,'2007-03-08'); 29 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('21','Lindsey',3.71,'2007-03-07'); 30 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('22','Nicole',0.56,'2007-03-07'); 31 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('23','Britney',34.19,'2007-03-07'); 32 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('24','Ashley',7.77,'2007-03-07'); 33 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('25','Lindsey',16.23,'2007-03-06'); 34 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('26','Nicole',0.00,'2007-03-06'); 35 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('27','Britney',4.50,'2007-03-06'); 36 | INSERT INTO `cookie_sales` (`ID`,`first_name`,`sales`,`sale_date`) VALUES ('28','Ashley',19.22,'2007-03-06'); 37 | 38 | 39 | -------------------------------------------------------------------------------- /tables/doughnut_ratings.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-07 00:13:36 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table doughnut_ratings 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `doughnut_ratings` ( 14 | `location` varchar(50) default NULL, 15 | `time` time default NULL, 16 | `date` date default NULL, 17 | `type` varchar(50) default NULL, 18 | `rating` tinyint(4) default NULL, 19 | `comments` varchar(50) default NULL 20 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 21 | 22 | INSERT INTO `doughnut_ratings` (`location`,`time`,`date`,`type`,`rating`,`comments`) VALUES ('Krispy King','08:50:00','2007-09-27','plain glazed','10','almost perfect'); 23 | INSERT INTO `doughnut_ratings` (`location`,`time`,`date`,`type`,`rating`,`comments`) VALUES ('Duncan\\\'s Donuts','08:59:00','2007-08-25',NULL,'6','greasy'); 24 | INSERT INTO `doughnut_ratings` (`location`,`time`,`date`,`type`,`rating`,`comments`) VALUES ('Starbuzz Coffee','07:35:00','2007-05-24','cinnamon cake','5','stale, but tasty'); 25 | INSERT INTO `doughnut_ratings` (`location`,`time`,`date`,`type`,`rating`,`comments`) VALUES ('Duncan\\\'s Donuts','07:03:00','2007-04-26','jelly','7','not enough jelly'); 26 | 27 | 28 | -------------------------------------------------------------------------------- /tables/drink_info.sql: -------------------------------------------------------------------------------- 1 | # Dump of table drink_info 2 | # ------------------------------------------------------------ 3 | 4 | CREATE TABLE `drink_info` ( 5 | `drink_name` varchar(16) default NULL, 6 | `cost` decimal(4,2) default NULL, 7 | `carbs` decimal(4,2) default NULL, 8 | `color` varchar(20) default NULL, 9 | `ice` char(1) default NULL, 10 | `calories` int(11) default NULL 11 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO drink_info VALUES ('Blackthorn', 3, 8.4, 'yellow', 'Y', 33); 14 | INSERT INTO drink_info VALUES ('Blue Moon', 2.5, 3.2, 'blue', 'Y', 12); 15 | INSERT INTO drink_info VALUES ('Oh My Gosh', 3.5, 8.6, 'orange', 'Y', 35); 16 | INSERT INTO drink_info VALUES ('Lime Fizz', 2.5, 5.4, 'green', 'Y', 24); 17 | INSERT INTO drink_info VALUES ('Kiss on the Lips', 5.5, 42.5, 'purple', 'Y', 171); 18 | INSERT INTO drink_info VALUES ('Hot Gold', 3.2, 32.1, 'orange', 'N', 135); 19 | INSERT INTO drink_info VALUES ('Lone Tree', 3.6, 4.2, 'red', 'Y', 17); 20 | INSERT INTO drink_info VALUES ('Greyhound', 4, 14, 'yellow', 'Y', 50); 21 | INSERT INTO drink_info VALUES ('Indian Summer', 2.8, 7.2, 'brown', 'N', 30); 22 | INSERT INTO drink_info VALUES ('Bull Frog', 2.6, 21.5, 'tan', 'Y', 80); 23 | INSERT INTO drink_info VALUES ('Soda and It', 3.8, 4.7, 'red', 'N', 19); 24 | INSERT INTO drink_info VALUES ('Slim Shady', 4.35, NULL, 'clear', 'Y', NULL); 25 | 26 | -------------------------------------------------------------------------------- /tables/easy_drinks.sql: -------------------------------------------------------------------------------- 1 | # Dump of table easy_drinks 2 | # ------------------------------------------------------------ 3 | 4 | CREATE TABLE `easy_drinks` ( 5 | `drink_name` varchar(16) default NULL, 6 | `main` varchar(20) default NULL, 7 | `amount1` decimal(3,1) default NULL, 8 | `second` varchar(20) default NULL, 9 | `amount2` decimal(4,2) default NULL, 10 | `directions` varchar(250) default NULL 11 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Kiss on the Lips','cherry juice',2.0,'apricot nectar',7.00,'serve over ice with straw'); 14 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Hot Gold','peach nectar',3.0,'orange juice',6.00,'pour hot orange juice in mug and add peach nectar'); 15 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Lone Tree','soda',1.5,'cherry juice',0.75,'stir with ice, strain into cocktail glass'); 16 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Greyhound','soda',1.5,'grapefruit juice',5.00,'serve over ice, stir well'); 17 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Indian Summer','apple juice',2.0,'hot tea',6.00,'add juice to mug and top off with hot tea'); 18 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Bull Frog','iced tea',1.5,'lemonade',5.00,'serve over ice with lime slice'); 19 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Soda and It','soda',2.0,'grape juice',1.00,'shake in cocktail glass, no ice'); 20 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Blackthorn','tonic water',1.5,'pineapple juice',1.00,'stir with ice, strain into cocktail glass with lemon twist'); 21 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Blue Moon','soda',1.5,'blueberry juice',0.75,'stir with ice, strain into cocktail glass with lemon twist'); 22 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Oh My Gosh','peach nectar',1.0,'pineapple juice',1.00,'stir with ice, strain into shot glass'); 23 | INSERT INTO `easy_drinks` (`drink_name`,`main`,`amount1`,`second`,`amount2`,`directions`) VALUES ('Lime Fizz','Sprite',1.5,'lime juice',0.75,'stir with ice, strain into cocktail glass'); 24 | 25 | 26 | -------------------------------------------------------------------------------- /tables/fish_info.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `fish_info` ( 2 | `common` varchar(50) NOT NULL, 3 | `species` varchar(50) NOT NULL, 4 | `location` varchar(50) NOT NULL, 5 | `weight` varchar(15) NOT NULL 6 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 7 | 8 | 9 | INSERT INTO fish_info VALUES ('bass, largemouth' ,'M. salmoides' ,'Montgomery Lake, GA', '22 lb 4 oz'); 10 | INSERT INTO fish_info VALUES ('walleye', 'S. vitreus', 'Old Hickory Lake, TN', '25 lb 0 oz'); 11 | INSERT INTO fish_info VALUES ('trout, cutthroat', 'O. Clarki', 'Pyramid Lake, NV', '41 lb 0 oz'); 12 | INSERT INTO fish_info VALUES ('perch, yellow', 'P. Flavescens', 'Bordentown, NJ', '4 lb 3 oz'); 13 | INSERT INTO fish_info VALUES ('bluegill', 'L. Macrochirus', 'Ketona Lake, AL', '4 lb 12 oz'); 14 | INSERT INTO fish_info VALUES ('gar, longnose', 'L. Osseus', 'Trinity River, TX', '50 lb 5 oz'); 15 | INSERT INTO fish_info VALUES ('crappie, white', 'P. annularis', 'Enid Dam, MS', '5 lb 3 oz'); 16 | INSERT INTO fish_info VALUES ('pickerel, grass', 'E. americanus', 'Dewart Lake, IN', '1 lb 0 oz'); 17 | INSERT INTO fish_info VALUES ('goldfish', 'C. auratus', 'Lake Hodges, CA', '6 lb 10 oz'); 18 | INSERT INTO fish_info VALUES ('salmon, chinook', 'O. Tshawytscha', 'Kenai River, AK', '97 lb 4 oz'); -------------------------------------------------------------------------------- /tables/fish_records.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `fish_records` ( 2 | `first_name` varchar(50) NOT NULL, 3 | `last_name` varchar(50) NOT NULL, 4 | `common` varchar(50) NOT NULL, 5 | `location` varchar(50) NOT NULL, 6 | `state` varchar(2) NOT NULL, 7 | `weight` varchar(15) NOT NULL , 8 | `date` DATE NOT NULL 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 10 | 11 | 12 | INSERT INTO fish_records VALUES ('George', 'Perry', 'bass, largemouth', 'Montgomery Lake', 'GA', '22 lb 4 oz', '1932-06-02'); 13 | INSERT INTO fish_records VALUES ('Mabry', 'Harper', 'walleye', 'Old Hickory Lake', 'TN', '25 lb 0 oz', '1960-08-02' ); 14 | INSERT INTO fish_records VALUES ('John', 'Skimmerhorn', 'trout, cutthroat', 'Pyramid Lake', 'NV', '41 lb 0 oz', '1925-12-1' ); 15 | INSERT INTO fish_records VALUES ('C.C.', 'Abbot', 'perch, yellow', 'Bordentown', 'NJ', '4 lb 3 oz', '1865-5-1' ); 16 | INSERT INTO fish_records VALUES ('T.S.', 'Hudson', 'bluegill', 'Ketona Lake', 'AL', '4 lb 12 oz', '1950-4-9' ); 17 | INSERT INTO fish_records VALUES ('Townsend', 'Miller', 'gar, longnose', 'Trinity River', 'TX', '50 lb 5 oz', '1954-7-30' ); 18 | INSERT INTO fish_records VALUES ('Fred', 'Bright', 'crappie, white', 'Enid Dam', 'MS', '5 lb 3 oz', '1957-7-31' ); 19 | INSERT INTO fish_records VALUES ('Mike', 'Berg', 'pickerel, grass', 'Dewart Lake', 'IN', '1 lb 0 oz', '1990-6-9' ); 20 | INSERT INTO fish_records VALUES ('Florentino', 'Abena', 'goldfish', 'Lake Hodges', 'CA', '6 lb 10 oz', '1996-4-17' ); 21 | INSERT INTO fish_records VALUES ('Les', 'Anderson', 'salmon, chinook', 'Kenai River', 'AK', '97 lb 4 oz', '1985-5-17'); -------------------------------------------------------------------------------- /tables/girls.sql: -------------------------------------------------------------------------------- 1 | 2 | # Dump of table girls 3 | # ------------------------------------------------------------ 4 | 5 | CREATE TABLE `girls` ( 6 | `girl_id` int(11) default NULL, 7 | `girl` varchar(20) default NULL, 8 | `toy_id` int(11) default NULL 9 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 10 | 11 | INSERT INTO `girls` (`girl_id`,`girl`,`toy_id`) VALUES ('1','Jane','3'); 12 | INSERT INTO `girls` (`girl_id`,`girl`,`toy_id`) VALUES ('2','Sally','4'); 13 | INSERT INTO `girls` (`girl_id`,`girl`,`toy_id`) VALUES ('3','Cindy','1'); 14 | INSERT INTO `girls` (`girl_id`,`girl`,`toy_id`) VALUES ('4','Mandy','1'); 15 | -------------------------------------------------------------------------------- /tables/hooptie.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-07 12:11:16 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table hooptie 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `hooptie` ( 14 | `color` varchar(20) default NULL, 15 | `year` varchar(4) default NULL, 16 | `make` varchar(20) default NULL, 17 | `mo` varchar(20) default NULL, 18 | `howmuch` float(10,3) default NULL 19 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 20 | 21 | INSERT INTO `hooptie` (`color`,`year`,`make`,`mo`,`howmuch`) VALUES ('silver','1998','Porsche','Boxter','17992.539'); 22 | INSERT INTO `hooptie` (`color`,`year`,`make`,`mo`,`howmuch`) VALUES (NULL,'2000','Jaguar','XJ','15995.000'); 23 | INSERT INTO `hooptie` (`color`,`year`,`make`,`mo`,`howmuch`) VALUES ('red','2002','Cadillac','Escalade','40215.898'); 24 | 25 | 26 | -------------------------------------------------------------------------------- /tables/movie_table.sql: -------------------------------------------------------------------------------- 1 | # Dump of table movie_table 2 | # ------------------------------------------------------------ 3 | 4 | CREATE TABLE `movie_table` ( 5 | `movie_id` int(11) NOT NULL auto_increment, 6 | `title` varchar(50) NOT NULL, 7 | `rating` varchar(5) NOT NULL, 8 | `category` varchar(10) NOT NULL, 9 | `purchased` date NOT NULL, 10 | PRIMARY KEY (`movie_id`) 11 | ) ENGINE=MyISAM AUTO_INCREMENT=94 DEFAULT CHARSET=utf8; 12 | 13 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('83','Big Advenure','G','family','2002-03-06'); 14 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('89','Shiny Things, The','PG','drama','2002-03-06'); 15 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('88','End of the Line','R','misc','2001-02-05'); 16 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('87','A Rat named Darcy','G','family','2003-04-19'); 17 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('86','Head First Rules','R','action','2003-04-19'); 18 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('85','Mad Clowns','R','horror','1999-11-20'); 19 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('84','Greg: The Untold Story','PG','action','2001-02-05'); 20 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('93','Potentially Habitable Planet','PG','scifi','2001-02-05'); 21 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('92','Weird Things from Space','PG','scifi','2003-04-19'); 22 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('91','Shark Bait','G','misc','1999-11-20'); 23 | INSERT INTO `movie_table` (`movie_id`,`title`,`rating`,`category`,`purchased`) VALUES ('90','Take it Back','R','comedy','2001-02-05'); 24 | 25 | 26 | -------------------------------------------------------------------------------- /tables/my_contacts_ch2.sql: -------------------------------------------------------------------------------- 1 | # Dump of table my_contacts # ------------------------------------------------------------ CREATE TABLE `my_contacts` ( `last_name` varchar(30) , `first_name` varchar(20) , `email` varchar(50) , `gender` char(1), `birthday` date , `profession` varchar(50), `location` varchar(50), `status` varchar(20), `interests` varchar(100), `seeking` varchar(100) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Anderson','Jillian','jill_anderson@ \nbreakneckpizza.com','F','1980-09-05','Technical Writer','Palo Alto, CA','single','kayaking, reptiles','relationship, friends'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Kenton','Leo','lkenton@starbuzzcoffee.com','M','1974-01-10','Manager','San Francisco, CA','divorced','women','women to date'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('McGavin','Darrin',' captainlove@headfirsttheater.com','M','1966-01-23','Cruise Ship Captain','San Diego, CA','single','sailing, fishing, yachting','women for casual relationships'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Franklin','Joe','joe_franklin@leapinlimos.com','M','1977-04-28','Software Sales','Dallas, TX','married','fishing, drinking','new job'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Hamilton','Jamie','dontbother@starbuzzcoffee.com','F','1964-09-10','System Administrator','Princeton, NJ','married','RPG','nothing'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Chevrolet','Maurice','bookman4u@objectville.net','M','1962-07-01','Bookshop Owner','Mountain View, CA','married','collecting books, scuba diving','friends'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Kroger','Renee','poorrenee@mightygumball.net','F','1976-12-03','Unemployed','San Francisco, CA','divorced','cooking','employment'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Mendoza','Angelina','angelina@starbuzzcoffee.com','F','1979-08-19','UNIX Sysadmin','San Francisco, CA','married','acting, dancing','new job'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Murphy','Donald','padraic@tikibeanlounge.com','M','1967-01-23','Computer Programmer','New York City, NY','committed relationsh','RPG, anime','friends'); INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`,`profession`,`location`,`status`,`interests`,`seeking`) VALUES ('Spatner','John','jpoet@objectville.net','M','1963-04-18','Salesman','Woodstock, NY','married','poetry, screenwriting','nothing'); 2 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Toth','Anne','Anne_Toth@leapinlimos.com','F','1969-11-18', 'Artist','San Fran, CA'); 3 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Manson','Anne','am86@objectville.net','F','1977-08-09', 'Baker','Seattle, WA'); 4 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Hardy','Anne','anneh@b0tt0msup.com','F','1963-04-18', 'Teacher','San Fran, CA'); 5 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Parker','Anne','annep@starbuzzcoffee.com','F','1983-01-10', 'Student','San Fran, CA'); 6 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Blunt','Anne','anneblunt@breakneckpizza.com','F','1959-10-09', 'Web Designer','San Fran, CA'); 7 | INSERT INTO `my_contacts` (`last_name`,`first_name`,`email`,`gender`,`birthday`, `profession`,`location`) VALUES ('Jacobs','Anne','anne99@objectville.net','F','1968-02-05', 'Computer Programmer','San Jose, CA'); 8 | -------------------------------------------------------------------------------- /tables/projekts.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: ch9 7 | # Generation Time: 2007-09-07 11:09:52 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table projekts 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `projekts` ( 14 | `number` int(11) NOT NULL default '0', 15 | `descriptionofproj` varchar(50) default NULL, 16 | `contractoronjob` varchar(10) default NULL 17 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 18 | 19 | INSERT INTO `projekts` (`number`,`descriptionofproj`,`contractoronjob`) VALUES ('1','outside house painting','Murphy'); 20 | INSERT INTO `projekts` (`number`,`descriptionofproj`,`contractoronjob`) VALUES ('2','kitchen remodel','Valdez'); 21 | INSERT INTO `projekts` (`number`,`descriptionofproj`,`contractoronjob`) VALUES ('3','wood floor installation','Keller'); 22 | INSERT INTO `projekts` (`number`,`descriptionofproj`,`contractoronjob`) VALUES ('4','roofing','Jackson'); 23 | 24 | 25 | -------------------------------------------------------------------------------- /tables/superheros.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: ch9 7 | # Generation Time: 2007-09-10 08:55:40 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table super_heroes 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `super_heroes` ( 14 | `name` varchar(20) NOT NULL, 15 | `power` varchar(50) NOT NULL default '', 16 | `weakness` varchar(20) NOT NULL default '', 17 | `city` varchar(20) NOT NULL, 18 | `country` varchar(20) NOT NULL, 19 | `arch_enemy` varchar(50) NOT NULL, 20 | `initials` varchar(2) NOT NULL 21 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 22 | 23 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Super Trashman','Cleans quickly','bleach','Gotham','US','Verminator','ST'); 24 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('The Broker','Makes money from nothing','','New York','US','Mister Taxman','TB'); 25 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Super Guy','Flies','birds','Metropolis','US','Super Fella','SG'); 26 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Wonder Waiter','Never forgets an order','insects','Paris','France','All You Can Eat Girl','WW'); 27 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Dirtman','Creates dust storms','bleach','Tulsa','US','Hoover','D'); 28 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Super Guy','Super strength','aluminum','Metropolis','US','Badman','SG'); 29 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Furious Woman','Gets really, really angry','','Rome','Italy','The Therapist','FW'); 30 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('The Toad','Tongue of Justice','insects','London','England','Heron','T'); 31 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Librarian','Can find anything','children','Springfield','US','Chaos Creep','L'); 32 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Goose Girl','Flies','','Minneapolis','US','The Quilter','GG'); 33 | INSERT INTO `super_heroes` (`name`,`power`,`weakness`,`city`,`country`,`arch_enemy`,`initials`) VALUES ('Stick Man','Stands in for humans','hang man','London','England','Eraserman','SM'); 34 | 35 | 36 | -------------------------------------------------------------------------------- /tables/toys.sql: -------------------------------------------------------------------------------- 1 | # Dump of table toys 2 | # ------------------------------------------------------------ 3 | 4 | CREATE TABLE `toys` ( 5 | `toy_id` int(11) default NULL, 6 | `toy` varchar(20) default NULL 7 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 8 | 9 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('1','hula hoop'); 10 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('2','balsa glider'); 11 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('3','toy soldiers'); 12 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('4','harmonica'); 13 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('5','baseball cards'); 14 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('6','tinker toys'); 15 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('7','etch-a-sketch'); 16 | INSERT INTO `toys` (`toy_id`,`toy`) VALUES ('8','slinky'); 17 | 18 | 19 | -------------------------------------------------------------------------------- /tables/toys_second_normal_form.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-10 09:51:48 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table toy_ids 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `toy_ids` ( 14 | `toy_id` int(11) NOT NULL auto_increment, 15 | `toy` varchar(30) NOT NULL, 16 | PRIMARY KEY (`toy_id`) 17 | ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; 18 | 19 | INSERT INTO `toy_ids` (`toy_id`,`toy`) VALUES ('5','whiffleball'); 20 | INSERT INTO `toy_ids` (`toy_id`,`toy`) VALUES ('6','frisbee'); 21 | INSERT INTO `toy_ids` (`toy_id`,`toy`) VALUES ('9','kite'); 22 | INSERT INTO `toy_ids` (`toy_id`,`toy`) VALUES ('12','yoyo'); 23 | 24 | 25 | # Dump of table toy_other 26 | # ------------------------------------------------------------ 27 | 28 | CREATE TABLE `toy_other` ( 29 | `toy_id` int(11) NOT NULL, 30 | `store_id` int(11) NOT NULL, 31 | `color` varchar(30) NOT NULL, 32 | `inventory` int(11) default NULL, 33 | `address` varchar(30) NOT NULL 34 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 35 | 36 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('5','1','white','34','23 Maple'); 37 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('5','3','yellow','12','100 E. North St.'); 38 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('5','1','blue','5','23 Maple'); 39 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('6','2','green','10','1902 Amber Ln.'); 40 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('6','4','yellow','24','17 Engleside'); 41 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('9','1','red','50','23 Maple'); 42 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('9','2','blue','2','1902 Amber Ln.'); 43 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('9','2','green','18','1902 Amber Ln.'); 44 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('12','4','white','28','17 Engleside'); 45 | INSERT INTO `toy_other` (`toy_id`,`store_id`,`color`,`inventory`,`address`) VALUES ('12','4','yellow','11','17 Engleside'); 46 | 47 | 48 | -------------------------------------------------------------------------------- /tables/toys_third_normal_form.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-10 10:13:51 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table store_info 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `store_info` ( 14 | `store_id` int(11) NOT NULL auto_increment, 15 | `address` varchar(50) NOT NULL, 16 | `phone` varchar(10) NOT NULL, 17 | `manager` varchar(50) NOT NULL, 18 | PRIMARY KEY (`store_id`) 19 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; 20 | 21 | INSERT INTO `store_info` (`store_id`,`address`,`phone`,`manager`) VALUES ('1','23 Maple','555-6712','Joe'); 22 | INSERT INTO `store_info` (`store_id`,`address`,`phone`,`manager`) VALUES ('2','1902 Amber Ln','555-3478','Susan'); 23 | INSERT INTO `store_info` (`store_id`,`address`,`phone`,`manager`) VALUES ('3','100 E. North St.','555-0987','Tara'); 24 | INSERT INTO `store_info` (`store_id`,`address`,`phone`,`manager`) VALUES ('4','17 Engleside','555-6554','Gordon'); 25 | 26 | 27 | # Dump of table store_inventory 28 | # ------------------------------------------------------------ 29 | 30 | CREATE TABLE `store_inventory` ( 31 | `toy_id` int(11) NOT NULL, 32 | `store_id` int(11) NOT NULL, 33 | `inventory` int(11) NOT NULL 34 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 35 | 36 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('5','1','34'); 37 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('5','3','12'); 38 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('5','1','5'); 39 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('6','2','10'); 40 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('6','4','24'); 41 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('9','1','50'); 42 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('9','2','2'); 43 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('9','2','18'); 44 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('12','4','28'); 45 | INSERT INTO `store_inventory` (`toy_id`,`store_id`,`inventory`) VALUES ('12','4','11'); 46 | 47 | 48 | # Dump of table toy_info 49 | # ------------------------------------------------------------ 50 | 51 | CREATE TABLE `toy_info` ( 52 | `toy_id` int(11) NOT NULL, 53 | `toy` varchar(30) default NULL, 54 | `color` varchar(30) NOT NULL, 55 | `cost` decimal(5,2) default NULL, 56 | `weight` decimal(5,2) NOT NULL 57 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 58 | 59 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('1','whiffleball','white','312E3935','302E3330'); 60 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('2','whiffleball','yellow','322E3230','302E3430'); 61 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('3','whiffleball','blue','312E3935','302E3330'); 62 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('4','frisbee','green','332E3530','302E3530'); 63 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('5','frisbee','yellow','312E3530','302E3230'); 64 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('6','kite','red','352E3735','312E3230'); 65 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('7','kite','blue','352E3735','312E3230'); 66 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('8','kite','green','332E3135','302E3830'); 67 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('9','yoyo','white','342E3235','302E3530'); 68 | INSERT INTO `toy_info` (`toy_id`,`toy`,`color`,`cost`,`weight`) VALUES ('10','yoyo','yellow','312E3530','302E3230'); 69 | 70 | 71 | -------------------------------------------------------------------------------- /tables/your_table.sql: -------------------------------------------------------------------------------- 1 | # CocoaMySQL dump 2 | # Version 0.7b5 3 | # http://cocoamysql.sourceforge.net 4 | # 5 | # Host: localhost (MySQL 5.0.37) 6 | # Database: hfmysql 7 | # Generation Time: 2007-09-07 10:47:53 -0400 8 | # ************************************************************ 9 | 10 | # Dump of table your_table 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE `your_table` ( 14 | `id` int(11) NOT NULL auto_increment, 15 | `first_name` varchar(20) default NULL, 16 | `last_name` varchar(30) default NULL, 17 | PRIMARY KEY (`id`) 18 | ) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=latin1; 19 | 20 | INSERT INTO `your_table` (`id`,`first_name`,`last_name`) VALUES ('1','Marcia','Brady'); 21 | INSERT INTO `your_table` (`id`,`first_name`,`last_name`) VALUES ('2','Bobby','Brady'); 22 | INSERT INTO `your_table` (`id`,`first_name`,`last_name`) VALUES ('3','Cindy','Brady'); 23 | INSERT INTO `your_table` (`id`,`first_name`,`last_name`) VALUES ('99','Peter','Brady'); 24 | 25 | 26 | --------------------------------------------------------------------------------