Web Programming Languages

PHP Source Code: parks.sql

#----------------------------------------------------------
#   The Web Language Project
#   Mark Brautigam
#   May-June 2015
#   http://www.mixed-up.com/markb/
#----------------------------------------------------------

create table parks (site VARCHAR(240), 
                    state VARCHAR(4), 
                    city VARCHAR(64), 
                    latitude FLOAT, 
                    longitude FLOAT, 
                    ID INT  not null primary key auto_increment);

/*
Query OK, 0 rows affected (0.01 sec)

mysql> describe parks;
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| site      | varchar(240) | YES  |     | NULL    |                |
| state     | varchar(4)   | YES  |     | NULL    |                |
| city      | varchar(64)  | YES  |     | NULL    |                |
| latitude  | float        | YES  |     | NULL    |                |
| longitude | float        | YES  |     | NULL    |                |
| ID        | int(11)      | NO   | PRI | NULL    | auto_increment |
+-----------+--------------+------+-----+---------+----------------+

mysql> insert into parks values ('Yosemite', 'CA', 'Mariposa', 37.849923, -119.567666, null);
Query OK, 1 row affected (0.01 sec)

mysql> select * from parks;
+----------+-------+----------+----------+-----------+----+
| site     | state | city     | latitude | longitude | ID |
+----------+-------+----------+----------+-----------+----+
| Yosemite | CA    | Mariposa |  37.8499 |  -119.568 |  1 |
+----------+-------+----------+----------+-----------+----+
1 row in set (0.00 sec)

*/