This is the second day of my participation in Gwen Challenge

What is a table in a database

One of the most frequently mentioned concepts in databases is “tables.” In fact, a “table” is a group of descriptive information, including one or more aspects of information, that is artificially summarized and used to describe a class of things. For example, a person’s description can include (name, age, occupation), etc. Each piece of information in a table is called a record. For example, information about a specific person forms a record in the table “person”.

The structure of tables stored in a database is similar to rows and columns in Excel. In a database, rows are called records, which are equivalent to a record, and columns are called fields, which represent data items stored in a table.

2 Classification of SQL statements

SQL statements can be divided into three categories based on the kinds of instructions assigned to an RDBMS:

DDL

Data Definition Language (DDL) is used to create or delete objects such as databases and tables used to store Data. The DDL contains the following instructions.

  • CREATE: Creates objects such as databases and tables

  • DROP: Deletes objects such as databases and tables

  • ALTER: Alters the structure of objects such as databases and tables

DML

The Data Manipulation Language (DML) is used to query or change records in a table. DML contains the following instructions.

  • SELECT: queries the data in the table

  • INSERT: Inserts new data into a table

  • UPDATE: Updates data in a table

  • DELETE: deletes data from a table

DCL

The Data Control Language (DCL) is used to confirm or cancel changes to Data in the database. In addition, you can specify whether users of the RDBMS have permission to manipulate objects in the database (database tables, etc.). The DCL contains the following instructions.

  • COMMIT: Confirm changes to data in the database

  • ROLLBACK: Cancels changes to data in the database

  • GRANT: GRANT operation rights to the user

  • REVOKE: Revokes a user’s operation rights

Basic writing rules for SQL

  • SQL statements start with a semicolon (;) At the end
  • SQL statements are case-insensitive.
  • Words need to be separated by half-corner Spaces or line breaks
  • By default, win does not respect the case of table and field names
  • By default, Linux/MAC is case-sensitive on table names and field names
  • .