How to use Navicat

【Foreword】

      Navicat Premium is a multi-connection database management tool that allows you to connect to MySQL, SQL Server, SQLite, Oracle and PostgreSQL databases simultaneously with a single program, making it easier to manage different types of databases.

      The following summarizes some usage methods, which will be continuously improved with the deepening of learning.

 

【main body】

(1) Create a database

(2) Create a data table

The following is an introduction to the case

(3) Case: Create database and data table

Database name: db_oa

Data table name: sp_dept (department department);

Prepare the sql statement:

create database db_oa;//Create database
use db_oa;//Call the database
create table sp_dept(
    id int not null auto increment,
    name varchar(50) not null,
    pid int not null default 0,//The department is divided into upper and lower levels, pid is only the id of the subordinate department
    sort int not null default 50,//sort
    remark varchar(255),//Remarks
    primary key(id)
)engine=myisam default charset=utf8;//Engine myisam, the default storage engine of Mysql

    Knowledge points: not null is not empty; auto increment increases; default defaults;

 

    1. Create the database db_oa, right-click to create a new database; or F6 to call up the command line operation

  

   Note: The collation here generally chooses utf8_general_ci, which means case insensitive

     2. Create a new data table sp_dept

   There are two ways: query - create a new query - enter the sql statement - run; or press F6 to call up the command line interface; or use the graphical interface table to create fields one by one. It is recommended to use the first or the second

     3. After creation, right-click the table to refresh, and you can see the data table just created

 

 

 

 

 

 

 

 

.

    

 

Guess you like

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