Two Types of Databases

Relational Databases

  • Organize data to into one or more tables
    • Each table has columns and rows
    • A unique key identifies each row

Non-Relational Databases

  • Organized data is anything but a traditional table

    • Key-value stores
    • Documents(JSON,XML)
    • Graphs
    • Flexible Tables

      Relational Databases(SQL)

  • Relational Database Management Systems(RDMS)

    • Help users create and maintain a relational database
      • mySQL, Oracle, postgreSQL, mariaDB, etc.
  • Structured Query Language (SQL)

    • Standardized language for interacting with RDBMS
    • Used to to perform CRUD operations,as well as other administrative tasks(user management, security,backup,etc)
    • Used to define tables and structures
    • SQL code used on one RDBMS is not always portable to another without modification.

      Non-Relational Databases(noSQL)

  • Non-Relational Database Management Systems(NRDMS)

    • Help users create and maintain a non-relational database
      • MongoDB, dynamoDB, apche cassandra, firebase, etc
  • Implementation Specific

    • Any non-relational database falls under this category, so there’s no set language standard.
    • Most NRDBMS will implement their own language for performing CRUD and administrative operations on the database.

      Structured Query Language(SQL)

  • SQL is actually a hybrid language, it’s basically 4 types of languages in one:

    • Data Query Language(DQL)
      • Used to query the database for information
      • Get information that is already stored there
    • Data Definition Language(DDL)
      • Used for definining database schemas
    • Data Control Language (DCL)
      • Used for controlling access to the data in the database.
      • User & permissions management
    • Data Manipulation Language(DML)
      • Used for inserting ,updating and deleting data from the database.

        Basic Data Types

  • INT 数值

  • DECIMAL(M,N) 十进制数据
  • VARCHAR(N) 长度为N的字符串
  • BLOB 二进制大数据对象
  • DATE 日期
  • TIMESTAMP 时间戳