id* city state varchar(10) varchar(40) char(2) good_id* bad_id*

id* city state varchar(10) varchar(40) char(2) good_id* bad_id* int(11) int(11) We think it is about time you actually created these tables on the server. Ready? Not so fast: You have to create the database first. Creating a Database in MySQL You can create a database in a number of ways. All require the execution of a SQL statement in one way or another, so let s look at that first: CREATE DATABASE yourdatabase; What, were you expecting something more complicated? Well, an optional parameter is missing: IF NOT EXISTS. We re pretty sure you know whether or not it exists, but if it makes you feel better, you can certainly add that: CREATE DATABASE IF NOT EXISTS yourdatabase; That s all there is to it. Think of the database as an empty shell. There is nothing special about it, really. The interesting stuff comes later, when you create the tables and manipulate the data. That said, you still have to figure out how you are going to execute that SQL statement. Here are a few suggestions: . From the MySQL command prompt. Do it this way only if you have access to the server on which MySQL is installed. If you are running your own server, or you have telnet access to the server, this may be an option for you. . If you are being hosted by an ISP, you may need to request that the ISP create a database for you. For example, on one author s site the ISP has CPanel installed, and he simply clicks the module called MySQL Databases. From the next page, he simply types in the database he wants to create and clicks a button, and it s created for him. ISPs will usually give you this option because you have a limit in your contract on how many databases you are allowed to create. On one of our sites, for example, the limit is 10 databases. . If you have PHPMyAdmin installed (either on your own server or through your ISP), you can then run the SQL command from there. PHPMyAdmin is a valuable tool, and we recommend you use it if that is an option for you. It allows you to see your table structures and even browse data. It is a dangerous tool, however, because you can easily drop tables or entire databases with the click of a button, so use it carefully. 285 Building Databases
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply