Introduction to Databases

****************Database learning************************
First, the development of the database
  Development history of data preservation:
    It was first managed manually, and later developed into file management
  Disadvantages of file management:
    1: When storing data, there is no data structure.
    2: Inconvenient to modify
    3: There are more and more data, and files are easy to lose.
  Later developed into the use of databases for data storage and management.
 Second, the installation of Oracle database
    1.TCP protocol port number: 1521.
    2. The port number of the HTTP protocol: 8080.
    3. SID is the unique identifier of the database:
    4.10gxe version defaults to xe
    5.11g version defaults to orcl
    6. Two super administrators: system and sys, both passwords are 1234
    7. When storing data, other users will be created .
      The scott user is the first user of oracle. The password defaults to tiger
Problem: Can't connect to the database?
    1: First check whether the service item is enabled.
      Two service items:
        OracleServier[SID]
        Oralce…………Listener
    2: Checking whether the firewall is closed.

Third, the method of connecting to the database remotely:
  1: You can use the sqlplus terminal
    oracle database embedded sqlplus function
   This interface:
      sql> conn username/password
     This interface:
      administrator>sqlplus username/password
  2: Use a third-party client to connect to
    oracle's own client sqldeveloper.
    Connection name: is the nickname, custom.
    Username: Select a user on the oracle server scott
    Password: User's password 1234
    Hostname: IP
    port number of the oracle server: TCP port number 1521
    SID: Unique identifier xe /orcl
Four, DB and DBMS
    1.DB:database A database
      is a warehouse that stores data according to a specific data structure.
    2.DBMS: database management system, that is, a database management system
        is a software used to operate and manage databases.
      You can perform operations such as adding, deleting, modifying, and querying data in the database .
     3. When installing DB, DBMS will be installed (two softwares are bound together)
    Principle:
      Programmers write SQL statements, send them to DBMS, and operate DB.
5. Common relational databases
    SQLServer: Microsoft's product
    oracle: Oracle's product
    DB2: IBM's product
    mysql: Small relational data, open source, free . After being acquired by oracle.
6. Table: A
  table is a structural model used by DB to store data, and
  a table is a two-dimensional structure.
  There are lines: also known as records (records)
  with columns: also known as fields (Field)
Seventh, SQL: Structured Query Language, the purpose is to operate DB through DBMS.
  It contains
    (1) DDL language: data definition language
      create: used to create tables, etc.
      alter: Used to modify the table structure.
      drop:
      truncate used to delete table structure: used to clear table data, keep table structure, (data cannot be restored)
    DDL language, the first two in each sql are keywords

(2) DML language: used to manipulate data, That is, add, delete, and modify operations.
    insert: used to add records to the table.
    delete: used to delete records in the table.
    update: used to modify the records in the table.
(3) DQL: Used to query data.
    select:
(4) TCL: Transaction Control Language.
    When using the DML language, a transaction is triggered.
    commit: Commit data.
    rollback: rollback data
    savepoint: savepoint.
(5) DCL: data control language
    grant: authorization
    revoke: revoke permission
    create user: create user

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324680874&siteId=291194637