SlideShare ist ein Scribd-Unternehmen logo
1 von 68
FBW
26-02-2019
Biological Databases
Wim Van Criekinge
Familienaam Voornaam E-mail
Anhel Valdes Ana-MariyaAnaMariya.AnhelValdes@UGent.be
De Waele Gaetan Gaetan.DeWaele@UGent.be
De Nolf Melanie Melanie.DeNolf@UGent.be
de Fooz Nicolas Nicolas.deFooz@UGent.be
Tavernier Simon Simon.Tavernier@UGent.be
Deschildre Joke Joke.Deschildre@UGent.be
Duarri Redondo Sara Sara.DuarriRedondo@UGent.be
Opdebeeck Helder Helder.Opdebeeck@UGent.be
Voorthuijzen Floris Floris.Voorthuijzen@UGent.be
Van Hoyweghen Lennert Lennert.VanHoyweghen@UGent.be
Ozcan Umut Onur UmutOnur.Ozcan@UGent.be
Gao Duan Duan.Gao@UGent.be
Dierickx Sam Sam.Dierickx@UGent.be
Philips Gino Gino.Philips@UGent.be
Juan Cabot Aina Aina.JuanCabot@UGent.be
De Saedeleer Bianca Bianca.DeSaedeleer@UGent.be
Pollaris Lotte Lotte.Pollaris@UGent.be
Li Qianqian Qianqian.Li@UGent.be
Officiële code Familienaam Voornaam E-mail Opleidingsprogramma
101803794 Anhel Valdes Ana-Mariya AnaMariya.AnhelValdes@UGent.be IXGAEX
201814118 Bergman Anna Anna.Bergman@UGent.be IXGAEX
301506429 de Fooz Nicolas Nicolas.deFooz@UGent.be IMCELB
401509165 De Nolf Melanie Melanie.DeNolf@UGent.be CMBIOISB
501409888 De Saedeleer Bianca Bianca.DeSaedeleer@UGent.be CMBIOIBE
601503275 Deschildre Joke Joke.Deschildre@UGent.be CMBIOIBE
701503542 De Waele Gaetan Gaetan.DeWaele@UGent.be CMBIOIBE
801804175 Dierickx Sam Sam.Dierickx@UGent.be CMBIOIBE
901802644 Duarri Redondo Sara Sara.DuarriRedondo@UGent.be CXGAEX
1001716008 Gao Duan Duan.Gao@UGent.be CMBIOISB
1101811008 Juan Cabot Aina Aina.JuanCabot@UGent.be CMBIOISB
1201400344 Langhendries Milan Milan.Langhendries@UGent.be CMBIOISB
1301804233 Li Qianqian Qianqian.Li@UGent.be CMBIOISB
14 20044839Opdebeeck Helder Helder.Opdebeeck@UGent.be CMBIOISB
1501801850 Ozcan Umut Onur UmutOnur.Ozcan@UGent.be CMBIOISB
1601206178 Philips Gino Gino.Philips@UGent.be CMBIOISB
1701509837 Pollaris Lotte Lotte.Pollaris@UGent.be CMBIOIBE
1801403113 Tavernier Simon Simon.Tavernier@UGent.be CMBIOISB
1901500186 Van Hoyweghen Lennert Lennert.VanHoyweghen@UGent.be CMBIOIBE
2001503491 Voorthuijzen Floris Floris.Voorthuijzen@UGent.be CMBIOIBE
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.
Relationships within Relational Database
• Relationship classifications
– 1:1
– 1:M
– M:N
• E-R Model
– ERD Maps E-R model
– Entities - of tabellen. Ze worden weergegeven door
rechthoeken met daarin de naam van het
entiteitstype en soms een opsomming van de
attributen
– Relationships - dit zijn verbanden tussen de
entiteittypen. We worden weergegeven door lijnen
tussen de verbonden eniteitstypen
ERD Symbols
• Rectangles represent entities
• Diamonds represent the relationship(s) between
the entities
• “1” side of relationship
– Number 1 in Chen Model
– Bar crossing line in Crow’s Feet Model
• “Many” relationships
– Letter “M” and “N” in Chen Model
– Three pronged “Crow’s foot” in Crow’s Feet Model
Example 1:M Relationship
Example 1:M Relationship
Example M:N Relationship
Example M:N Relationship
Converting M:N Relationship to Two 1:M Relationships
Converting M:N Relationship to Two 1:M Relationships (con’t.)
Converting M:N Relationship to Two 1:M Relationships (con’t.)
Converting M:N Relationship to Two 1:M Relationships (con’t.)
Indexes
• Points to location
• Makes retrieval of data faster
Applications of B+-Trees
(1) Search key of B+-Tree is primary key for data file, index
is dense (data file may or may not be sorted by pk):
– There is one key-pointer pair in a leaf for every
record of the data file
(2) Data file is sorted by its primary key:
– B+-Tree is a sparse index with one key-pointer
pair at a leaf for each block of the file
(3) Data file is sorted by an attribute that is not a key
(search key for B+-Tree):
– For each value K that appears in the data file,
there is one key-pointer pair at the leaf.
Pointer goes to the first of the records that
have K as their sort-key value
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
Toad Edge for MySQL
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
Project

Weitere ähnliche Inhalte

Was ist angesagt?

An introduction to spss
An introduction to spssAn introduction to spss
An introduction to spsszeeshanwrch
 
Spss data capturing training
Spss data capturing trainingSpss data capturing training
Spss data capturing trainingMarotaAphane
 
SPSS introduction Presentation
SPSS introduction Presentation SPSS introduction Presentation
SPSS introduction Presentation befikra
 
Introduction to spss: define variables
Introduction to spss: define variablesIntroduction to spss: define variables
Introduction to spss: define variablesAzmi Mohd Tamil
 
Introduction to spss 1
Introduction to spss 1Introduction to spss 1
Introduction to spss 1Michael Taiwo
 
introduction to spss
introduction to spssintroduction to spss
introduction to spssOmid Minooee
 
Introduction to spss 18
Introduction to spss 18Introduction to spss 18
Introduction to spss 18mbrez
 
Creating a database
Creating a databaseCreating a database
Creating a databaseRahul Gupta
 
Introduction to spss 2
Introduction to spss 2Introduction to spss 2
Introduction to spss 2Michael Taiwo
 
Defining Data in IBM SPSS Statistics
Defining Data in IBM SPSS StatisticsDefining Data in IBM SPSS Statistics
Defining Data in IBM SPSS StatisticsThiyagu K
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Jennifer Berk
 

Was ist angesagt? (19)

An introduction to spss
An introduction to spssAn introduction to spss
An introduction to spss
 
Database
DatabaseDatabase
Database
 
Epidata lecture note
Epidata lecture note Epidata lecture note
Epidata lecture note
 
Spss data capturing training
Spss data capturing trainingSpss data capturing training
Spss data capturing training
 
SPSS introduction Presentation
SPSS introduction Presentation SPSS introduction Presentation
SPSS introduction Presentation
 
Introduction to spss: define variables
Introduction to spss: define variablesIntroduction to spss: define variables
Introduction to spss: define variables
 
Spss training notes
Spss training notesSpss training notes
Spss training notes
 
Project data tabs
Project  data tabsProject  data tabs
Project data tabs
 
Introduction to spss 1
Introduction to spss 1Introduction to spss 1
Introduction to spss 1
 
Excel 2010 data tab
Excel 2010 data tabExcel 2010 data tab
Excel 2010 data tab
 
introduction to spss
introduction to spssintroduction to spss
introduction to spss
 
Introduction to spss 18
Introduction to spss 18Introduction to spss 18
Introduction to spss 18
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
Introduction to spss
Introduction to spssIntroduction to spss
Introduction to spss
 
DATA HANDLING FOR SPSS
DATA HANDLING FOR SPSSDATA HANDLING FOR SPSS
DATA HANDLING FOR SPSS
 
Introduction to spss 2
Introduction to spss 2Introduction to spss 2
Introduction to spss 2
 
Defining Data in IBM SPSS Statistics
Defining Data in IBM SPSS StatisticsDefining Data in IBM SPSS Statistics
Defining Data in IBM SPSS Statistics
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)
 

Ähnlich wie 2019 02 21_biological_databases_part2_v_upload

Ähnlich wie 2019 02 21_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
 
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfSimple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
 
Mysql datatypes
Mysql datatypesMysql datatypes
Mysql datatypes
 
MySql
MySqlMySql
MySql
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data types
 
SQL cheat sheet.pdf
SQL cheat sheet.pdfSQL cheat sheet.pdf
SQL cheat sheet.pdf
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptx
 
2.0 sql data types for my sql, sql server
2.0 sql data types for my sql, sql server2.0 sql data types for my sql, sql server
2.0 sql data types for my sql, sql server
 
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
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
 
DBMS
DBMSDBMS
DBMS
 
Lession 5 the columns of a table
Lession 5 the columns of a tableLession 5 the columns of a table
Lession 5 the columns of a table
 
Mangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.pptMangala Deshpande MySQL0710.ppt
Mangala Deshpande MySQL0710.ppt
 
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
 
Sql
SqlSql
Sql
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
 

Mehr von 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_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 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_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_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 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_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
 

Kürzlich hochgeladen

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Kürzlich hochgeladen (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

2019 02 21_biological_databases_part2_v_upload

  • 1.
  • 3.
  • 4. Familienaam Voornaam E-mail Anhel Valdes Ana-MariyaAnaMariya.AnhelValdes@UGent.be De Waele Gaetan Gaetan.DeWaele@UGent.be De Nolf Melanie Melanie.DeNolf@UGent.be de Fooz Nicolas Nicolas.deFooz@UGent.be Tavernier Simon Simon.Tavernier@UGent.be Deschildre Joke Joke.Deschildre@UGent.be Duarri Redondo Sara Sara.DuarriRedondo@UGent.be Opdebeeck Helder Helder.Opdebeeck@UGent.be Voorthuijzen Floris Floris.Voorthuijzen@UGent.be Van Hoyweghen Lennert Lennert.VanHoyweghen@UGent.be Ozcan Umut Onur UmutOnur.Ozcan@UGent.be Gao Duan Duan.Gao@UGent.be Dierickx Sam Sam.Dierickx@UGent.be Philips Gino Gino.Philips@UGent.be Juan Cabot Aina Aina.JuanCabot@UGent.be De Saedeleer Bianca Bianca.DeSaedeleer@UGent.be Pollaris Lotte Lotte.Pollaris@UGent.be Li Qianqian Qianqian.Li@UGent.be
  • 5. Officiële code Familienaam Voornaam E-mail Opleidingsprogramma 101803794 Anhel Valdes Ana-Mariya AnaMariya.AnhelValdes@UGent.be IXGAEX 201814118 Bergman Anna Anna.Bergman@UGent.be IXGAEX 301506429 de Fooz Nicolas Nicolas.deFooz@UGent.be IMCELB 401509165 De Nolf Melanie Melanie.DeNolf@UGent.be CMBIOISB 501409888 De Saedeleer Bianca Bianca.DeSaedeleer@UGent.be CMBIOIBE 601503275 Deschildre Joke Joke.Deschildre@UGent.be CMBIOIBE 701503542 De Waele Gaetan Gaetan.DeWaele@UGent.be CMBIOIBE 801804175 Dierickx Sam Sam.Dierickx@UGent.be CMBIOIBE 901802644 Duarri Redondo Sara Sara.DuarriRedondo@UGent.be CXGAEX 1001716008 Gao Duan Duan.Gao@UGent.be CMBIOISB 1101811008 Juan Cabot Aina Aina.JuanCabot@UGent.be CMBIOISB 1201400344 Langhendries Milan Milan.Langhendries@UGent.be CMBIOISB 1301804233 Li Qianqian Qianqian.Li@UGent.be CMBIOISB 14 20044839Opdebeeck Helder Helder.Opdebeeck@UGent.be CMBIOISB 1501801850 Ozcan Umut Onur UmutOnur.Ozcan@UGent.be CMBIOISB 1601206178 Philips Gino Gino.Philips@UGent.be CMBIOISB 1701509837 Pollaris Lotte Lotte.Pollaris@UGent.be CMBIOIBE 1801403113 Tavernier Simon Simon.Tavernier@UGent.be CMBIOISB 1901500186 Van Hoyweghen Lennert Lennert.VanHoyweghen@UGent.be CMBIOIBE 2001503491 Voorthuijzen Floris Floris.Voorthuijzen@UGent.be CMBIOIBE
  • 6.
  • 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. Relationships within Relational Database • Relationship classifications – 1:1 – 1:M – M:N • E-R Model – ERD Maps E-R model – Entities - of tabellen. Ze worden weergegeven door rechthoeken met daarin de naam van het entiteitstype en soms een opsomming van de attributen – Relationships - dit zijn verbanden tussen de entiteittypen. We worden weergegeven door lijnen tussen de verbonden eniteitstypen
  • 33. ERD Symbols • Rectangles represent entities • Diamonds represent the relationship(s) between the entities • “1” side of relationship – Number 1 in Chen Model – Bar crossing line in Crow’s Feet Model • “Many” relationships – Letter “M” and “N” in Chen Model – Three pronged “Crow’s foot” in Crow’s Feet Model
  • 38. Converting M:N Relationship to Two 1:M Relationships
  • 39. Converting M:N Relationship to Two 1:M Relationships (con’t.)
  • 40. Converting M:N Relationship to Two 1:M Relationships (con’t.)
  • 41. Converting M:N Relationship to Two 1:M Relationships (con’t.)
  • 42. Indexes • Points to location • Makes retrieval of data faster
  • 43. Applications of B+-Trees (1) Search key of B+-Tree is primary key for data file, index is dense (data file may or may not be sorted by pk): – There is one key-pointer pair in a leaf for every record of the data file (2) Data file is sorted by its primary key: – B+-Tree is a sparse index with one key-pointer pair at a leaf for each block of the file (3) Data file is sorted by an attribute that is not a key (search key for B+-Tree): – For each value K that appears in the data file, there is one key-pointer pair at the leaf. Pointer goes to the first of the records that have K as their sort-key value
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 55. 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
  • 56. 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
  • 57. 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
  • 58. Conclusion The four parts that make up ODBC:
  • 59. 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
  • 60. 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.
  • 61.
  • 62.
  • 63.
  • 64.
  • 66. Toad Edge for MySQL
  • 67. 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