Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL +...
Transcript of Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL +...
![Page 1: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/1.jpg)
Data Manipulation with MySQLEvangelos Pournaras, Izabela Moise, Dirk Helbing
Evangelos Pournaras, Izabela Moise, Dirk Helbing 1
![Page 2: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/2.jpg)
About MySQL
• Open source SQL database system• Dual license - GPL + commercial license• Relational database management system• Integration with Java, Python, PHP, Perl, etc.
Evangelos Pournaras, Izabela Moise, Dirk Helbing 2
![Page 3: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/3.jpg)
Language Elements
ClausesExpressionsPredicates
QueriesStatementsInsignificant white space
Evangelos Pournaras, Izabela Moise, Dirk Helbing 3
![Page 4: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/4.jpg)
Queries
• Most common operation
• Data retrieval
• No persistent effects on the database
• Describes the data, actual retrieval operations handled by thedatabase management system
• subqueries, e.g. in a WHERE predicate
SELECT column FROM table WHERE predicateGROUP BY column HAVING predicate ORDER BY column
Evangelos Pournaras, Izabela Moise, Dirk Helbing 4
![Page 5: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/5.jpg)
Data Manipulation
Data Manipulation Language (DML)
• INSERT
• UPDATE
• DELETE
• MERGE
Evangelos Pournaras, Izabela Moise, Dirk Helbing 5
![Page 6: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/6.jpg)
Data Types
Evangelos Pournaras, Izabela Moise, Dirk Helbing 6
![Page 7: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/7.jpg)
Numeric Data Types
Evangelos Pournaras, Izabela Moise, Dirk Helbing 7
![Page 8: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/8.jpg)
String Data Types
Evangelos Pournaras, Izabela Moise, Dirk Helbing 8
![Page 9: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/9.jpg)
Data & Time Data Types
Evangelos Pournaras, Izabela Moise, Dirk Helbing 9
![Page 10: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/10.jpg)
Spatial Data Types
Evangelos Pournaras, Izabela Moise, Dirk Helbing 10
![Page 11: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/11.jpg)
Operators
Evangelos Pournaras, Izabela Moise, Dirk Helbing 11
![Page 12: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/12.jpg)
Arithmetic Operators
Evangelos Pournaras, Izabela Moise, Dirk Helbing 12
![Page 13: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/13.jpg)
Comparison Operators
Evangelos Pournaras, Izabela Moise, Dirk Helbing 13
![Page 14: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/14.jpg)
Logical Operators
Evangelos Pournaras, Izabela Moise, Dirk Helbing 14
![Page 15: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/15.jpg)
MySQL Demonstration
Evangelos Pournaras, Izabela Moise, Dirk Helbing 15
![Page 16: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/16.jpg)
MAMP Software Package
Easy all-in installationhttp://www.mamp.info/en/
Evangelos Pournaras, Izabela Moise, Dirk Helbing 16
![Page 17: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/17.jpg)
NervousNet Database
SENSOR_0AccelerometerSENSOR_1BatterySENSOR_2GyroscopeSENSOR_3HumiditySENSOR_4LightSENSOR_5Magnetic
SENSOR_6ProximitySENSOR_7TemperatureSENSOR_8NoiseSENSOR_9PressureSENSOR_aConnectivitySENSOR_bBluetooth Beacon
Evangelos Pournaras, Izabela Moise, Dirk Helbing 17
![Page 18: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/18.jpg)
SQL Statements I
>SHOW DATABASES>SHOW TABLES>DESCRIBE SENSOR_0>CREATE DATABASE TESTDB>SELECT UUID,RecordTime,Rms FROM SENSOR_8 WHERE Rms>20000>SELECT UUID,RecordTime,Rms FROM SENSOR_8WHERE Rms BETWEEN 10000 AND 20000>SELECT UUID,RecordTime,Rms FROM SENSOR_8WHERE Rms>20000 UNION SELECT UUID,RecordTime,TemperatureFROM SENSOR_7 WHERE Temperature>36.0>SELECT DISTINCT UUID FROM SENSOR_8 WHERE Rms>15000
Evangelos Pournaras, Izabela Moise, Dirk Helbing 18
![Page 19: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/19.jpg)
SQL Statements II
>CREATE TABLE table_01(id INT)>INSERT INTO table_01(id) VALUES(2)>UPDATE table_01 SET id=200 WHERE id=1;>CREATE TABLE table_02(id INTEGER,info VARCHAR(50),date DATE NOT NULL,PRIMARY KEY (id, info));>INSERT INTO table_02 (id, info, date)VALUES (1, ’Hello’, ’1990-01-05’)
Evangelos Pournaras, Izabela Moise, Dirk Helbing 19
![Page 20: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/20.jpg)
Proposed Literature
Mysql 5.5 reference manual.Technical report, MySQL AB, 2015.
Evangelos Pournaras, Izabela Moise, Dirk Helbing 20
![Page 21: Data Manipulation with MySQLAbout MySQL Open source SQL database system Dual license - GPL + commercial license Relational database management system Integration with Java, Python,](https://reader033.fdocuments.us/reader033/viewer/2022043009/5f9bc5fc4b377932513e7dca/html5/thumbnails/21.jpg)
What is next?
• Visualization and plotting
Evangelos Pournaras, Izabela Moise, Dirk Helbing 21