SlideShare a Scribd company logo
DATABASE DESIGN




BY-    Mayank Garg
WHAT IS A “DATABASE”


                     A Database is a collection of related data.
                 Facts that can be recorded and have specific meaning.
                        Represents some aspect of the real world.
A database is a logically coherent collection of data. Random assortment of data cannot be
                                  construed as a database.
           A database is designed, built, and populated for a specific purpose.
WHAT IS A DATABASE MANAGEMENT
                         SYSTEM (DBMS OR DMS)


   A general purpose software system that facilitates the definition, storing,
manipulating, security, organization, retrieval, and sharing of data in a database.
      The descriptive information about a database is called meta-data.
            To interact with a DBMS you must issue transactions.
TYPES OF DATABASE
        MANAGEMENT SYSTEMS


               Hierarchical
                 Network
                Relational
              Object Oriented
                  XML
Experimental models such as Spatial-Temporal


   Note: We will concentrate on Relational
RELATIONAL DATABASE



Characterized by data being arranged to appear as a table of data
                    with rows and columns.
  Each column has a unique meaning, name, and data type.
         Each Row must have one or more columns.
      A Database must have one or more related tables.
  There may be several database instances on one machine.
How the data is physically organized and stored on the machine is
            hidden from the programmer and user.
DEFINITIONS



Attribute: A single data item related to a database. AKA
                     Field, column
Candidate Key: A field or group of fields that a could be
                     a primary key.
 Cursor: The specific record or tuple in a table or view
       that the database is currently pointing to.
Data Mining: Automated data analysis techniques used
   to uncover previously undetected relationships or
                      information.
OTHER DEFINITIONS



 Domain: The set of allowed values for an attribute.
Entity: A single object about which data can be stored in
  a database table. Examples: Person, specimen, or
                         location.
 ER Diagram: A graph that shows the tables and the
            relationships between each one.
Foreign Key: An attribute(s) in a table that is a primary
                   key in another table.
OTHER DEFINITIONS



 Functional Dependency: When one attribute is related
   to another. Usually uni-directional. Examples: Social
               Security Number -> Name.
Join: The operation of putting the information in multiple
                 tables together in one.
Normalization: The operation if reducing the amount of
          redundant information in a database.
    SQL: The Structured Query Language standard.
OTHER DEFINITIONS


                             Tuple: A row or record.
  View: A view is a “virtual table” that is generated on the fly when the view is
accessed. The view is generally created using a pre-defined transaction. Example:
 You may want to generate a table of personnel without privacy information and
    with information from other tables includes such as zip code, city, state.
RELATIONSHIPS
DATABASE DESIGN


                   Define the purpose of the Database
                            Gather requirements
 Gather data items based upon requirements (In other words, what data
 will be needed to satisfy the requirements for data storage, retrieval and
                                 reporting).
Name each attribute using standard naming conventions. See if there exist standards
 for the particular area. Example: Darwin Core Standard for biological information
                                     systems.
                      Define the attribute of each data item.
                           Define range of data values.
                     Define compatibility checks on the data.
DATABASE DESIGN (CONT)


     Group related data items into an entity or an object.
          (examples: person, class, organization)
       Take an entity and define the physical tables.
                    Normalize Tables:
1st Normal Form: Each attribute must be autonomous and there must not
                       be any repeating groups.
2nd Normal Form: Is in 1NF and Only attributes allowed that are directly
                      related to the Primary Key.
    3rd Normal Form: 2NF and there are no transitive dependencies.
            Note: Most databases seldom go beyond 3NF.
DATABASE DESIGN (CONT)

   Create any additional tables needed to support the
                     requirements.
     Attribute look up ( Examples: specimen sex, form etc.
       Cross reference tables needed for normalization.
                      Create Views.
                      Create indexes.
Decide on visibility of tables and data along with security
                         features.
         Create backup and logging strategy.
ENTITY RELATIONSHIP
     DIAGRAMS
E-R DIAGRAMS




Taken from www.smartdraw.com/tutorials/software/erd
E-R DIAGRAMS




Taken from www.smartdraw.com/tutorials/software/erd
E-R DIAGRAMS




Taken from www.smartdraw.com/tutorials/software/erd
EXAMPLE


              # Database: morphbank
#-----------------------------------------------------------
    # server version 4.1.1a-alpha-max-degug
                              
               DROP TABLE species;
           DROP TABLE classification;
             DROP TABLE specimen;
               DROP TABLE image;
             DROP TABLE viewtable;
         DROP TABLE imageannotation;
      DROP TABLE phylogeneticcharacter;
    DROP TABLE phylogeneticcharacterset;
DROP TABLE phylogeneticcharacterstatetable;
         DROP TABLE publicationtable;
             DROP TABLE usertable;
            DROP TABLE grouptable;
                              
EXAMPLE



                       #
     # Table structure for table 'species'
                       #
         CREATE TABLE species(
SpeciesID int(8) NOT NULL auto_increment,
        GenusID int(32) NOT NULL,
   FamilyName varchar(128) NOT NULL,
   GenusName varchar(128) NOT NULL,
             Variety varchar(128),
         SpeciesEpithet varchar(128),
     SpeciesNameAuthors varchar (128),
        SpeciesDescribedYear char(4),
DateIdentified date DEFAULT '0000-00-00',
   IdentifiedBy varchar(128) NOT NULL,
        PRIMARY KEY (SpeciesID));
EXAMPLE


   # Table Structure for table 'classification'
                         
       CREATE TABLE classification(
GenusID    int(32) NOT NULL auto_increment,
   GenusName varchar(128) NOT NULL,
   FamilyName varchar(128) NOT NULL,
   OrderName varchar(128) NOT NULL,
           ClassName varchar(128),
   PhylumName varchar(128) NOT NULL,
  KingdomName varchar(128) NOT NULL,
          PRIMARY KEY (GenusID));
EXAMPLE


                            #
          # Table structure for table 'specimen'
                            #
             CREATE TABLE specimen(
       MorphBankSpecimenID int(32) NOT NULL,
             SpeciesID int(8) NOT NULL,
CatalogNumber int (32) NOT NULL AUTO_INCREMENT,
  DateLastModified date NOT NULL default '0000-00-00',
              InstitutionCode varchar(128),
              CollectionCode varchar(128),
              ScientificName varchar(128),
                 BasisOfRecord char(1),
                SubSpecies varchar (128),
                TypeStatus varchar (255),
                TypeName varchar (128),
            CollectionNumber varchar (128),
                             
EXAMPLE


              FieldNumber varchar (128),
             CollectorName varchar (128),
DateCollected date NOT NULL DEFAULT '0000-00-00',
                   TimeofDate time,
             ContinentOcean varchar(128),
                  Country varchar(56),
               StateProvince varchar(56),
                  County varchar(56),
                  Locality varchar(56),
                    Latitude double,
                   Longitude double,
               CoordinatePrecision int(8),
               MinimumElevation int(32),
EXAMPLE


    MaximumElevation int(32),
      MinimumDepth int(32),
      MaximumDepth int(32),
          Sex varchar(8),
   PreparationType varchar(255),
      IndividualCount int(32),
PreviousCatalogNumber varchar(128),
   RelationshipType varchar(128),
 RelatedCatalogItem varchar (128),
 DevelopmentalStage varchar (128),
        Notes varchar(255),
 PRIMARY KEY(CatalogNumber));
IN-CLASS EXERCISE


Work on the design of a University database system designed to track student,
                faculty, course, classes, degrees, and grades.

More Related Content

PPT
Database
PPTX
Data base.ppt
PDF
Stata tutorial university of princeton
PPT
Introduction to Stata
PPT
Creating a database
PPTX
Sql Basics And Advanced
PPTX
SQL for interview
PDF
Database concepts
Database
Data base.ppt
Stata tutorial university of princeton
Introduction to Stata
Creating a database
Sql Basics And Advanced
SQL for interview
Database concepts

What's hot (19)

PPTX
MS SQL Database basic
PDF
SImple SQL
PPT
Sql intro & ddl 1
PDF
Descriptive Statistics with R
PPTX
DDL(Data defination Language ) Using Oracle
PPTX
Avinash database
PPTX
Introduction to SQL
PPT
Secretsofthecatalogremix
PDF
Chapter 4 Structured Query Language
PPTX
Pig - Analyzing data sets
PPTX
MySQL Essential Training
PPTX
Marcs (bio)perl course
PDF
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
PPTX
Introduction to (sql)
PPTX
Sql commands
PDF
SQL Overview
PPTX
SQL Commands
DOCX
SQL Differences SQL Interview Questions
PPTX
2019 02 21_biological_databases_part2_v_upload
MS SQL Database basic
SImple SQL
Sql intro & ddl 1
Descriptive Statistics with R
DDL(Data defination Language ) Using Oracle
Avinash database
Introduction to SQL
Secretsofthecatalogremix
Chapter 4 Structured Query Language
Pig - Analyzing data sets
MySQL Essential Training
Marcs (bio)perl course
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
Introduction to (sql)
Sql commands
SQL Overview
SQL Commands
SQL Differences SQL Interview Questions
2019 02 21_biological_databases_part2_v_upload
Ad

Viewers also liked (20)

PDF
DATACTIF SoNetA. BIG DATA ANALYTIS
PPTX
Sociale woestijn
PDF
Siklu overbuild technical note 05
PPTX
StarForce Disc (Рус)
PPTX
Siklu新製品紹介 2016年4月時点 提供:Upside合同会社
PPTX
DICOMO2010 Flexible Routing Table(FRT) 2010/07/09
PPTX
スマホアプリBestieBoxにWebRTCを組みこんでみた
PPTX
Windows CE
PPTX
Михаил Лукьянов, Дмитрий Шайхатаров, Agile среди водопадов. Использование SCR...
PDF
Siklu overbuild technical note 05
PPTX
PDF
Planificacion basquetbol
PDF
PPTX
Siklu EH-600TX Brochure JP
PDF
Pull Request & TDD 入門
PDF
Resume summary(cloud project)
PDF
Business Model Generationの可能性
PDF
Jeff Dean at AI Frontiers: Trends and Developments in Deep Learning Research
PPTX
Total quality management (tqm)ادارة الجودة الشاملة
PPTX
EC Presentation 8-1
DATACTIF SoNetA. BIG DATA ANALYTIS
Sociale woestijn
Siklu overbuild technical note 05
StarForce Disc (Рус)
Siklu新製品紹介 2016年4月時点 提供:Upside合同会社
DICOMO2010 Flexible Routing Table(FRT) 2010/07/09
スマホアプリBestieBoxにWebRTCを組みこんでみた
Windows CE
Михаил Лукьянов, Дмитрий Шайхатаров, Agile среди водопадов. Использование SCR...
Siklu overbuild technical note 05
Planificacion basquetbol
Siklu EH-600TX Brochure JP
Pull Request & TDD 入門
Resume summary(cloud project)
Business Model Generationの可能性
Jeff Dean at AI Frontiers: Trends and Developments in Deep Learning Research
Total quality management (tqm)ادارة الجودة الشاملة
EC Presentation 8-1
Ad

Similar to Database (20)

PPT
Dbms relational model
PPTX
BASIC OF DATABASE PPT new.pptx
PPT
Dbms Lec Uog 02
PPTX
Data Handling in R language basic concepts.pptx
PPTX
Big Data Analytics Module-4 as per vtu .pptx
PPTX
Quick And Dirty Databases
PPT
Unit4_Lecture-sql.ppt and data science relate
PDF
PPTX
7. SQL.pptx
PDF
20130215 Reading data into R
PPTX
Quick Revision on DATA BASE MANAGEMENT SYSTEMS concepts.pptx
PPTX
T-SQL Overview
PPTX
Data Analytics with R and SQL Server
PPT
Physical elements of data
PPTX
NoSQL - A Closer Look to Couchbase
PPTX
Chapter 5: Database Systems, Data Centers, and Business Intelligence
PPTX
Unit 10 - Realtional Databases.pptxxxxxxxxx
PPTX
IP-Lesson_Planning(Unit4 - Database concepts and SQL).pptx
PPTX
Learning Cassandra NoSQL
Dbms relational model
BASIC OF DATABASE PPT new.pptx
Dbms Lec Uog 02
Data Handling in R language basic concepts.pptx
Big Data Analytics Module-4 as per vtu .pptx
Quick And Dirty Databases
Unit4_Lecture-sql.ppt and data science relate
7. SQL.pptx
20130215 Reading data into R
Quick Revision on DATA BASE MANAGEMENT SYSTEMS concepts.pptx
T-SQL Overview
Data Analytics with R and SQL Server
Physical elements of data
NoSQL - A Closer Look to Couchbase
Chapter 5: Database Systems, Data Centers, and Business Intelligence
Unit 10 - Realtional Databases.pptxxxxxxxxx
IP-Lesson_Planning(Unit4 - Database concepts and SQL).pptx
Learning Cassandra NoSQL

More from Mayank Garg (18)

PPTX
Real time system in Multicore/Multiprocessor system
PPT
Max flow min cut
PDF
3 g successor
PPTX
Habits for computer
PPTX
Wireless charging of mobilephones using microwaves
PPT
Presentation on green IT
PPTX
DTH System
PPTX
Image attendance system
PPTX
Electronic nose
PPTX
Cell phone operated land rover
PPTX
Oracle Database
PPTX
Broadband networking through human body
PPTX
Mems paper
PPT
Stegnography
PPTX
Addressing Modes
PPTX
8051 memory
PPT
Cybercrime
PPT
Brain gate
Real time system in Multicore/Multiprocessor system
Max flow min cut
3 g successor
Habits for computer
Wireless charging of mobilephones using microwaves
Presentation on green IT
DTH System
Image attendance system
Electronic nose
Cell phone operated land rover
Oracle Database
Broadband networking through human body
Mems paper
Stegnography
Addressing Modes
8051 memory
Cybercrime
Brain gate

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Hazard Identification & Risk Assessment .pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
advance database management system book.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Cell Types and Its function , kingdom of life
Weekly quiz Compilation Jan -July 25.pdf
History, Philosophy and sociology of education (1).pptx
Supply Chain Operations Speaking Notes -ICLT Program
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Classroom Observation Tools for Teachers
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
A systematic review of self-coping strategies used by university students to ...
Hazard Identification & Risk Assessment .pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Digestion and Absorption of Carbohydrates, Proteina and Fats
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
advance database management system book.pdf
Computing-Curriculum for Schools in Ghana
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE

Database

  • 1. DATABASE DESIGN BY- Mayank Garg
  • 2. WHAT IS A “DATABASE” A Database is a collection of related data. Facts that can be recorded and have specific meaning. Represents some aspect of the real world. A database is a logically coherent collection of data. Random assortment of data cannot be construed as a database. A database is designed, built, and populated for a specific purpose.
  • 3. WHAT IS A DATABASE MANAGEMENT SYSTEM (DBMS OR DMS) A general purpose software system that facilitates the definition, storing, manipulating, security, organization, retrieval, and sharing of data in a database. The descriptive information about a database is called meta-data. To interact with a DBMS you must issue transactions.
  • 4. TYPES OF DATABASE MANAGEMENT SYSTEMS Hierarchical Network Relational Object Oriented XML Experimental models such as Spatial-Temporal Note: We will concentrate on Relational
  • 5. RELATIONAL DATABASE Characterized by data being arranged to appear as a table of data with rows and columns. Each column has a unique meaning, name, and data type. Each Row must have one or more columns. A Database must have one or more related tables. There may be several database instances on one machine. How the data is physically organized and stored on the machine is hidden from the programmer and user.
  • 6. DEFINITIONS Attribute: A single data item related to a database. AKA Field, column Candidate Key: A field or group of fields that a could be a primary key. Cursor: The specific record or tuple in a table or view that the database is currently pointing to. Data Mining: Automated data analysis techniques used to uncover previously undetected relationships or information.
  • 7. OTHER DEFINITIONS Domain: The set of allowed values for an attribute. Entity: A single object about which data can be stored in a database table. Examples: Person, specimen, or location. ER Diagram: A graph that shows the tables and the relationships between each one. Foreign Key: An attribute(s) in a table that is a primary key in another table.
  • 8. OTHER DEFINITIONS Functional Dependency: When one attribute is related to another. Usually uni-directional. Examples: Social Security Number -> Name. Join: The operation of putting the information in multiple tables together in one. Normalization: The operation if reducing the amount of redundant information in a database. SQL: The Structured Query Language standard.
  • 9. OTHER DEFINITIONS Tuple: A row or record. View: A view is a “virtual table” that is generated on the fly when the view is accessed. The view is generally created using a pre-defined transaction. Example: You may want to generate a table of personnel without privacy information and with information from other tables includes such as zip code, city, state.
  • 11. DATABASE DESIGN Define the purpose of the Database Gather requirements Gather data items based upon requirements (In other words, what data will be needed to satisfy the requirements for data storage, retrieval and reporting). Name each attribute using standard naming conventions. See if there exist standards for the particular area. Example: Darwin Core Standard for biological information systems. Define the attribute of each data item. Define range of data values. Define compatibility checks on the data.
  • 12. DATABASE DESIGN (CONT) Group related data items into an entity or an object. (examples: person, class, organization) Take an entity and define the physical tables. Normalize Tables: 1st Normal Form: Each attribute must be autonomous and there must not be any repeating groups. 2nd Normal Form: Is in 1NF and Only attributes allowed that are directly related to the Primary Key. 3rd Normal Form: 2NF and there are no transitive dependencies. Note: Most databases seldom go beyond 3NF.
  • 13. DATABASE DESIGN (CONT) Create any additional tables needed to support the requirements. Attribute look up ( Examples: specimen sex, form etc. Cross reference tables needed for normalization. Create Views. Create indexes. Decide on visibility of tables and data along with security features. Create backup and logging strategy.
  • 15. E-R DIAGRAMS Taken from www.smartdraw.com/tutorials/software/erd
  • 16. E-R DIAGRAMS Taken from www.smartdraw.com/tutorials/software/erd
  • 17. E-R DIAGRAMS Taken from www.smartdraw.com/tutorials/software/erd
  • 18. EXAMPLE # Database: morphbank #----------------------------------------------------------- # server version 4.1.1a-alpha-max-degug   DROP TABLE species; DROP TABLE classification; DROP TABLE specimen; DROP TABLE image; DROP TABLE viewtable; DROP TABLE imageannotation; DROP TABLE phylogeneticcharacter; DROP TABLE phylogeneticcharacterset; DROP TABLE phylogeneticcharacterstatetable; DROP TABLE publicationtable; DROP TABLE usertable; DROP TABLE grouptable;  
  • 19. EXAMPLE # # Table structure for table 'species' # CREATE TABLE species( SpeciesID int(8) NOT NULL auto_increment, GenusID int(32) NOT NULL, FamilyName varchar(128) NOT NULL, GenusName varchar(128) NOT NULL, Variety varchar(128), SpeciesEpithet varchar(128), SpeciesNameAuthors varchar (128), SpeciesDescribedYear char(4), DateIdentified date DEFAULT '0000-00-00', IdentifiedBy varchar(128) NOT NULL, PRIMARY KEY (SpeciesID));
  • 20. EXAMPLE # Table Structure for table 'classification'   CREATE TABLE classification( GenusID int(32) NOT NULL auto_increment, GenusName varchar(128) NOT NULL, FamilyName varchar(128) NOT NULL, OrderName varchar(128) NOT NULL, ClassName varchar(128), PhylumName varchar(128) NOT NULL, KingdomName varchar(128) NOT NULL, PRIMARY KEY (GenusID));
  • 21. EXAMPLE # # Table structure for table 'specimen' # CREATE TABLE specimen( MorphBankSpecimenID int(32) NOT NULL, SpeciesID int(8) NOT NULL, CatalogNumber int (32) NOT NULL AUTO_INCREMENT, DateLastModified date NOT NULL default '0000-00-00', InstitutionCode varchar(128), CollectionCode varchar(128), ScientificName varchar(128), BasisOfRecord char(1), SubSpecies varchar (128), TypeStatus varchar (255), TypeName varchar (128), CollectionNumber varchar (128),  
  • 22. EXAMPLE FieldNumber varchar (128), CollectorName varchar (128), DateCollected date NOT NULL DEFAULT '0000-00-00', TimeofDate time, ContinentOcean varchar(128), Country varchar(56), StateProvince varchar(56), County varchar(56), Locality varchar(56), Latitude double, Longitude double, CoordinatePrecision int(8), MinimumElevation int(32),
  • 23. EXAMPLE MaximumElevation int(32), MinimumDepth int(32), MaximumDepth int(32), Sex varchar(8), PreparationType varchar(255), IndividualCount int(32), PreviousCatalogNumber varchar(128), RelationshipType varchar(128), RelatedCatalogItem varchar (128), DevelopmentalStage varchar (128), Notes varchar(255), PRIMARY KEY(CatalogNumber));
  • 24. IN-CLASS EXERCISE Work on the design of a University database system designed to track student, faculty, course, classes, degrees, and grades.