SlideShare a Scribd company logo
FBW
27-02-2018
Biological Databases
Wim Van Criekinge
Syllabi left
Project
Big Data Volumes
Data Levels in Biological Research
Primary dataDerived data
Primary dataDerived data
Interpreted data/
knowledge
Experimental metadata
Analytical metadata
Direct Queryability of Selected Bioinformatics Databases
Database Direct Querying? How? Modality DB Engine
ArrayExpressWarehouse Eventually http://www.ebi.ac.uk/aedw/ SQL Oracle
BioWarehouse Yes
http://biowarehouse.ai.sri.com/
- need account
SQL Oracle/MySQL
Ensembl Yes
http://www.ensembl.org/info/d
ata/download.html
SQL MySQL
Mouse Genome Database Yes ask for account SQL Sybase
PharmGKB Yes
http://www.pharmgkb.org/hom
e/projects/webservices/
SOAP-based Oracle
Saccharomyces Genome
Database
EventuallyMaybe Oracle
Stanford Microarray Database No Oracle
Example 3-tier model in biological database
Rationale to study SQL
• Learning SQL to Query Biological Databases
• Are you getting too much data, or missing crucial
data when querying via a Web interface? Many
biological databases can be queried directly via
SQL, thus bypassing the limitations of the
database's interface. SQL is at the heart of
biological databases as diverse as Ensembl,
ArrayExpress and the Mouse Genome Database.
• Focus on understanding relational databases by
studying a repository of biological data and learn
how to query it using SQL.
SQL consists of only 4 statements, sometimes
referred to as CRUD:
–Create - INSERT - to store new data
–Read - SELECT - to retrieve data
–Update - UPDATE - to change or modify
data.
–Delete - DELETE - delete or remove data
Structured Query Language
Definitions
Definitions
• Database: Collection of tables 
• Table
– Collection of records that share a common
fundamental characteristic
• E.g., patients and locations can each be stored in
their own table
• Record
– Basic unit of information in a relation
information
– A record is composed of fields
– E.g., 1 record per person
• Query
– Set of instructions to a database “engine” to
retrieve, sort and format returning data.
• “find me all patients in my database”
Table Characteristics
• Two-dimensional structure with rows and
columns
• Rows (tuples) represent single entity
• Columns represent attributes
• Row/column intersection represents single value
• Tables must have an attribute to uniquely identify
each row
• Column values all have same data format
• Each column has range of values called attribute
domain
• Order of the rows and columns is immaterial to
the DBMS
Numeric Data Types
MySQL uses all the standard ANSI SQL numeric data types, so if you're coming to MySQL from a different
database system, these definitions will look familiar to you. The following list shows the common numeric data
types and their descriptions:
INT - A normal-sized integer that can be signed or unsigned. If signed, the allowable range is from -2147483648 to
2147483647. If unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 digits.
TINYINT - A very small integer that can be signed or unsigned. If signed, the allowable range is from -128 to 127.
If unsigned, the allowable range is from 0 to 255. You can specify a width of up to 4 digits.
SMALLINT - A small integer that can be signed or unsigned. If signed, the allowable range is from -32768 to
32767. If unsigned, the allowable range is from 0 to 65535. You can specify a width of up to 5 digits.
MEDIUMINT - A medium-sized integer that can be signed or unsigned. If signed, the allowable range is from -
8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215. You can specify a width of up to 9
digits.
BIGINT - A large integer that can be signed or unsigned. If signed, the allowable range is from -
9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to
18446744073709551615. You can specify a width of up to 20 digits.
FLOAT(M,D) - A floating-point number that cannot be unsigned. You can define the display length (M) and the
number of decimals (D). This is not required and will default to 10,2, where 2 is the number of decimals and 10 is
the total number of digits (including decimals). Decimal precision can go to 24 places for a FLOAT.
DOUBLE(M,D) - A double precision floating-point number that cannot be unsigned. You can define the display
length (M) and the number of decimals (D). This is not required and will default to 16,4, where 4 is the number of
decimals. Decimal precision can go to 53 places for a DOUBLE. REAL is a synonym for DOUBLE.
DECIMAL(M,D) - An unpacked floating-point number that cannot be unsigned. In unpacked decimals, each
decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required.
NUMERIC is a synonym for DECIMAL.
String Data Type
• Although numeric and date types are fun, most data you'll store will be in string format. This list describes
the common string datatypes in MySQL.
• CHAR(M) - A fixed-length string between 1 and 255 characters in length (for example CHAR(5)), right-
padded with spaces to the specified length when stored. Defining a length is not required, but the default
is 1.
• VARCHAR(M) - A variable-length string between 1 and 255 characters in length; for example
VARCHAR(25). You must define a length when creating a VARCHAR field.
• BLOB or TEXT - A field with a maximum length of 65535 characters. BLOBs are "Binary Large Objects"
and are used to store large amounts of binary data, such as images or other types of files. Fields defined
as TEXT also hold large amounts of data; the difference between the two is that sorts and comparisons
on stored data are case sensitive on BLOBs and are not case sensitive in TEXT fields. You do not specify
a length with BLOB or TEXT.
• TINYBLOB or TINYTEXT - A BLOB or TEXT column with a maximum length of 255 characters. You do
not specify a length with TINYBLOB or TINYTEXT.
• MEDIUMBLOB or MEDIUMTEXT - A BLOB or TEXT column with a maximum length of 16777215
characters. You do not specify a length with MEDIUMBLOB or MEDIUMTEXT.
• LONGBLOB or LONGTEXT - A BLOB or TEXT column with a maximum length of 4294967295
characters. You do not specify a length with LONGBLOB or LONGTEXT.
• ENUM - An enumeration, which is a fancy term for list. When defining an ENUM, you are creating a list of
items from which the value must be selected (or it can be NULL). For example, if you wanted your field to
contain "A" or "B" or "C", you would define your ENUM as ENUM ('A', 'B', 'C') and only those values (or
NULL) could ever populate that field.
Built-in Data Types in SQL
• date: Dates, containing a (4 digit) year, month and
date
– Example: date ‘2005-7-27’
• time: Time of day, in hours, minutes and seconds.
– Example: time ‘09:00:30’ time ‘09:00:30.75’
• timestamp: date plus time of day
– Example: timestamp ‘2005-7-27 09:00:30.75’
• interval: period of time
– Example: interval ‘1’ day
– Subtracting a date/time/timestamp value from another gives
an interval value
– Interval values can be added to date/time/timestamp values
Build-in Data Types in SQL (Cont.)
• Can extract values of individual fields from
date/time/timestamp
– Example: extract (year from r.starttime)
• Can cast string types to
date/time/timestamp
– Example: cast <string-valued-expression>
as date
– Example: cast <string-valued-expression>
as time
User-Defined Types
• create type construct in SQL creates user-defined
type
create type Dollars as numeric (12,2) final
• create domain construct in SQL-92 creates user-
defined domain types
create domain person_name char(20) not null
• Types and domains are similar. Domains can have
constraints, such as not null, specified on them.
Large-Object Types
• Large objects (photos, videos, CAD files, etc.)
are stored as a large object:
– blob: binary large object -- object is a large
collection of uninterpreted binary data (whose
interpretation is left to an application outside of
the database system)
– clob: character large object -- object is a large
collection of character data
– When a query returns a large object, a pointer is
returned rather than the large object itself.
Creating a Table
• To create a table, use the CREATE TABLE command:
mysql> CREATE TABLE pet (
-> name VARCHAR(20),
-> owner VARCHAR(20),
-> species VARCHAR(20),
-> sex CHAR(1),
-> birth DATE, death DATE);
Query OK, 0 rows affected (0.04 sec)
Keys
• One or more attributes that
determine other attributes
– Key attribute
– Composite key
• Full functional dependence
• Entity integrity
– Uniqueness
– No ‘null’ value in key
Example Tables
Simple Relational Database
Keys (con’t.)
• Primary key
– Candidate key to uniquely identify all other
attributes in a given row
• Foreign key
– Values must match primary key in another
table
Integrity Rules
• Entity integrity
– Ensures all entities are unique
– Each entity has unique key
• Referential integrity
– Foreign key must have null value or match
primary key values
– Makes it impossible to delete row whose
primary key has mandatory matching foreign
key values in another table
Integrity Constraints
• Integrity constraints guard against
accidental damage to the database, by
ensuring that authorized changes to the
database do not result in a loss of data
consistency.
– A checking account must have a balance
greater than $10,000.00
– A salary of a bank employee must be at
least $4.00 an hour
– A customer must have a (non-null) phone
number
Referential Integrity
• Ensures that a value that appears in one relation for a given set of
attributes also appears for a certain set of attributes in another
relation.
– Example: If “Perryridge” is a branch name appearing in one of the
tuples in the account relation, then there exists a tuple in the
branch relation for branch “Perryridge”.
• Primary and candidate keys and foreign keys can be specified as part
of the SQL create table statement:
– The primary key clause lists attributes that comprise the primary
key.
– The unique key clause lists attributes that comprise a candidate
key.
– The foreign key clause lists the attributes that comprise the
foreign key and the name of the relation referenced by the foreign
key. By default, a foreign key references the primary key attributes
of the referenced table.
Install BIOSQL locally
• Get latest version of mysql (MAMP,
mariaDB)
• Download biosqldb-mysql.sql
• Remove type=innodb
• Launch database server
• Connect using toad (port 8889)
• Create database biosql;
• Set as active database
• Use worksheet to execute biosqldb-
mysql.sql
Typical ODBC Architecture
How ODBC Works?
• ODBC inserts a middle layer called a Client
Driver
• Purpose of the Client Driver is to translate the
applications queries into commands that the
DBMS understands
Other Parts of the Architecture
• Application – calls functions defined in the
ODBC API to access a data source
• Driver Manager – implements the ODBC API
and provides information to the application
• Database – contains all the data
Setting Up a Data Source in Windows
• A data source is just a database that ODBC
connects to
• This allows the person to change database
types without any changes to the program
• Step 1. Get a database.
– Using access for this example because it’s on this
computer
Conclusion
The four parts that make up ODBC:
Conclusion
• Advantages:
– Allows access to different types of databases
– Uniform way of retrieving information
– Highly efficient
– Low memory requirements
• Disadvantages
– Complex and steep learning curve
– All data in database must look like a relational
database
Conclusion
• ODBC changed the way people code their programs
that have to interact with databases.
• The efficiency of programmers in the business world
has increased due to ODBC because they no longer
are wasting time to create multiple copies of a
program.
• ODBC has vastly improved the way programmers
deal with databases.
Application/utilities
Project

More Related Content

What's hot

اىفناىنمفبانفيا
اىفناىنمفبانفيااىفناىنمفبانفيا
اىفناىنمفبانفياBisan Rjoub
 
Defining Data in IBM SPSS Statistics
Defining Data in IBM SPSS StatisticsDefining Data in IBM SPSS Statistics
Defining Data in IBM SPSS Statistics
Thiyagu K
 
SPSS introduction Presentation
SPSS introduction Presentation SPSS introduction Presentation
SPSS introduction Presentation
befikra
 
Introduction to spss 1
Introduction to spss 1Introduction to spss 1
Introduction to spss 1
Michael Taiwo
 
T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)
Naji El Kotob
 
Spss training notes
Spss training notesSpss training notes
Spss training notes
Mzee Theogene KUBAHONIYESU
 
Crosstab query techniques
Crosstab query techniquesCrosstab query techniques
Crosstab query techniquesaabaap
 
Intro to JMP for statistics
Intro to JMP for statisticsIntro to JMP for statistics
Spss data capturing training
Spss data capturing trainingSpss data capturing training
Spss data capturing training
MarotaAphane
 
sorting and filtering data in excel
sorting and filtering data in excelsorting and filtering data in excel
sorting and filtering data in excel
aroosa zaidi
 
Presentation on spss
Presentation on spssPresentation on spss
Presentation on spss
alfiyajamalcj
 
Elementary Data Analysis with MS Excel_Day-4
Elementary Data Analysis with MS Excel_Day-4Elementary Data Analysis with MS Excel_Day-4
Elementary Data Analysis with MS Excel_Day-4
Redwan Ferdous
 
Advanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-ExcelAdvanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-Excel
P. SUNDARI ARUN
 
Spss beginners
Spss beginnersSpss beginners
Spss beginners
Mbabazi Theos
 
Data entry in Excel and SPSS
Data entry in Excel and SPSS Data entry in Excel and SPSS
Data entry in Excel and SPSS
Dhritiman Chakrabarti
 
Introduction
IntroductionIntroduction
Introduction
Ryan Herzog
 

What's hot (20)

اىفناىنمفبانفيا
اىفناىنمفبانفيااىفناىنمفبانفيا
اىفناىنمفبانفيا
 
Defining Data in IBM SPSS Statistics
Defining Data in IBM SPSS StatisticsDefining Data in IBM SPSS Statistics
Defining Data in IBM SPSS Statistics
 
SPSS introduction Presentation
SPSS introduction Presentation SPSS introduction Presentation
SPSS introduction Presentation
 
Introduction to spss 1
Introduction to spss 1Introduction to spss 1
Introduction to spss 1
 
T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)
 
Spss training notes
Spss training notesSpss training notes
Spss training notes
 
SPSS
SPSSSPSS
SPSS
 
Spss an introduction
Spss  an introductionSpss  an introduction
Spss an introduction
 
Crosstab query techniques
Crosstab query techniquesCrosstab query techniques
Crosstab query techniques
 
Spss tutorial 1
Spss tutorial 1Spss tutorial 1
Spss tutorial 1
 
Spss
SpssSpss
Spss
 
Intro to JMP for statistics
Intro to JMP for statisticsIntro to JMP for statistics
Intro to JMP for statistics
 
Spss data capturing training
Spss data capturing trainingSpss data capturing training
Spss data capturing training
 
sorting and filtering data in excel
sorting and filtering data in excelsorting and filtering data in excel
sorting and filtering data in excel
 
Presentation on spss
Presentation on spssPresentation on spss
Presentation on spss
 
Elementary Data Analysis with MS Excel_Day-4
Elementary Data Analysis with MS Excel_Day-4Elementary Data Analysis with MS Excel_Day-4
Elementary Data Analysis with MS Excel_Day-4
 
Advanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-ExcelAdvanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-Excel
 
Spss beginners
Spss beginnersSpss beginners
Spss beginners
 
Data entry in Excel and SPSS
Data entry in Excel and SPSS Data entry in Excel and SPSS
Data entry in Excel and SPSS
 
Introduction
IntroductionIntroduction
Introduction
 

Similar to 2018 02 20_biological_databases_part2_v_upload

2016 02 23_biological_databases_part2
2016 02 23_biological_databases_part22016 02 23_biological_databases_part2
2016 02 23_biological_databases_part2
Prof. Wim Van Criekinge
 
2017 biological databasespart2
2017 biological databasespart22017 biological databasespart2
2017 biological databasespart2
Prof. 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_upload
Prof. Wim Van Criekinge
 
MySql
MySqlMySql
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
VillainMass
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
MattMarino13
 
Structured Query Language (SQL) _ Edu4Sure Training.pptx
Structured Query Language (SQL) _ Edu4Sure Training.pptxStructured Query Language (SQL) _ Edu4Sure Training.pptx
Structured Query Language (SQL) _ Edu4Sure Training.pptx
Edu4Sure
 
Mangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.pptMangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.ppt
Mihir Shah
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptx
RUBAB79
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
rainynovember12
 
Sql
SqlSql
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfSimple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
ManojVishwakarma91
 
DBMS Relational Data Model .pptx
DBMS Relational Data Model .pptxDBMS Relational Data Model .pptx
DBMS Relational Data Model .pptx
RajSurase1
 
ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
SQL cheat sheet.pdf
SQL cheat sheet.pdfSQL cheat sheet.pdf
SQL cheat sheet.pdf
NiravPanchal50
 
Sql and mysql database concepts
Sql and mysql database conceptsSql and mysql database concepts
Sql and mysql database conceptsSelamawit Feleke
 
Intro To TSQL - Unit 5
Intro To TSQL - Unit 5Intro To TSQL - Unit 5
Intro To TSQL - Unit 5
iccma
 
Intro to tsql unit 5
Intro to tsql   unit 5Intro to tsql   unit 5
Intro to tsql unit 5Syed Asrarali
 
Physical elements of data
Physical elements of dataPhysical elements of data
Physical elements of dataDimara Hakim
 

Similar to 2018 02 20_biological_databases_part2_v_upload (20)

2016 02 23_biological_databases_part2
2016 02 23_biological_databases_part22016 02 23_biological_databases_part2
2016 02 23_biological_databases_part2
 
2017 biological databasespart2
2017 biological databasespart22017 biological databasespart2
2017 biological databasespart2
 
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
 
MySql
MySqlMySql
MySql
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
 
Structured Query Language (SQL) _ Edu4Sure Training.pptx
Structured Query Language (SQL) _ Edu4Sure Training.pptxStructured Query Language (SQL) _ Edu4Sure Training.pptx
Structured Query Language (SQL) _ Edu4Sure Training.pptx
 
Mangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.pptMangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.ppt
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptx
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
Sql
SqlSql
Sql
 
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfSimple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
 
DBMS Relational Data Model .pptx
DBMS Relational Data Model .pptxDBMS Relational Data Model .pptx
DBMS Relational Data Model .pptx
 
ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
ADBMS Unit-II b
 
SQL cheat sheet.pdf
SQL cheat sheet.pdfSQL cheat sheet.pdf
SQL cheat sheet.pdf
 
Sql and mysql database concepts
Sql and mysql database conceptsSql and mysql database concepts
Sql and mysql database concepts
 
MySQL Data types
MySQL Data typesMySQL Data types
MySQL Data types
 
Intro To TSQL - Unit 5
Intro To TSQL - Unit 5Intro To TSQL - Unit 5
Intro To TSQL - Unit 5
 
Intro to tsql unit 5
Intro to tsql   unit 5Intro to tsql   unit 5
Intro to tsql unit 5
 
Physical elements of data
Physical elements of dataPhysical elements of data
Physical elements of data
 

More from Prof. Wim Van Criekinge

2020 02 11_biological_databases_part1
2020 02 11_biological_databases_part12020 02 11_biological_databases_part1
2020 02 11_biological_databases_part1
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_upload
Prof. 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_upload
Prof. 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_upload
Prof. 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_upload
Prof. Wim Van Criekinge
 
P7 2018 biopython3
P7 2018 biopython3P7 2018 biopython3
P7 2018 biopython3
Prof. Wim Van Criekinge
 
P6 2018 biopython2b
P6 2018 biopython2bP6 2018 biopython2b
P6 2018 biopython2b
Prof. Wim Van Criekinge
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
Prof. Wim Van Criekinge
 
P3 2018 python_regexes
P3 2018 python_regexesP3 2018 python_regexes
P3 2018 python_regexes
Prof. Wim Van Criekinge
 
T1 2018 bioinformatics
T1 2018 bioinformaticsT1 2018 bioinformatics
T1 2018 bioinformatics
Prof. Wim Van Criekinge
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
Prof. 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 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
Prof. Wim Van Criekinge
 
2018 03 20_biological_databases_part3
2018 03 20_biological_databases_part32018 03 20_biological_databases_part3
2018 03 20_biological_databases_part3
Prof. 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_upload
Prof. Wim Van Criekinge
 
P7 2017 biopython3
P7 2017 biopython3P7 2017 biopython3
P7 2017 biopython3
Prof. Wim Van Criekinge
 
P6 2017 biopython2
P6 2017 biopython2P6 2017 biopython2
P6 2017 biopython2
Prof. Wim Van Criekinge
 
Van criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotechVan criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotech
Prof. Wim Van Criekinge
 
P4 2017 io
P4 2017 ioP4 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
Prof. Wim Van Criekinge
 

More from 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 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 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_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
 
Van criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotechVan criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotech
 
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
 

Recently uploaded

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 

Recently uploaded (20)

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 

2018 02 20_biological_databases_part2_v_upload

  • 1.
  • 3.
  • 4.
  • 8.
  • 9. Data Levels in Biological Research
  • 11. Primary dataDerived data Interpreted data/ knowledge Experimental metadata Analytical metadata
  • 12. Direct Queryability of Selected Bioinformatics Databases Database Direct Querying? How? Modality DB Engine ArrayExpressWarehouse Eventually http://www.ebi.ac.uk/aedw/ SQL Oracle BioWarehouse Yes http://biowarehouse.ai.sri.com/ - need account SQL Oracle/MySQL Ensembl Yes http://www.ensembl.org/info/d ata/download.html SQL MySQL Mouse Genome Database Yes ask for account SQL Sybase PharmGKB Yes http://www.pharmgkb.org/hom e/projects/webservices/ SOAP-based Oracle Saccharomyces Genome Database EventuallyMaybe Oracle Stanford Microarray Database No Oracle
  • 13. Example 3-tier model in biological database
  • 14. Rationale to study SQL • Learning SQL to Query Biological Databases • Are you getting too much data, or missing crucial data when querying via a Web interface? Many biological databases can be queried directly via SQL, thus bypassing the limitations of the database's interface. SQL is at the heart of biological databases as diverse as Ensembl, ArrayExpress and the Mouse Genome Database. • Focus on understanding relational databases by studying a repository of biological data and learn how to query it using SQL.
  • 15. SQL consists of only 4 statements, sometimes referred to as CRUD: –Create - INSERT - to store new data –Read - SELECT - to retrieve data –Update - UPDATE - to change or modify data. –Delete - DELETE - delete or remove data Structured Query Language
  • 16. Definitions Definitions • Database: Collection of tables  • Table – Collection of records that share a common fundamental characteristic • E.g., patients and locations can each be stored in their own table • Record – Basic unit of information in a relation information – A record is composed of fields – E.g., 1 record per person • Query – Set of instructions to a database “engine” to retrieve, sort and format returning data. • “find me all patients in my database”
  • 17. Table Characteristics • Two-dimensional structure with rows and columns • Rows (tuples) represent single entity • Columns represent attributes • Row/column intersection represents single value • Tables must have an attribute to uniquely identify each row • Column values all have same data format • Each column has range of values called attribute domain • Order of the rows and columns is immaterial to the DBMS
  • 18. Numeric Data Types MySQL uses all the standard ANSI SQL numeric data types, so if you're coming to MySQL from a different database system, these definitions will look familiar to you. The following list shows the common numeric data types and their descriptions: INT - A normal-sized integer that can be signed or unsigned. If signed, the allowable range is from -2147483648 to 2147483647. If unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 digits. TINYINT - A very small integer that can be signed or unsigned. If signed, the allowable range is from -128 to 127. If unsigned, the allowable range is from 0 to 255. You can specify a width of up to 4 digits. SMALLINT - A small integer that can be signed or unsigned. If signed, the allowable range is from -32768 to 32767. If unsigned, the allowable range is from 0 to 65535. You can specify a width of up to 5 digits. MEDIUMINT - A medium-sized integer that can be signed or unsigned. If signed, the allowable range is from - 8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215. You can specify a width of up to 9 digits. BIGINT - A large integer that can be signed or unsigned. If signed, the allowable range is from - 9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to 18446744073709551615. You can specify a width of up to 20 digits. FLOAT(M,D) - A floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 10,2, where 2 is the number of decimals and 10 is the total number of digits (including decimals). Decimal precision can go to 24 places for a FLOAT. DOUBLE(M,D) - A double precision floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 16,4, where 4 is the number of decimals. Decimal precision can go to 53 places for a DOUBLE. REAL is a synonym for DOUBLE. DECIMAL(M,D) - An unpacked floating-point number that cannot be unsigned. In unpacked decimals, each decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required. NUMERIC is a synonym for DECIMAL.
  • 19. String Data Type • Although numeric and date types are fun, most data you'll store will be in string format. This list describes the common string datatypes in MySQL. • CHAR(M) - A fixed-length string between 1 and 255 characters in length (for example CHAR(5)), right- padded with spaces to the specified length when stored. Defining a length is not required, but the default is 1. • VARCHAR(M) - A variable-length string between 1 and 255 characters in length; for example VARCHAR(25). You must define a length when creating a VARCHAR field. • BLOB or TEXT - A field with a maximum length of 65535 characters. BLOBs are "Binary Large Objects" and are used to store large amounts of binary data, such as images or other types of files. Fields defined as TEXT also hold large amounts of data; the difference between the two is that sorts and comparisons on stored data are case sensitive on BLOBs and are not case sensitive in TEXT fields. You do not specify a length with BLOB or TEXT. • TINYBLOB or TINYTEXT - A BLOB or TEXT column with a maximum length of 255 characters. You do not specify a length with TINYBLOB or TINYTEXT. • MEDIUMBLOB or MEDIUMTEXT - A BLOB or TEXT column with a maximum length of 16777215 characters. You do not specify a length with MEDIUMBLOB or MEDIUMTEXT. • LONGBLOB or LONGTEXT - A BLOB or TEXT column with a maximum length of 4294967295 characters. You do not specify a length with LONGBLOB or LONGTEXT. • ENUM - An enumeration, which is a fancy term for list. When defining an ENUM, you are creating a list of items from which the value must be selected (or it can be NULL). For example, if you wanted your field to contain "A" or "B" or "C", you would define your ENUM as ENUM ('A', 'B', 'C') and only those values (or NULL) could ever populate that field.
  • 20. Built-in Data Types in SQL • date: Dates, containing a (4 digit) year, month and date – Example: date ‘2005-7-27’ • time: Time of day, in hours, minutes and seconds. – Example: time ‘09:00:30’ time ‘09:00:30.75’ • timestamp: date plus time of day – Example: timestamp ‘2005-7-27 09:00:30.75’ • interval: period of time – Example: interval ‘1’ day – Subtracting a date/time/timestamp value from another gives an interval value – Interval values can be added to date/time/timestamp values
  • 21. Build-in Data Types in SQL (Cont.) • Can extract values of individual fields from date/time/timestamp – Example: extract (year from r.starttime) • Can cast string types to date/time/timestamp – Example: cast <string-valued-expression> as date – Example: cast <string-valued-expression> as time
  • 22. User-Defined Types • create type construct in SQL creates user-defined type create type Dollars as numeric (12,2) final • create domain construct in SQL-92 creates user- defined domain types create domain person_name char(20) not null • Types and domains are similar. Domains can have constraints, such as not null, specified on them.
  • 23. Large-Object Types • Large objects (photos, videos, CAD files, etc.) are stored as a large object: – blob: binary large object -- object is a large collection of uninterpreted binary data (whose interpretation is left to an application outside of the database system) – clob: character large object -- object is a large collection of character data – When a query returns a large object, a pointer is returned rather than the large object itself.
  • 24. Creating a Table • To create a table, use the CREATE TABLE command: mysql> CREATE TABLE pet ( -> name VARCHAR(20), -> owner VARCHAR(20), -> species VARCHAR(20), -> sex CHAR(1), -> birth DATE, death DATE); Query OK, 0 rows affected (0.04 sec)
  • 25. Keys • One or more attributes that determine other attributes – Key attribute – Composite key • Full functional dependence • Entity integrity – Uniqueness – No ‘null’ value in key
  • 28. Keys (con’t.) • Primary key – Candidate key to uniquely identify all other attributes in a given row • Foreign key – Values must match primary key in another table
  • 29. Integrity Rules • Entity integrity – Ensures all entities are unique – Each entity has unique key • Referential integrity – Foreign key must have null value or match primary key values – Makes it impossible to delete row whose primary key has mandatory matching foreign key values in another table
  • 30. Integrity Constraints • Integrity constraints guard against accidental damage to the database, by ensuring that authorized changes to the database do not result in a loss of data consistency. – A checking account must have a balance greater than $10,000.00 – A salary of a bank employee must be at least $4.00 an hour – A customer must have a (non-null) phone number
  • 31. Referential Integrity • Ensures that a value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation. – Example: If “Perryridge” is a branch name appearing in one of the tuples in the account relation, then there exists a tuple in the branch relation for branch “Perryridge”. • Primary and candidate keys and foreign keys can be specified as part of the SQL create table statement: – The primary key clause lists attributes that comprise the primary key. – The unique key clause lists attributes that comprise a candidate key. – The foreign key clause lists the attributes that comprise the foreign key and the name of the relation referenced by the foreign key. By default, a foreign key references the primary key attributes of the referenced table.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Install BIOSQL locally • Get latest version of mysql (MAMP, mariaDB) • Download biosqldb-mysql.sql • Remove type=innodb • Launch database server • Connect using toad (port 8889) • Create database biosql; • Set as active database • Use worksheet to execute biosqldb- mysql.sql
  • 44. How ODBC Works? • ODBC inserts a middle layer called a Client Driver • Purpose of the Client Driver is to translate the applications queries into commands that the DBMS understands
  • 45. Other Parts of the Architecture • Application – calls functions defined in the ODBC API to access a data source • Driver Manager – implements the ODBC API and provides information to the application • Database – contains all the data
  • 46. Setting Up a Data Source in Windows • A data source is just a database that ODBC connects to • This allows the person to change database types without any changes to the program • Step 1. Get a database. – Using access for this example because it’s on this computer
  • 47. Conclusion The four parts that make up ODBC:
  • 48. Conclusion • Advantages: – Allows access to different types of databases – Uniform way of retrieving information – Highly efficient – Low memory requirements • Disadvantages – Complex and steep learning curve – All data in database must look like a relational database
  • 49. Conclusion • ODBC changed the way people code their programs that have to interact with databases. • The efficiency of programmers in the business world has increased due to ODBC because they no longer are wasting time to create multiple copies of a program. • ODBC has vastly improved the way programmers deal with databases.
  • 50.
  • 51.
  • 52.
  • 53.