SlideShare ist ein Scribd-Unternehmen logo
1 von 98
Downloaden Sie, um offline zu lesen
slides Gerben Menschaert
Introduction to RDBMS
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
slides Gerben Menschaert
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
Introduction to RDBMS
slides Gerben Menschaert
Database Management System (DBMS)
provides …
…efficient, reliable, convenient, and safe
multi-user storage of and access to massive
amounts of persistent data.
slides Gerben Menschaert
• Massive
• Persistent
• Safe
• multi-user
• Convenient
• Efficient
• Reliable
Terabytes
Hardware, software, power, users
Concurrency control
Physical data independence
High-level query languages declarative
Thousands of queries/updates per sec.
99,99999% up-time
slides Gerben Menschaert
Databases
!A database is a collection of data
–numbers
–dates
–text or labels
–…
!A Database Management System
–Data storage
–Data retrieval
–Data manipulation
–Authentication & Authorization
slides Gerben Menschaert
Relational Databases
Rigid structure
2 dimensional tables:
–columns (fields)
–rows (records)
slides Gerben Menschaert
Relational Databases
Model objects (entities) and their relationships
Example of a store that sells products to customers
Entities:
Customers

—>Attributes: name, address, telephone number…
Products 

—>Attributes: name, price…
Relationships:
Sale

—>Attributes: quantity, timestamp…
slides Gerben Menschaert
Relational Databases
!MySQL Workbench:
–graphical
representation of
entities and
relationships
–generates SQL
statements to create
database & tables
slides Gerben Menschaert
Relational Database Management
Systems (RDBMS)
• Enforce data integrity:
Honors constraints on columns
• Enforce referential integrity:
Honors constraints on relations
• See also: the 12 rules of Edgar Codd

http://en.wikipedia.org/wiki/Codd%27s_12_rules
slides Gerben Menschaert
RDBMS
Commercial products:
Oracle
DB2 (IBM)
MS SQL Server (Microsoft)
Open-source offerings:
MySQL (Oracle)
PostgreSQL
SQLite
slides Gerben Menschaert
NoSQL
Key-value stores
Berkeley DB
Document databases – unstructured data
CouchDB
MongoDB
Cassandra (FaceBook)
See also: http://en.wikipedia.org/wiki/Nosql
slides Gerben Menschaert
Introduction to RDBMS
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
slides Gerben Menschaert
Installing MySQL on Linux
!For DEB based Linux distributions

(Debian, Ubuntu, …)

> apt-get install mysql-server

!For RPM based Linux distributions

(RHEL, Fedora, CentOS, ...)

> yum install mysql-server
slides Gerben Menschaert
Installing MySQL on Windows/Mac
An installable (MSI) package is available on the
MySQL site:
http://www.mysql.com/
Follow the 'Downloads (GA)' link
Choose 'MySQL Community Edition’, ‘MySQL
Community Server’
Select 'Microsoft Windows' or 'Mac OS X' as
platform
slides Gerben Menschaert
Running MySQL – Unix/Mac
To start / stop / restart the MySQL service UNIX:

> service mysql start

> service mysql stop

> service mysql restart
When starting MySQL for the first time, the system administrator is
reminded that the MySQL setup is not yet secured
To start / stop / restart the MySQL service Mac:
> cd /usr/local/mysql-xxversion/support-files/
> sudo ./mysql.server start|stop|restart|reload|force-
reload|status

Notes on Mac installation:
https://dev.mysql.com/doc/refman/5.1/en/osx-installation-notes.html
slides Gerben Menschaert
Running MySQL – Unix/Mac
!To check whether or not mysql is running
correctly:


> service mysql status (UNIX)

mysql start/running, process 3394

> ps -ef | grep mysql
mysql 3394 1 0 12:09 ? 00:00:00 /usr/sbin/mysqld



> netstat | grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3394/mysqld
slides Gerben Menschaert
Running MySQL – Windows
!To check whether or not mysql is
running correctly:


Check services running:
–Windows XP: Start/Control Panal/Administrative Tools/Services
–Windows 7: Start/ConfiguratieScherm/System & Beveiliging/
–Windows 10: Start/Settings (Look for services)

slides Gerben Menschaert
Exercises
!Install MySQL
!Add executable to PATH environment
!Start the service
!Check whether or not the service has been started
Mac: export PATH=${PATH}:/usr/local/mysql/bin/
Win10: settings -> search for path
https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/mysql-installation-windows-path.html
slides Gerben Menschaert
The MySQL monitor
!To connect or log on to a MySQL database
service:

> mysql
!The MySQL monitor has many options, you can
review them using:

> man mysql

or 

> mysql --help
slides Gerben Menschaert
The MySQL monitor
!The most important options are:

> mysql [options] [database]

-u uname | --user=uname

default: UNIX account

-p [pwd]| --password[=pwd]

default: <none>

if pwd not given, prompt for password

-h hname | --host=hname

default: localhost

-P prt | --port=prt

default: 3306
slides Gerben Menschaert
Exercises
Connect to the database and execute the following SQL
statements:

mysql> select current_user();

mysql> show databases;
For Mac (initial password reset necessary for root account):
mysql> alter user ‘root’@‘localhost’
identified by ‘newpassword’;
slides Gerben Menschaert
The MySQL monitor
Once connected to the database
server, you can execute SQL
statements:

mysql> statement;
Every SQL statement should end with a
semi-colon (;)
slides Gerben Menschaert
Exercises
Create a database user:
Choose database account, you are free to choose the password,
the hostname is localhost
try to remember userid/password throughout training :-)
mysql> create user ‘new_user’;
mysql> quit;
> mysql -u ‘new_user’;
mysql> alter user ‘new_user’@‘localhost’ identified by
‘newpassword’;
mysql> quit;
> mysql -u ‘new_user’ -p;


Try to connect as this user and execute the following SQL
statements:

mysql> select current_user;

mysql> show databases;
slides Gerben Menschaert
Getting Help
An extensive help system is available in the MySQL
monitor:

mysql> help


This gives an overview of commands you can use to
customise the output
You can get help on any function or statement:

mysql> help contents


This shows you the broad topics of available help. You
can drill down into any of these topics
slides Gerben Menschaert
Database User Privileges
The created user has very limited privileges. To grant
privileges prv on table tbl in database db, you need to
execute the following statement:

mysql> grant prv on db.tbl 

to user@host;
Some convenient wild cards:
To grant all privileges, specify all as prv
To include all databases, specify * as db
To include all tables, specify * as tbl
The given database and table names do not have to exist
(yet)
slides Gerben Menschaert
Getting Help - Demo
How to get help for creating users:

mysql> help

mysql> help contents

mysql> help account management
mysql> help create user

How to use less as a pager (Mac/Unix):

$ export PAGER=/usr/bin/less

$ mysql

mysql> pager

PAGER set to '/usr/bin/less'
slides Gerben Menschaert
Introduction to RDBMS
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
slides Gerben Menschaert
SQL
SQL (Structured Query Language) is the language a
RDBMS provides for:
Data definition (DDL)

CREATE TABLE, DROP DATABASE
Data manipulation (DML)

SELECT, INSERT, DELETE, UPDATE
Data control (DCL)

GRANT, REVOKE
SQL is a ANSI/ISO standard - MySQL implements a
broad subset of ANSI SQL 99
slides Gerben Menschaert
SQL Architecture
slides Gerben Menschaert
Table - Row (tuple) - Column
Constraints: Not NULL, Default, Unique, Primary Key, Foreign Key, Check
slides Gerben Menschaert
The MySQL monitor (again)
There are a number of ways to execute SQL
statements using the MySQL monitor:
Interactively

$ mysql [database]

mysql> stmt;
From the command line

$ mysql [database] -e 'stmt'
From a file or a pipe (stdin)

$ mysql [database] < stmt_file

$ cat stmt_file | mysql [database]
slides Gerben Menschaert
Creating a Database
Only database users with sufficient privileges
can create databases (eg root@localhost)
From the command line:

$ mysqladmin [opt] create dbname

mysqladmin shares the same command line
options for user, password, host and port as
mysql
From within the MySQL monitor:

mysql> create database dbname
slides Gerben Menschaert
Exercises
As root@localhost, create database 'biodb'
Grant all privileges to the database user you created
before:

mysql> grant all on biodb.* 

to user@localhost;
Download the file biodb1.sql - you might want to
take a look at the contents (!)
Execute all SQL statements in this file
slides Gerben Menschaert
Hierarchy
A single MySQL service can have multiple
databases

mysql> show databases;
A particular database db can have multiple tables

mysql> use db;

mysql> show tables;
A particular table tbl can have multiple columns or
fields

mysql> show columns from tbl;

mysql> show create table tbl;
slides Gerben Menschaert
Exercises
!Connect to the database service as a
normal user
!What databases do you see?
!What tables are defined in biodb?
!What are the column names?
slides Gerben Menschaert
Retrieving rows
!To read data from the database, you use the select
SQL statement:

select columnlist from src;
!With
–columnlist:
!list of columns separated with a comma
!use * to retrieve all columns
–src:
!single table or multiple tables joined together
!subquery
!view
slides Gerben Menschaert
Retrieving rows - examples
!To show all data from table modorg:

select * from modorg;
!To show all model organisms:

select genus, species

from modorg;
slides Gerben Menschaert
Sorting rows
When using select statements, the data is
displayed in no particular order
To sort on one or more columns, use the

order by col1 [asc|desc]

[, col2 [asc|desc]...]

clause
With
colX: a column or column alias
asc: ascending (default) order
desc: descending order
slides Gerben Menschaert
Exercises
!Show the names (genus & species) of all model
organisms in the order of the publishing date of
the draft

!Show the names (genus & species) of all model
organisms sorted by the number of
chromosomes (most chromosomes on top) and
than alphabetically by name
slides Gerben Menschaert
Calculated rows
You can add columns in a query that calculate
some value using other columns of the same
row
A multitude of functions and operators are
available: see help in the MySQL monitor
Examples:

mysql> select 6 * 7;

mysql> select 

concat(class, " ", genus)

from modorg;
mysql> select now();
slides Gerben Menschaert
Calculated rows - numbers
See help numeric functions
Operators:

+, -, *, /, %
Functions:
sqrt(x), power(x, y), ...
exp(x), ln(x), ...
sin(x), cos(x), ...
round(x), ceil(x), floor(x), ...
rand(), rand(x)
slides Gerben Menschaert
Calculated rows - strings
See help string functions
Functions:
length(s)
concat(s1, ...)
upper(s), lower(s)
trim(s), ltrim(s), rtrim(s)
substr(s, ...)
reverse(s)
truncate(s)
slides Gerben Menschaert
Calculated rows - dates
See help date and time functions
Functions:
currentdate(), now()
year(d), month(d), week(d)
dayofmonth(d), dayofweek(d)
hour(d), minute(d), second(d)
slides Gerben Menschaert
Exercises
Show
model organism full name (as a single column)
genome size (as Gb), rounded to 4 digits
average chromosome size
publication year
of all rows sorted by average chromosome size
(largest average chromosome size on top)
slides Gerben Menschaert
Column aliases
Columns can be renamed (aliased):
select col [as] alias …
The aliases can be used in the order by clause
slides Gerben Menschaert
Exercises
Show
model organism full name (as a single column)

as name
average chromosome size as avgsize
publication year

as pubyear
of all rows sorted by avgsize (largest size on top)
slides Gerben Menschaert
Filtering rows
To select only those rows that meet certain
criteria, use the where clause:
select columnist
from table
where condition(s)
[order by sortcol];
With condition(s):
- one or more conditions, combined with

not, and, or, xor
- only the rows for which the condition(s)
evaluate(s) TRUE are selected
- you can not use column aliases in condition(s)
slides Gerben Menschaert
Filtering rows - conditions
See help comparison operators
Numerical comparison operations:
=
!= or <>
<, <=, >, >=
between x and y (inclusive)
Example: 

select all organisms with more than 10 chromosomes:

select genus, species from modorg

where nchr > 10;
slides Gerben Menschaert
Filtering rows - conditions
String comparison operations:
=
!= or <>
<, <=, >, >= (lexical)
like “pattern”

matches a pattern:
_ (a single character - cfr shell ?)
% (0 or more characters - cfr shell *)
rlike “regex” [MySQL]

matches a regular expression
Example - select all mammals:

select genus, species from modorg

where class = “mammals”;
slides Gerben Menschaert
Filtering rows - conditions
Dealing with NULL-values
Testing for NULL-ness:

select ... where col is null ...

select ... where col is not null ...
Substitution of NULL-values:

select ifnull(col, value) ...
this function returns:
col if col is not NULL
value if col is NULL
Example:

select genus, species, 

ifnull(nchr, 0) 

from modorg;
slides Gerben Menschaert
Filtering rows - conditions
Boolean logic:
not x

evaluates TRUE if x is FALSE
x and y

evaluates TRUE if both x and y are TRUE
x or y

evaluates TRUE if x or y is TRUE, or both
x xor y

(eXclusive OR)

evaluates TRUE if either x or y is TRUE, but not both
slides Gerben Menschaert
Exercises
- Select all mammals with genomes published
after 2005
- Select all organisms that have a average
chromosome size between 10 and 100 Mbp
- Select all organisms whose genus starts with A,
B, C, D, or E
slides Gerben Menschaert
Filtering rows - duplicates
To eliminate duplicate rows, use

select distinct cols from …
Each combination of cols is unique
slides Gerben Menschaert
Filtering rows - limiting output
To limit the number of rows in a result set, use

select ... limit n [offset r]
The result set is limited to a maximum of n rows
If an offset r is given, the first r rows are skipped
It usually makes little sense to use limit without
order by
slides Gerben Menschaert
Exercises
Give an overview of all organism classes in the
dataset (sorted alphabetically)
Show the organism names of the top 3 largest
genome sizes
slides Gerben Menschaert
Aggregation
So far, queries have concentrated on particular rows
Sometimes, you need to calculate a single result
across multiple rows
e.g.: what is the maximum genome size
SQL allows you to
- specify criteria to group rows together
- calculate a single value per group
- filter grouped data
slides Gerben Menschaert
Aggregation - functions
See: help functions and modifiers for use with
GROUP BY
Functions:
count(col), count(*), 

count(distinct col)
sum(col)
min(col), max(col)
avg(col), stddev(col),
variance(col)
slides Gerben Menschaert
Exercises
All queries below return a row count.

What is the result? Why?
select count(*) from modorg;
select count(nchr) from modorg;
select count(class) from modorg;
select count(distinct class)

from modorg;
How many mammals are in the database?
slides Gerben Menschaert
Aggregation - groups
The group by clause sorts data into groups for the
purpose of aggregation:

select [col,] aggregatefunctions

from src

[where cond]

group by col

[order by …];
All rows with the same value in col are grouped
For each group, the aggregate function is calculated
It usually makes no sense to select any columns other
than col
slides Gerben Menschaert
Exercises
How many organisms are present in the dataset for each
class?
Note the sort order.
Show the minimum and maximum genome sizes for each
class. 

Take only those organisms into account for which the
genome sizes are known.


Sort the results such that the biggest maximum genome
size is on top.
slides Gerben Menschaert
Aggregation - filtering
It is possible to query filter results based on the
results of aggregate functions, using the

having clause:

select [col,] aggregatefunctions

from src

[where cond1]

group by col

having cond2
[order by …]
Column aliases can be used in cond2
slides Gerben Menschaert
Execution order
1> Input columns are determined
2> where: input columns are filtered
3> group by: sorting & grouping 

of filtered input
4> aggregation functions are calculated
5> having: aggregation results are filtered
6> order by: output is sorted
7> limit / offset: output is chopped
slides Gerben Menschaert
Exercises
For each class with more than 1 organism, show
the average number of chromosomes. 

Sort the result such that the biggest average is
on top.
slides Gerben Menschaert
Database upgrade
To prepare for the next part:
Download biodb2.sql
Delete the database biodb:
mysql> drop database biodb;
Recreate the database biodb:

mysql> create database biodb;
Create the tables and insert the data

$ mysql biodb < biodb2.sql
slides Gerben Menschaert
Joins
Relational databases model entities and their
relationships
Different entities: different tables
Joins allow you to combine information across
different tables
slides Gerben Menschaert
Joins
modorg.class_id is a foreign key that references
class.id
gene.mo_id is foreign key that references
modorg.id
slides Gerben Menschaert
Joins - the Cartesian product
When you specify multiple tables in a query, the
database server will generate all possible
combinations: the Cartesian product
Example:
table class has 6 rows
table modorg has 10 rows
query

select * from modorg, class
has 60 rows
slides Gerben Menschaert
Joins
One way to look at joins is to consider it a filtered
(think: where) Cartesian product:
select * from modorg, class

where modorg.class_id = class.id
Note:
- column name id is present in both tables class
and modorg - to avoid ambiguity, the column
name is qualified: class.id
- column name modorg.class_id is also qualified,
but since there is no ambiguity, this is not strictly
necessary
slides Gerben Menschaert
Joins
Alternative syntax:
select * 

from modorg [inner] join class

on modorg.class_id = class.id;
Both syntactical forms are considered
completely equivalent - there is no compelling
reason to prefer one above the other, it is just a
matter of taste.
slides Gerben Menschaert
Joins - column aliases
When specifying columns in the query, care
must be taken to avoid ambiguity:

mysql> select id, name, genus, species

from modorg, class 

where modorg.class_id = class.id;

ERROR 1052 (23000): 

Column 'id' in field list is ambiguous
Ambiguous columns must be qualified. And
additionally you can choose an alias:

mysql> select modorg.id as mo_id, 

name, genus, species 

from modorg, class 

where modorg.class_id = class.id;
slides Gerben Menschaert
Joins - data source aliases
In some cases, you need to join a table with
itself or you select data from a subquery
In this case it can be handy (or even necessary)
to alias the data source:
select a.col, b.col

from src1 [as] a, src2 [as] b
where ...
slides Gerben Menschaert
Joins - data source aliases
Consider the (at first sight) simple question:

For each class, give the class name, organism name
and date of the organism that was sequenced first
A part of the answer is this:

select class_id, min(draft) as dr from
modorg 

group by class_id;
To add the class name: join with table class
To add the organism name: join with table modorg
slides Gerben Menschaert
Joins - data source aliases
Add the class name:

select name, dr 

from 

(select class_id, min(draft) as dr 

from modorg group by class_id) as s,

class 

where s.class_id = class.id;
Add the organism name:

select name, genus, species, dr

from 

(select class_id, min(draft) as dr 

from modorg group by class_id) as s,

class, modorg 

where s.class_id = class.id 

and s.dr = draft;
slides Gerben Menschaert
Exercises
For all rows in table gene, show
organism name
class name
accession
length
description of the gene
slides Gerben Menschaert
Outer joins
Inner join:
select class.name,genus,species, gene_acc 

from 

class
inner join modorg oclass.id=modorg.class_id
inner join gene on gene.mo_id = modorg.id;
Left outer join:

select class.name,genus,species, gene_acc 

from 

class
inner join modorg oclass.id=modorg.class_id
left outer join gene on gene.mo_id = modorg.id;
slides Gerben Menschaert
Reusing queries - views
This last exercise is actually very useful as a data
source itself:
- It could be used as such (as a subquery) - but
this would end up being inconvenient.
- The query as such can be saved as a special
table-like object, called a view.
Syntax:

create view viewname as

select ...
slides Gerben Menschaert
Reusing queries - views
You can refer to a view by specifying its name in
the from clause:

select ...

from viewname

where ...

order by …
Although there are circumstances where you can
change a view, most views are to be considered
as read-only data sources
slides Gerben Menschaert
Exercises
Create a view (genevw) from the query in the previous
exercise
Select all genes containing hemoglobin in the
description and sort the result set by gene length.

Next:
What is the minimum and maximum gene length?
What is the average gene length?
And the standard deviation?
Does the view show up when using

mysql> show tables;
slides Gerben Menschaert
Database backup
You can dump a complete database into a text
file:

$ mysqldump [opt] db > db.sql
This includes:
- statements for creating the database

if the option --databases is used
- statements for creating tables, views, ...
- statements for inserting data
To restore the database (you may need to create
it first):

$ mysql db < db.sql
slides Gerben Menschaert
Introduction to RDBMS
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
slides Gerben Menschaert
Database schema
Although you can execute DDL commands from the
MySQL monitor directly, this is not often done
There are tools that allow you to design a schema
graphically and generate the CREATE TABLE ...
statements
Examples:
MySQL workbench
HeidiSQL
slides Gerben Menschaert
MySQL workbench
Available as a standard package on some Linux distros (eg
Fedora)
Available as Windows MSI, Linux DEB or RPM package or
source archive from http://dev.mysql.com/downloads/
workbench/
To install a DEB package:

# dpkg -i package.deb
To install a RPM package:

# rpm -Uvh package.rpm
To install on Windows/Mac:

# double click package.msi or package.dmg
slides Gerben Menschaert
Database schema
Once the schema is designed, MySQL workbench can
generate a 'script' containing all SQL statements to
create the tables and other objects:
MySQL Workbench Model

Create Model
File -> 

Export -> 

Forward Engineer SQL CREATE Script
This 'script' can be executed as usual from the MySQL
monitor
slides Gerben Menschaert
MySQL workbench - demo
slides Gerben Menschaert
Inserting rows
To populate tables, use the INSERT SQL
statement:

mysql> insert into tbl

(col1, col2, ...) 

values
(val1, val2, ...) [,

(valx, valy, ...) , ...]
With:
–tbl the name of the table
–col1, col2, ... a list (subset) of column names
–val1 value for col1
–val2 value for col2
slides Gerben Menschaert
Inserting rows - examples
Example (biodb version 1)

insert into modorg
(id, class, genus, species,nchr, gsize,
draft)

values
(1, “Bacteria”, “Escherichia”, “coli”,1,
4.639, “1997-09-05 00:00:00”)
Note that strings and dates have to be properly
quoted
slides Gerben Menschaert
Inserting rows
You can leave out the column list if
–a value is given for all columns
–the values are specified in the order dictated by
the schema
mysql> insert into tbl

values
(val1, val2, ...) [,

(valx, valy, ...) , ...]
slides Gerben Menschaert
Changing rows
To change one or more rows, use the UPDATE
SQL statement:
mysql> update tbl

set col1=expr1 [, col2=expr2, ...]

[where cond]
With:
–tbl the name of the table
–col1 the column to change
–expr1 the new value
–cond the row filter - if unspecified, all rows of the
table will be updated
slides Gerben Menschaert
Changing rows - examples
To change the C elegans number of
chromosomes to 7:

update modorg

set nchr = 7
where genus = “caenorhabditis”

and species = “elegans”;
To change the draft date to the current date:

update modorg

set draft = now();
slides Gerben Menschaert
Deleting rows
To remove rows, you use the DELETE SQL statement:

delete from tbl

[where cond]
With:
–tbl the name of the table
–cond the row filter - if unspecified, all rows of the
table will be deleted
–note: since you can only remove entire rows, there is
no need to specify column names
slides Gerben Menschaert
Deleting rows - examples
To remove all in model organisms with a
genome publishing date before 2000:

delete from modorg

where year(draft) < 2000;
slides Gerben Menschaert
Introduction to RDBMS
1. Introduction & Installation
2. Hello data? - SQL
3. DB Design: MySQLWorkBench
4. Biological DBs using RDBMS
slides Gerben Menschaert
Known examples
Ensembl:
http://www.ensembl.org/downloads.html
UCSC Table Browser:
https://genome.ucsc.edu/cgi-bin/hgTables
BioMart:
http://www.ensembl.org/biomart/
slides Gerben Menschaert
Ensembl Core Schema
slides Gerben Menschaert
UCSC Table Browser
slides Gerben Menschaert
BioMart Reverse Star Schema
- For fast retrieval
of large quantities
of descriptive
data
- Main table
columns are
mainly query
constraints
slides Gerben Menschaert
EnsMart
slides Gerben Menschaert
Useful links for further reading
http://www.tutorialspoint.com/sql/
http://www.sqlcourse.com/
http://shop.oreilly.com/product/9780596009762.do
(O’Reilly: SQL CookBook or MySQL CookBook)

Weitere ähnliche Inhalte

Was ist angesagt?

MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle DevelopersRonald Bradford
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourRonald Bradford
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersRonald Bradford
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsRonald Bradford
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
 
MySQL Best Practices - OTN
MySQL Best Practices - OTNMySQL Best Practices - OTN
MySQL Best Practices - OTNRonald Bradford
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015Dave Stokes
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backupAndrejs Vorobjovs
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manualMir Majid
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage enginesVasudeva Rao
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012Roland Bouman
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesLenz Grimmer
 

Was ist angesagt? (19)

MySql:Introduction
MySql:IntroductionMySql:Introduction
MySql:Introduction
 
MySQL
MySQLMySQL
MySQL
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
My sql administration
My sql administrationMy sql administration
My sql administration
 
MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle Developers
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10
 
MySQL Best Practices - OTN
MySQL Best Practices - OTNMySQL Best Practices - OTN
MySQL Best Practices - OTN
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backup
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manual
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage engines
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best Practices
 

Andere mochten auch (8)

Bio ontologies and semantic technologies
Bio ontologies and semantic technologiesBio ontologies and semantic technologies
Bio ontologies and semantic technologies
 
P3 2017 python_regexes
P3 2017 python_regexesP3 2017 python_regexes
P3 2017 python_regexes
 
P4 2017 io
P4 2017 ioP4 2017 io
P4 2017 io
 
T5 2017 database_searching_v_upload
T5 2017 database_searching_v_uploadT5 2017 database_searching_v_upload
T5 2017 database_searching_v_upload
 
P1 2017 python
P1 2017 pythonP1 2017 python
P1 2017 python
 
20170509 rand db_lesugent
20170509 rand db_lesugent20170509 rand db_lesugent
20170509 rand db_lesugent
 
P1 3 2017_python_exercises
P1 3 2017_python_exercisesP1 3 2017_python_exercises
P1 3 2017_python_exercises
 
P2 2017 python_strings
P2 2017 python_stringsP2 2017 python_strings
P2 2017 python_strings
 

Ähnlich wie Mysql all

MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsRogério Rocha
 
Get mysql clusterrunning-windows
Get mysql clusterrunning-windowsGet mysql clusterrunning-windows
Get mysql clusterrunning-windowsJoeSg
 
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012Scott Sutherland
 
SULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN BASHA
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloudTahsin Hasan
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With MysqlHarit Kothari
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guideSeungmin Shin
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionjulien pauli
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 

Ähnlich wie Mysql all (20)

Mysql introduction
Mysql introduction Mysql introduction
Mysql introduction
 
Mysql tutorial
Mysql tutorialMysql tutorial
Mysql tutorial
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Mysql-Basics.pptx
Mysql-Basics.pptxMysql-Basics.pptx
Mysql-Basics.pptx
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windows
 
Get mysql clusterrunning-windows
Get mysql clusterrunning-windowsGet mysql clusterrunning-windows
Get mysql clusterrunning-windows
 
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
 
SULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpress
 
Sah
SahSah
Sah
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
Mysql
Mysql Mysql
Mysql
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With Mysql
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
Sql installation
Sql installationSql installation
Sql installation
 
My sql basic
My sql basicMy sql basic
My sql basic
 

Mehr von Prof. Wim Van Criekinge

2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_uploadProf. Wim Van Criekinge
 
2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_uploadProf. Wim Van Criekinge
 
2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_uploadProf. Wim Van Criekinge
 
2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_uploadProf. Wim Van Criekinge
 
Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Prof. Wim Van Criekinge
 
2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_uploadProf. Wim Van Criekinge
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_uploadProf. Wim Van Criekinge
 

Mehr von Prof. Wim Van Criekinge (20)

2020 02 11_biological_databases_part1
2020 02 11_biological_databases_part12020 02 11_biological_databases_part1
2020 02 11_biological_databases_part1
 
2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload
 
2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload
 
2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload
 
2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload
 
2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload
 
P7 2018 biopython3
P7 2018 biopython3P7 2018 biopython3
P7 2018 biopython3
 
P6 2018 biopython2b
P6 2018 biopython2bP6 2018 biopython2b
P6 2018 biopython2b
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
 
P3 2018 python_regexes
P3 2018 python_regexesP3 2018 python_regexes
P3 2018 python_regexes
 
T1 2018 bioinformatics
T1 2018 bioinformaticsT1 2018 bioinformatics
T1 2018 bioinformatics
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 
Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]
 
2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql
 
2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload
 
2018 03 20_biological_databases_part3
2018 03 20_biological_databases_part32018 03 20_biological_databases_part3
2018 03 20_biological_databases_part3
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload
 
P7 2017 biopython3
P7 2017 biopython3P7 2017 biopython3
P7 2017 biopython3
 
P6 2017 biopython2
P6 2017 biopython2P6 2017 biopython2
P6 2017 biopython2
 

Kürzlich hochgeladen

Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Kürzlich hochgeladen (20)

Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

Mysql all

  • 1. slides Gerben Menschaert Introduction to RDBMS 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS
  • 2. slides Gerben Menschaert 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS Introduction to RDBMS
  • 3. slides Gerben Menschaert Database Management System (DBMS) provides … …efficient, reliable, convenient, and safe multi-user storage of and access to massive amounts of persistent data.
  • 4. slides Gerben Menschaert • Massive • Persistent • Safe • multi-user • Convenient • Efficient • Reliable Terabytes Hardware, software, power, users Concurrency control Physical data independence High-level query languages declarative Thousands of queries/updates per sec. 99,99999% up-time
  • 5. slides Gerben Menschaert Databases !A database is a collection of data –numbers –dates –text or labels –… !A Database Management System –Data storage –Data retrieval –Data manipulation –Authentication & Authorization
  • 6. slides Gerben Menschaert Relational Databases Rigid structure 2 dimensional tables: –columns (fields) –rows (records)
  • 7. slides Gerben Menschaert Relational Databases Model objects (entities) and their relationships Example of a store that sells products to customers Entities: Customers
 —>Attributes: name, address, telephone number… Products 
 —>Attributes: name, price… Relationships: Sale
 —>Attributes: quantity, timestamp…
  • 8. slides Gerben Menschaert Relational Databases !MySQL Workbench: –graphical representation of entities and relationships –generates SQL statements to create database & tables
  • 9. slides Gerben Menschaert Relational Database Management Systems (RDBMS) • Enforce data integrity: Honors constraints on columns • Enforce referential integrity: Honors constraints on relations • See also: the 12 rules of Edgar Codd
 http://en.wikipedia.org/wiki/Codd%27s_12_rules
  • 10. slides Gerben Menschaert RDBMS Commercial products: Oracle DB2 (IBM) MS SQL Server (Microsoft) Open-source offerings: MySQL (Oracle) PostgreSQL SQLite
  • 11. slides Gerben Menschaert NoSQL Key-value stores Berkeley DB Document databases – unstructured data CouchDB MongoDB Cassandra (FaceBook) See also: http://en.wikipedia.org/wiki/Nosql
  • 12. slides Gerben Menschaert Introduction to RDBMS 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS
  • 13. slides Gerben Menschaert Installing MySQL on Linux !For DEB based Linux distributions
 (Debian, Ubuntu, …)
 > apt-get install mysql-server
 !For RPM based Linux distributions
 (RHEL, Fedora, CentOS, ...)
 > yum install mysql-server
  • 14. slides Gerben Menschaert Installing MySQL on Windows/Mac An installable (MSI) package is available on the MySQL site: http://www.mysql.com/ Follow the 'Downloads (GA)' link Choose 'MySQL Community Edition’, ‘MySQL Community Server’ Select 'Microsoft Windows' or 'Mac OS X' as platform
  • 15. slides Gerben Menschaert Running MySQL – Unix/Mac To start / stop / restart the MySQL service UNIX:
 > service mysql start
 > service mysql stop
 > service mysql restart When starting MySQL for the first time, the system administrator is reminded that the MySQL setup is not yet secured To start / stop / restart the MySQL service Mac: > cd /usr/local/mysql-xxversion/support-files/ > sudo ./mysql.server start|stop|restart|reload|force- reload|status
 Notes on Mac installation: https://dev.mysql.com/doc/refman/5.1/en/osx-installation-notes.html
  • 16. slides Gerben Menschaert Running MySQL – Unix/Mac !To check whether or not mysql is running correctly: 
 > service mysql status (UNIX)
 mysql start/running, process 3394
 > ps -ef | grep mysql mysql 3394 1 0 12:09 ? 00:00:00 /usr/sbin/mysqld
 
 > netstat | grep mysql tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3394/mysqld
  • 17. slides Gerben Menschaert Running MySQL – Windows !To check whether or not mysql is running correctly: 
 Check services running: –Windows XP: Start/Control Panal/Administrative Tools/Services –Windows 7: Start/ConfiguratieScherm/System & Beveiliging/ –Windows 10: Start/Settings (Look for services)

  • 18. slides Gerben Menschaert Exercises !Install MySQL !Add executable to PATH environment !Start the service !Check whether or not the service has been started Mac: export PATH=${PATH}:/usr/local/mysql/bin/ Win10: settings -> search for path https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/mysql-installation-windows-path.html
  • 19. slides Gerben Menschaert The MySQL monitor !To connect or log on to a MySQL database service:
 > mysql !The MySQL monitor has many options, you can review them using:
 > man mysql
 or 
 > mysql --help
  • 20. slides Gerben Menschaert The MySQL monitor !The most important options are:
 > mysql [options] [database]
 -u uname | --user=uname
 default: UNIX account
 -p [pwd]| --password[=pwd]
 default: <none>
 if pwd not given, prompt for password
 -h hname | --host=hname
 default: localhost
 -P prt | --port=prt
 default: 3306
  • 21. slides Gerben Menschaert Exercises Connect to the database and execute the following SQL statements:
 mysql> select current_user();
 mysql> show databases; For Mac (initial password reset necessary for root account): mysql> alter user ‘root’@‘localhost’ identified by ‘newpassword’;
  • 22. slides Gerben Menschaert The MySQL monitor Once connected to the database server, you can execute SQL statements:
 mysql> statement; Every SQL statement should end with a semi-colon (;)
  • 23. slides Gerben Menschaert Exercises Create a database user: Choose database account, you are free to choose the password, the hostname is localhost try to remember userid/password throughout training :-) mysql> create user ‘new_user’; mysql> quit; > mysql -u ‘new_user’; mysql> alter user ‘new_user’@‘localhost’ identified by ‘newpassword’; mysql> quit; > mysql -u ‘new_user’ -p; 
 Try to connect as this user and execute the following SQL statements:
 mysql> select current_user;
 mysql> show databases;
  • 24. slides Gerben Menschaert Getting Help An extensive help system is available in the MySQL monitor:
 mysql> help 
 This gives an overview of commands you can use to customise the output You can get help on any function or statement:
 mysql> help contents 
 This shows you the broad topics of available help. You can drill down into any of these topics
  • 25. slides Gerben Menschaert Database User Privileges The created user has very limited privileges. To grant privileges prv on table tbl in database db, you need to execute the following statement:
 mysql> grant prv on db.tbl 
 to user@host; Some convenient wild cards: To grant all privileges, specify all as prv To include all databases, specify * as db To include all tables, specify * as tbl The given database and table names do not have to exist (yet)
  • 26. slides Gerben Menschaert Getting Help - Demo How to get help for creating users:
 mysql> help
 mysql> help contents
 mysql> help account management mysql> help create user
 How to use less as a pager (Mac/Unix):
 $ export PAGER=/usr/bin/less
 $ mysql
 mysql> pager
 PAGER set to '/usr/bin/less'
  • 27. slides Gerben Menschaert Introduction to RDBMS 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS
  • 28. slides Gerben Menschaert SQL SQL (Structured Query Language) is the language a RDBMS provides for: Data definition (DDL)
 CREATE TABLE, DROP DATABASE Data manipulation (DML)
 SELECT, INSERT, DELETE, UPDATE Data control (DCL)
 GRANT, REVOKE SQL is a ANSI/ISO standard - MySQL implements a broad subset of ANSI SQL 99
  • 30. slides Gerben Menschaert Table - Row (tuple) - Column Constraints: Not NULL, Default, Unique, Primary Key, Foreign Key, Check
  • 31. slides Gerben Menschaert The MySQL monitor (again) There are a number of ways to execute SQL statements using the MySQL monitor: Interactively
 $ mysql [database]
 mysql> stmt; From the command line
 $ mysql [database] -e 'stmt' From a file or a pipe (stdin)
 $ mysql [database] < stmt_file
 $ cat stmt_file | mysql [database]
  • 32. slides Gerben Menschaert Creating a Database Only database users with sufficient privileges can create databases (eg root@localhost) From the command line:
 $ mysqladmin [opt] create dbname
 mysqladmin shares the same command line options for user, password, host and port as mysql From within the MySQL monitor:
 mysql> create database dbname
  • 33. slides Gerben Menschaert Exercises As root@localhost, create database 'biodb' Grant all privileges to the database user you created before:
 mysql> grant all on biodb.* 
 to user@localhost; Download the file biodb1.sql - you might want to take a look at the contents (!) Execute all SQL statements in this file
  • 34. slides Gerben Menschaert Hierarchy A single MySQL service can have multiple databases
 mysql> show databases; A particular database db can have multiple tables
 mysql> use db;
 mysql> show tables; A particular table tbl can have multiple columns or fields
 mysql> show columns from tbl;
 mysql> show create table tbl;
  • 35. slides Gerben Menschaert Exercises !Connect to the database service as a normal user !What databases do you see? !What tables are defined in biodb? !What are the column names?
  • 36. slides Gerben Menschaert Retrieving rows !To read data from the database, you use the select SQL statement:
 select columnlist from src; !With –columnlist: !list of columns separated with a comma !use * to retrieve all columns –src: !single table or multiple tables joined together !subquery !view
  • 37. slides Gerben Menschaert Retrieving rows - examples !To show all data from table modorg:
 select * from modorg; !To show all model organisms:
 select genus, species
 from modorg;
  • 38. slides Gerben Menschaert Sorting rows When using select statements, the data is displayed in no particular order To sort on one or more columns, use the
 order by col1 [asc|desc]
 [, col2 [asc|desc]...]
 clause With colX: a column or column alias asc: ascending (default) order desc: descending order
  • 39. slides Gerben Menschaert Exercises !Show the names (genus & species) of all model organisms in the order of the publishing date of the draft
 !Show the names (genus & species) of all model organisms sorted by the number of chromosomes (most chromosomes on top) and than alphabetically by name
  • 40. slides Gerben Menschaert Calculated rows You can add columns in a query that calculate some value using other columns of the same row A multitude of functions and operators are available: see help in the MySQL monitor Examples:
 mysql> select 6 * 7;
 mysql> select 
 concat(class, " ", genus)
 from modorg; mysql> select now();
  • 41. slides Gerben Menschaert Calculated rows - numbers See help numeric functions Operators:
 +, -, *, /, % Functions: sqrt(x), power(x, y), ... exp(x), ln(x), ... sin(x), cos(x), ... round(x), ceil(x), floor(x), ... rand(), rand(x)
  • 42. slides Gerben Menschaert Calculated rows - strings See help string functions Functions: length(s) concat(s1, ...) upper(s), lower(s) trim(s), ltrim(s), rtrim(s) substr(s, ...) reverse(s) truncate(s)
  • 43. slides Gerben Menschaert Calculated rows - dates See help date and time functions Functions: currentdate(), now() year(d), month(d), week(d) dayofmonth(d), dayofweek(d) hour(d), minute(d), second(d)
  • 44. slides Gerben Menschaert Exercises Show model organism full name (as a single column) genome size (as Gb), rounded to 4 digits average chromosome size publication year of all rows sorted by average chromosome size (largest average chromosome size on top)
  • 45. slides Gerben Menschaert Column aliases Columns can be renamed (aliased): select col [as] alias … The aliases can be used in the order by clause
  • 46. slides Gerben Menschaert Exercises Show model organism full name (as a single column)
 as name average chromosome size as avgsize publication year
 as pubyear of all rows sorted by avgsize (largest size on top)
  • 47. slides Gerben Menschaert Filtering rows To select only those rows that meet certain criteria, use the where clause: select columnist from table where condition(s) [order by sortcol]; With condition(s): - one or more conditions, combined with
 not, and, or, xor - only the rows for which the condition(s) evaluate(s) TRUE are selected - you can not use column aliases in condition(s)
  • 48. slides Gerben Menschaert Filtering rows - conditions See help comparison operators Numerical comparison operations: = != or <> <, <=, >, >= between x and y (inclusive) Example: 
 select all organisms with more than 10 chromosomes:
 select genus, species from modorg
 where nchr > 10;
  • 49. slides Gerben Menschaert Filtering rows - conditions String comparison operations: = != or <> <, <=, >, >= (lexical) like “pattern”
 matches a pattern: _ (a single character - cfr shell ?) % (0 or more characters - cfr shell *) rlike “regex” [MySQL]
 matches a regular expression Example - select all mammals:
 select genus, species from modorg
 where class = “mammals”;
  • 50. slides Gerben Menschaert Filtering rows - conditions Dealing with NULL-values Testing for NULL-ness:
 select ... where col is null ...
 select ... where col is not null ... Substitution of NULL-values:
 select ifnull(col, value) ... this function returns: col if col is not NULL value if col is NULL Example:
 select genus, species, 
 ifnull(nchr, 0) 
 from modorg;
  • 51. slides Gerben Menschaert Filtering rows - conditions Boolean logic: not x
 evaluates TRUE if x is FALSE x and y
 evaluates TRUE if both x and y are TRUE x or y
 evaluates TRUE if x or y is TRUE, or both x xor y
 (eXclusive OR)
 evaluates TRUE if either x or y is TRUE, but not both
  • 52. slides Gerben Menschaert Exercises - Select all mammals with genomes published after 2005 - Select all organisms that have a average chromosome size between 10 and 100 Mbp - Select all organisms whose genus starts with A, B, C, D, or E
  • 53. slides Gerben Menschaert Filtering rows - duplicates To eliminate duplicate rows, use
 select distinct cols from … Each combination of cols is unique
  • 54. slides Gerben Menschaert Filtering rows - limiting output To limit the number of rows in a result set, use
 select ... limit n [offset r] The result set is limited to a maximum of n rows If an offset r is given, the first r rows are skipped It usually makes little sense to use limit without order by
  • 55. slides Gerben Menschaert Exercises Give an overview of all organism classes in the dataset (sorted alphabetically) Show the organism names of the top 3 largest genome sizes
  • 56. slides Gerben Menschaert Aggregation So far, queries have concentrated on particular rows Sometimes, you need to calculate a single result across multiple rows e.g.: what is the maximum genome size SQL allows you to - specify criteria to group rows together - calculate a single value per group - filter grouped data
  • 57. slides Gerben Menschaert Aggregation - functions See: help functions and modifiers for use with GROUP BY Functions: count(col), count(*), 
 count(distinct col) sum(col) min(col), max(col) avg(col), stddev(col), variance(col)
  • 58. slides Gerben Menschaert Exercises All queries below return a row count.
 What is the result? Why? select count(*) from modorg; select count(nchr) from modorg; select count(class) from modorg; select count(distinct class)
 from modorg; How many mammals are in the database?
  • 59. slides Gerben Menschaert Aggregation - groups The group by clause sorts data into groups for the purpose of aggregation:
 select [col,] aggregatefunctions
 from src
 [where cond]
 group by col
 [order by …]; All rows with the same value in col are grouped For each group, the aggregate function is calculated It usually makes no sense to select any columns other than col
  • 60. slides Gerben Menschaert Exercises How many organisms are present in the dataset for each class? Note the sort order. Show the minimum and maximum genome sizes for each class. 
 Take only those organisms into account for which the genome sizes are known. 
 Sort the results such that the biggest maximum genome size is on top.
  • 61. slides Gerben Menschaert Aggregation - filtering It is possible to query filter results based on the results of aggregate functions, using the
 having clause:
 select [col,] aggregatefunctions
 from src
 [where cond1]
 group by col
 having cond2 [order by …] Column aliases can be used in cond2
  • 62. slides Gerben Menschaert Execution order 1> Input columns are determined 2> where: input columns are filtered 3> group by: sorting & grouping 
 of filtered input 4> aggregation functions are calculated 5> having: aggregation results are filtered 6> order by: output is sorted 7> limit / offset: output is chopped
  • 63. slides Gerben Menschaert Exercises For each class with more than 1 organism, show the average number of chromosomes. 
 Sort the result such that the biggest average is on top.
  • 64. slides Gerben Menschaert Database upgrade To prepare for the next part: Download biodb2.sql Delete the database biodb: mysql> drop database biodb; Recreate the database biodb:
 mysql> create database biodb; Create the tables and insert the data
 $ mysql biodb < biodb2.sql
  • 65. slides Gerben Menschaert Joins Relational databases model entities and their relationships Different entities: different tables Joins allow you to combine information across different tables
  • 66. slides Gerben Menschaert Joins modorg.class_id is a foreign key that references class.id gene.mo_id is foreign key that references modorg.id
  • 67. slides Gerben Menschaert Joins - the Cartesian product When you specify multiple tables in a query, the database server will generate all possible combinations: the Cartesian product Example: table class has 6 rows table modorg has 10 rows query
 select * from modorg, class has 60 rows
  • 68. slides Gerben Menschaert Joins One way to look at joins is to consider it a filtered (think: where) Cartesian product: select * from modorg, class
 where modorg.class_id = class.id Note: - column name id is present in both tables class and modorg - to avoid ambiguity, the column name is qualified: class.id - column name modorg.class_id is also qualified, but since there is no ambiguity, this is not strictly necessary
  • 69. slides Gerben Menschaert Joins Alternative syntax: select * 
 from modorg [inner] join class
 on modorg.class_id = class.id; Both syntactical forms are considered completely equivalent - there is no compelling reason to prefer one above the other, it is just a matter of taste.
  • 70. slides Gerben Menschaert Joins - column aliases When specifying columns in the query, care must be taken to avoid ambiguity:
 mysql> select id, name, genus, species
 from modorg, class 
 where modorg.class_id = class.id;
 ERROR 1052 (23000): 
 Column 'id' in field list is ambiguous Ambiguous columns must be qualified. And additionally you can choose an alias:
 mysql> select modorg.id as mo_id, 
 name, genus, species 
 from modorg, class 
 where modorg.class_id = class.id;
  • 71. slides Gerben Menschaert Joins - data source aliases In some cases, you need to join a table with itself or you select data from a subquery In this case it can be handy (or even necessary) to alias the data source: select a.col, b.col
 from src1 [as] a, src2 [as] b where ...
  • 72. slides Gerben Menschaert Joins - data source aliases Consider the (at first sight) simple question:
 For each class, give the class name, organism name and date of the organism that was sequenced first A part of the answer is this:
 select class_id, min(draft) as dr from modorg 
 group by class_id; To add the class name: join with table class To add the organism name: join with table modorg
  • 73. slides Gerben Menschaert Joins - data source aliases Add the class name:
 select name, dr 
 from 
 (select class_id, min(draft) as dr 
 from modorg group by class_id) as s,
 class 
 where s.class_id = class.id; Add the organism name:
 select name, genus, species, dr
 from 
 (select class_id, min(draft) as dr 
 from modorg group by class_id) as s,
 class, modorg 
 where s.class_id = class.id 
 and s.dr = draft;
  • 74. slides Gerben Menschaert Exercises For all rows in table gene, show organism name class name accession length description of the gene
  • 75. slides Gerben Menschaert Outer joins Inner join: select class.name,genus,species, gene_acc 
 from 
 class inner join modorg oclass.id=modorg.class_id inner join gene on gene.mo_id = modorg.id; Left outer join:
 select class.name,genus,species, gene_acc 
 from 
 class inner join modorg oclass.id=modorg.class_id left outer join gene on gene.mo_id = modorg.id;
  • 76. slides Gerben Menschaert Reusing queries - views This last exercise is actually very useful as a data source itself: - It could be used as such (as a subquery) - but this would end up being inconvenient. - The query as such can be saved as a special table-like object, called a view. Syntax:
 create view viewname as
 select ...
  • 77. slides Gerben Menschaert Reusing queries - views You can refer to a view by specifying its name in the from clause:
 select ...
 from viewname
 where ...
 order by … Although there are circumstances where you can change a view, most views are to be considered as read-only data sources
  • 78. slides Gerben Menschaert Exercises Create a view (genevw) from the query in the previous exercise Select all genes containing hemoglobin in the description and sort the result set by gene length.
 Next: What is the minimum and maximum gene length? What is the average gene length? And the standard deviation? Does the view show up when using
 mysql> show tables;
  • 79. slides Gerben Menschaert Database backup You can dump a complete database into a text file:
 $ mysqldump [opt] db > db.sql This includes: - statements for creating the database
 if the option --databases is used - statements for creating tables, views, ... - statements for inserting data To restore the database (you may need to create it first):
 $ mysql db < db.sql
  • 80. slides Gerben Menschaert Introduction to RDBMS 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS
  • 81. slides Gerben Menschaert Database schema Although you can execute DDL commands from the MySQL monitor directly, this is not often done There are tools that allow you to design a schema graphically and generate the CREATE TABLE ... statements Examples: MySQL workbench HeidiSQL
  • 82. slides Gerben Menschaert MySQL workbench Available as a standard package on some Linux distros (eg Fedora) Available as Windows MSI, Linux DEB or RPM package or source archive from http://dev.mysql.com/downloads/ workbench/ To install a DEB package:
 # dpkg -i package.deb To install a RPM package:
 # rpm -Uvh package.rpm To install on Windows/Mac:
 # double click package.msi or package.dmg
  • 83. slides Gerben Menschaert Database schema Once the schema is designed, MySQL workbench can generate a 'script' containing all SQL statements to create the tables and other objects: MySQL Workbench Model
 Create Model File -> 
 Export -> 
 Forward Engineer SQL CREATE Script This 'script' can be executed as usual from the MySQL monitor
  • 84. slides Gerben Menschaert MySQL workbench - demo
  • 85. slides Gerben Menschaert Inserting rows To populate tables, use the INSERT SQL statement:
 mysql> insert into tbl
 (col1, col2, ...) 
 values (val1, val2, ...) [,
 (valx, valy, ...) , ...] With: –tbl the name of the table –col1, col2, ... a list (subset) of column names –val1 value for col1 –val2 value for col2
  • 86. slides Gerben Menschaert Inserting rows - examples Example (biodb version 1)
 insert into modorg (id, class, genus, species,nchr, gsize, draft)
 values (1, “Bacteria”, “Escherichia”, “coli”,1, 4.639, “1997-09-05 00:00:00”) Note that strings and dates have to be properly quoted
  • 87. slides Gerben Menschaert Inserting rows You can leave out the column list if –a value is given for all columns –the values are specified in the order dictated by the schema mysql> insert into tbl
 values (val1, val2, ...) [,
 (valx, valy, ...) , ...]
  • 88. slides Gerben Menschaert Changing rows To change one or more rows, use the UPDATE SQL statement: mysql> update tbl
 set col1=expr1 [, col2=expr2, ...]
 [where cond] With: –tbl the name of the table –col1 the column to change –expr1 the new value –cond the row filter - if unspecified, all rows of the table will be updated
  • 89. slides Gerben Menschaert Changing rows - examples To change the C elegans number of chromosomes to 7:
 update modorg
 set nchr = 7 where genus = “caenorhabditis”
 and species = “elegans”; To change the draft date to the current date:
 update modorg
 set draft = now();
  • 90. slides Gerben Menschaert Deleting rows To remove rows, you use the DELETE SQL statement:
 delete from tbl
 [where cond] With: –tbl the name of the table –cond the row filter - if unspecified, all rows of the table will be deleted –note: since you can only remove entire rows, there is no need to specify column names
  • 91. slides Gerben Menschaert Deleting rows - examples To remove all in model organisms with a genome publishing date before 2000:
 delete from modorg
 where year(draft) < 2000;
  • 92. slides Gerben Menschaert Introduction to RDBMS 1. Introduction & Installation 2. Hello data? - SQL 3. DB Design: MySQLWorkBench 4. Biological DBs using RDBMS
  • 93. slides Gerben Menschaert Known examples Ensembl: http://www.ensembl.org/downloads.html UCSC Table Browser: https://genome.ucsc.edu/cgi-bin/hgTables BioMart: http://www.ensembl.org/biomart/
  • 96. slides Gerben Menschaert BioMart Reverse Star Schema - For fast retrieval of large quantities of descriptive data - Main table columns are mainly query constraints
  • 98. slides Gerben Menschaert Useful links for further reading http://www.tutorialspoint.com/sql/ http://www.sqlcourse.com/ http://shop.oreilly.com/product/9780596009762.do (O’Reilly: SQL CookBook or MySQL CookBook)