Be a MySQL Ninja Sheeri Cabral Senior DB Admin/Architect

Slides:



Advertisements
Similar presentations
What’s New With MySQL and MariaDB Sheeri Cabral Senior DB Admin/Architect
Advertisements

Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
CSE 1561 A Brief MySQL Primer Stephen Scott. CSE 1562 Introduction Once you’ve designed and implemented your database, you obviously want to add data.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Chapter 4: Organizing and Manipulating the Data in Databases
Session 5: Working with MySQL iNET Academy Open Source Web Development.
PostgreSQL and relational databases As well as assignment 4…
ASP.NET Programming with C# and SQL Server First Edition
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
Chapter 10 Queries and Updating Part C. SQL Copyright 2005 Radian Publishing Co.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Information Systems Today (©2006 Prentice Hall) MySQL 1CS3754 Class Note #8, Is an open-source relational database management system 2.Is fast and.
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
PostgreSQL and relational databases As well as assignment 4…
MET280: Computing for Bioinformatics Introduction to databases What is a database? Not a spreadsheet. Data types and uses DBMS (DataBase Management System)
Introduction to MySQL Lab no. 10 Advance Database Management System.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
Alerting With MySQL and Nagios Sheeri Cabral Senior DB Admin/Architect
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
M1G Introduction to Database Development 5. Doing more with queries.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
ROOT I/O for SQL databases Sergey Linev, GSI, Germany.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Get Rid of Cron Scripts Using Events Sheeri Cabral Senior DB Admin/Architect,
SQL John Nowobilski. What is SQL? Structured Query Language Manages Data in Database Management Systems based on the Relational Model Developed in 1970s.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Indexes and Views Unit 7.
Introduction to MongoDB
Creating Databases for Web applications SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
Alerting With MySQL and Nagios Sheeri Cabral Senior DB Admin/Architect
COMP 430 Intro. to Database Systems MongoDB. What is MongoDB? “Humongous” DB NoSQL, no schemas DB Lots of similarities with SQL RDBMs, but with more flexibility.
Notice: MySQL is a registered trademark of Sun Microsystems, Inc. MySQL Conference & Expo 2011 Michael “Monty” Widenius Oleksandr “Sanja”
How to make MySQL Drizzle cool again? Originally by: Jonathan Levin Adapted by: Henrik Ingo Drizzle Developer day
Understanding Core Database Concepts Lesson 1. Objectives.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Database Access with SQL
Optimizing MySQL Joins and Subqueries
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Dineesha Suraweera.
ISC440: Web Programming 2 Server-side Scripting PHP 3
Chapter 7 Working with Databases and MySQL
Structured Query Language
Chapter 8 Working with Databases and MySQL
Developing a Model-View-Controller Component for Joomla Part 3
CSE 491/891 Lecture 21 (Pig).
What query folding means to self-service BI projects
CSE 482 Lecture 5: NoSQL.
Tutorial 6 PHP & MySQL Li Xu
Understanding Core Database Concepts
Presentation transcript:

Be a MySQL Ninja Sheeri Cabral Senior DB Admin/Architect

MySQL Ninja Lots of tips and tricks for MySQL HandlerSocket plugin Query MySQL as if it was NoSQL/CRUD

MySQL Ninja Innovative ways to use a database MariaDB Examples as time permits

MariaDB Drop-in replacement for MySQL Can go back and forth Extra features Mostly storage engines Cannot install these SEs on MySQL yet

Sequence Storage Engine Read_only Exists only while you use it Virtual Not even a.frm file!

Sequence Storage Engine Supports indexes Supports XA transactions Installation is easy INSTALL PLUGIN SEQUENCE SONAME 'ha_sequence';

Sequence Storage Engine SELECT * FROM seq_x_to_y Odd #’s from 9 backwards to 1 You want a "step" Table seq_x_to_y_step_z e.g. SELECT * FROM seq_9_to_1_step_2

Sequence Storage Engine Find all prime numbers < 25 A prime # x means only x and 1 are divisors seq_2_to_25 No step (increment=1)

Find Prime Nums <25 For all y, x % y leaves a remainder x is a possible prime number x is one sequence y is another sequence y is the divisor y is not 1 or x Only need to check y up to √x

Sequence Storage Engine Find all prime numbers < 25 SELECT x.seq FROM seq_2_to_25 x WHERE 0 NOT IN (SELECT x.seq % y.seq FROM seq_2_to_25 y WHERE y.seq < sqrt(x.seq));

Sequence Storage Engine Can I name a regular table seq_1_to_100? If a temp table, yes Otherwise, not if sequence SE is installed Can ALTER TABLE to change SE Then can manipulate/drop But…just don't do it

CassandraSE Opposite of HandlerSocket plugin Separate plugin package Use MySQL to access Cassandra Column families Use familiar SQL

CassandraSE JOIN Cassandra and MySQL tables Flexible Schema Uses dynamic columns

Dynamic Columns Built-in, not a separate plugin BLOB data type Functions to store multiple values Key/value pairs Since 5.3, but better in 10

Store Sells CDs, DVDs, games, t-shirts, posters Each has price, inventory ID, manufacturer DVDs, CDs, game have titles CDs have artists and tracks T-shirts have different sizes and colors Posters have no extra information

Dynamic Columns Table w/ price, inventory ID, manufacturer "extra" dynamic column Just a BLOB

Dynamic Column Example

COLUMN_CREATE

COLUMN_GET

COLUMN_EXISTS COLUMN_EXISTS(dyn_col, part_name) If dynamic column undefined, returns NULL If part name exists, returns 1 If part name does not exist, returns 0 Dynamic column is defined

Other Functions COLUMN_LIST(extra) List the dynamic columns in a BLOB Dynamic parts not indexable COLUMN_JSON(extra) Because everyone loves JSON

Other Functions COLUMN_ADD Preserve existing parts while adding more COLUMN_CREATE overwrites COLUMN_DELETE(field, part) COLUMN_CHECK(field) Returns 1 if field is a dynamic column Returns NULL if field is not a dynamic column

Nested Dynamic Columns Dynamic column Has parts A part can be a dynamic column

MySQL Storage Engines CSV Built-in Federated/FederatedX

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql:// username

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql:// username:password

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql://

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql://

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql:// /table_name';

CONNECT Storage Engine Remote databases Native or ODBC CREATE TABLE remote_table ENGINE=connect TABLE_TYPE=MYSQL connection='mysql:// /table_name'; Specify table fields for partial tables

Remote CONNECT Tables SELECT INSERT UPDATE DELETE Multi-table queries allowed All tables must be defined locally

CONNECT To Text Files CSV INI XML DBF FMT BIN

CONNECT Storage Engine MERGE functionality TBL Type Exact schema match NOT required

CONNECT Storage Engine Pivot table Easily aggregate data Unpivot "OCCUR"

CONNECT Storage Engine Filesystem DIR table type Filenames, sizes, extensions and more Query datadir.ibd files, compare to I_S

CONNECT Storage Engine Lists of objects Parent Children Donna Adam,Sam,Tommy Peter Nina Tony Jack Maya,Elan Amy Eli,Ethan,Ben,Lily

CONNECT Examples INI XML MERGE functionality (TBL) Pivot/unpivot table Filesystem (DIR) Lists of objects

More Resources lynda.com OurSQL podcast (oursql.com) slides: youtube.com/tcation