Use DDL to manage objects in the database

In the previous article, we discussed how to select the appropriate data type for the field. After selecting the data type of the field, we can begin to create and manage the tables in the database.

Database object

Database (Database) is composed of a group of related objects, including tables, indexes, views, stored procedures, etc. In order to facilitate the management and access of objects, the database usually uses a schema to organize these objects; the schema is a logical unit, or a container for storing objects; the relationship between them is shown in the following figure:

db

A database is composed of multiple patterns, and a pattern is composed of many objects; objects with the same name can be created in different patterns.

The schema in MySQL is the same concept as the database, and a database corresponds to a schema with the same name.

Management database

Create database

When we connect to the database server, we need to specify a target database. If you need to create a new database, you can use the CREATE DATABASE statement:

CREATE DATABASE mydb;

The above statement will create a database named mydb. For Oracle, there is usually only one database; therefore, it is rare to create a database manually.

Oracle 12c and later, if the container database (Container Database) mode is adopted,

Guess you like

Origin blog.csdn.net/horses/article/details/108729089