18 mapping from a database mapping in the cloud peterson
TRANSCRIPT
![Page 1: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/1.jpg)
18 Mapping from a database
Mapping in the CloudPeterson
![Page 2: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/2.jpg)
Linux
• PHP and MySQL were largely developed under Linux – open source operating system based on UNIX
• Linus Torvalds – – “Hello everybody out there! I'm doing a (free)
operating system … (just a hobby, won't be big and professional) for 386(486) AT clones. This has been brewing since april, and is starting to get ready.I'd like any feedback.”
![Page 3: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/3.jpg)
PHP and MySQL
• Most Linux installation procedures include the option of installing PHP and MySQL.
• Administration of online databases is done through phpMyAdmin – Available through the cPanel
• Purpose of exercises:– Develop familiarity with PHP– Input and query MySQL tables
![Page 4: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/4.jpg)
PHP example 1
Result:HTML written by PHPThis was written in HTML from a PHP script
![Page 5: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/5.jpg)
PHP example 2
Result:The square of 16 is 256.
![Page 6: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/6.jpg)
PHP example 3
Result:A screen with a 1024 x 768 resolution has 786432 pixels.A screen with a 1024 x 768 resolution has 786,432 pixels.
![Page 7: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/7.jpg)
PHP example 4
Result:The value of j is: 20The value of j is: 40The value of j is: 80The value of j is: 160The value of j is: 320
![Page 8: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/8.jpg)
PHP example 5
Result:The value of myCount is: 0The value of myCount is: 10The value of myCount is: 20The value of myCount is: 30The value of myCount is: 40
![Page 9: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/9.jpg)
PHP example 6
Result:20 is bigger than 10
![Page 10: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/10.jpg)
PHP Example 6
![Page 11: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/11.jpg)
PHP Example 7
![Page 12: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/12.jpg)
cPanel
![Page 13: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/13.jpg)
MySQL is used to define new tables
![Page 14: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/14.jpg)
![Page 15: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/15.jpg)
SQL
![Page 16: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/16.jpg)
![Page 17: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/17.jpg)
Browse
![Page 18: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/18.jpg)
Structure
![Page 19: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/19.jpg)
SQL
![Page 20: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/20.jpg)
Search
![Page 21: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/21.jpg)
mysql_connect.php
![Page 22: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/22.jpg)
All Capitals
![Page 23: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/23.jpg)
All Capitals
![Page 24: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/24.jpg)
North of Omaha / less than 500,000
![Page 25: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/25.jpg)
North of Omaha / less than 500,000
![Page 26: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/26.jpg)
Select within box
![Page 27: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/27.jpg)
Select within box
![Page 28: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/28.jpg)
DROP TABLE IF EXISTS cities; create table cities (
city VARCHAR(30),location GEOMETRY NOT NULL,SPATIAL INDEX(location),PRIMARY KEY (city)
);INSERT INTO cities (city, location) VALUES ("Omaha", GeomFromText('POINT(41.25 -96)'));INSERT INTO cities (city, location) VALUES ("Atlanta", GeomFromText('POINT(33.755 -84.39)'));INSERT INTO cities (city, location) VALUES ("Lincoln", GeomFromText('POINT(40.809722 -96.675278)'));DROP TABLE IF EXISTS dl_airports; create table dl_airports (
city VARCHAR(30),airport VARCHAR(30),code VARCHAR(3),FOREIGN KEY (city) REFERENCES cities(city),PRIMARY KEY (code)
);INSERT INTO dl_airports (city, airport, code) VALUES ("Omaha","Omaha Eppley Airfield", "OMA");INSERT INTO dl_airports (city, airport, code) VALUES ("Atlanta","Hartsfield-Jackson International Airport", "ATL");INSERT INTO dl_airports (city, airport, code) VALUES ("Lincoln","Municipal Airport", "LNK");DROP TABLE IF EXISTS dl_routes; create table dl_routes (
airportCode VARCHAR(3),destinationCode VARCHAR(3),FOREIGN KEY (airportCode) references dl_airports(code),FOREIGN KEY (destinationCode) references dl_airports(code)
);INSERT INTO dl_routes (airportCode, destinationCode) VALUES ("OMA","ATL");INSERT INTO dl_routes (airportCode, destinationCode) VALUES ("OMA","DET");INSERT INTO dl_routes (airportCode, destinationCode) VALUES ("OMA","MEM");
Part of the SQL code for entering three tables that provide city
location, airport information, and airline connections.
![Page 29: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/29.jpg)
Flight Routes
![Page 30: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/30.jpg)
Flight Routes
![Page 31: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/31.jpg)
![Page 32: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/32.jpg)
Selected routes
![Page 33: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/33.jpg)
Selected routes
![Page 34: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/34.jpg)
create table ne_counties (strokecolor VARCHAR(7),strokewidth INT(5),strokeopacity FLOAT(5),fillcolor VARCHAR(7),fillopacity FLOAT(5),popdata INT(15),name VARCHAR(30),geom GEOMETRY NOT NULL,SPATIAL INDEX(geom)
); INSERT INTO ne_counties (strokecolor, strokewidth , strokeopacity , fillcolor, fillopacity , popdata, name, geom) VALUES ("#008800",1,1.0,"#FFCC00",0.06674,33185,"county", GeomFromText('POLYGON((40.698311157 -98.2829258865,40.698311157 -98.2781218448,40.3505519215 -98.2781218448,40.3500181391 -98.3309663027,40.3504184759 -98.3344358884,40.3504184759 -98.7238301514,40.6413298855 -98.7242304882,40.6897706386 -98.7244973794,40.6989783851 -98.7243639338,40.6991118307 -98.7214281306,40.6985780482 -98.686198492,40.698311157 -98.2829258865, 40.698311157 -98.2829258865))'));
INSERT INTO ne_counties (strokecolor, strokewidth , strokeopacity , fillcolor, fillopacity , popdata, name, geom) VALUES ("#008800",1,1.0,"#FFCC00",0.01334,6931,"county", GeomFromText('POLYGON((41.9149346991 -98.2956032185,42.0888143169 -98.2954697729,42.0888143169 -98.3004072602,42.3035282886 -98.3005407058,42.4369738893 -98.300140369,42.4377745629 -97.8344152223,42.2326686746 -97.8352158959,42.0897484361 -97.8346821135,42.0347688486 -97.8341483311,41.9164026008 -97.8332142119,41.9152015904 -98.0647423292,41.9149346991 -98.2956032185, 41.9149346991 -98.2956032185))'));
MySQL commands, attributes, and coordinates for placing two county
polygons for Nebraska into a MySQL database.
![Page 35: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/35.jpg)
Nebraska county polygons
![Page 36: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/36.jpg)
Nebraska county polygons
![Page 37: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/37.jpg)
Nebraska county population
![Page 38: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/38.jpg)
Nebraska county
population
![Page 39: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/39.jpg)
Counties with less than 50,000
![Page 40: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/40.jpg)
Counties with less than 50,000
![Page 41: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/41.jpg)
Selection of counties by points
![Page 42: 18 Mapping from a database Mapping in the Cloud Peterson](https://reader036.vdocuments.mx/reader036/viewer/2022070412/56649ec05503460f94bcac37/html5/thumbnails/42.jpg)
Selection of
counties by points