MySQL創建數據庫表,SQL創建數據庫– PostgreSQL,MySQL,SQL Server

 2023-11-19 阅读 30 评论 0

摘要:The start of data storage is from the creation of a database. As the name suggests database is a base for data. A database typically contains different tables based on the necessity of data storage. 數據存儲從數據庫創建開始。 顧名思義,數據庫是數據的

The start of data storage is from the creation of a database. As the name suggests database is a base for data. A database typically contains different tables based on the necessity of data storage.

數據存儲從數據庫創建開始。 顧名思義,數據庫是數據的基礎。 根據數據存儲的需要,數據庫通常包含不同的表。

SQL創建數據庫 (SQL Create Database)

MySQL創建數據庫表。In this section, we will see how different databases provides the feature of creating a database. So let’s start with the following set of databases.

在本節中,我們將看到不同的數據庫如何提供創建數據庫的功能。 因此,讓我們從以下數據庫開始。

  1. PostgreSQL

    PostgreSQL
  2. MySQL

    MySQL
  3. SQLServer

    SQL服務器

We will try to understand database creation in each of the above mentioned DBs one by one.

創建sql server數據庫, 我們將嘗試一一理解上述每個DB中的數據庫創建。

PostgreSQL創建數據庫 (PostgreSQL Create Database)

PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.

PostgreSQL是一個功能強大的開源對象關系數據庫系統,經過30多年的積極開發,已在可靠性,功能健壯性和性能方面贏得了極高的聲譽。

sql數據庫怎么創建表、In order to create a database in PostgreSQL, you must have either superuser privileges or you should have CREATEDB privilege.

為了在PostgreSQL中創建數據庫,您必須具有超級用戶特權或CREATEDB特權。

Below mentioned are the steps to create a database using PgAdmin (GUI for PostgreSQL).

sqlserver數據庫, 下面提到的是使用PgAdmin(PostgreSQLGUI)創建數據庫的步驟。

  1. Login into server and right click on the PostgreSQL. Select create-> database

    登錄服務器并右鍵單擊PostgreSQL。 選擇創建->數據庫
  2. A pop-up will appear where you can provide the details about the database. Example:- DB name, etc.

    將出現一個彈出窗口,您可以在其中提供有關數據庫的詳細信息。 示例:-數據庫名稱等
  3. Click on save and the new database will be created.

    單擊保存,將創建新數據庫。

Please find below the images to explain the above steps.

請在下面的圖片中找到上述步驟的說明。

PostgreSQL: Right Click Create Database

PostgreSQL: Right Click Create Database

PostgreSQL:右鍵單擊創建數據庫

PostgreSQL: Create DB popup

PostgreSQL: Create DB popup

PostgreSQL:創建數據庫彈出窗口

數據庫的創建。The same database can also be created using SQL command. Please find below the command for the same.

也可以使用SQL命令創建相同的數據庫。 請在命令下面找到相同的內容。

CREATE DATABASE "TestDB"WITH OWNER = postgresENCODING = 'UTF8';

MySQL創建數據庫 (MySQL Create Database)

MySQL is the world’s most popular open source database. We will try to understand how to create a database in MySQL using SQL command.

MySQL是世界上最受歡迎的開源數據庫。 我們將嘗試了解如何使用SQL命令在MySQL中創建數據庫。

Syntax for Create Database:

創建數據庫的語法:

CREATE DATABASE <database_name>

Example for creating a database

創建數據庫的示例

CREATE DATABASE TestDB;

Also for Unix, database names are case-sensitive so please make sure that appropriate case is used.

同樣對于Unix,數據庫名稱區分大小寫,因此請確保使用適當的大小寫。

We can use show databases; to check if the database has been created successfully or not.

我們可以使用show databases; 檢查數據庫是否已成功創建。

MySQL Create Database

MySQL Create Database

MySQL創建數據庫

SQL Server創建數據庫 (SQL Server Create Database)

In SQL Server 2017,?creating a database is as simple as running a script. SQL Server Management Studio provides a GUI database management tool, by just clicking and pointing on the GUI we can create a database.

在SQL Server 2017中,創建數據庫就像運行腳本一樣簡單。 SQL Server Management Studio提供了一個GUI數據庫管理工具,只需單擊并指向GUI,我們就可以創建數據庫。

  • Launch a server

    啟動服務器
  • Connect to the SQL server, provide valid Authentication.

    連接到SQL Server,提供有效的身份驗證。
  • Right Click on Database and click on New Database.

    右鍵單擊數據庫,然后單擊新建數據庫。
  • PopUp will appear. Enter the name of the database and click on OK.

    彈出窗口將出現。 輸入數據庫的名稱,然后單擊確定。
  • The newly created DB will appear in the Object Explorer.

    新創建的數據庫將出現在對象資源管理器中。
SQLServer Create Database

SQLServer Create Database

SQLServer創建數據庫

SQLServer Create Popup

SQLServer Create Popup

SQLServer創建彈出窗口

SQLServer CreateDB Successful

SQLServer CreateDB Successful

SQLServer CreateDB成功

The database is created successfully in SQL Server using SQL Server Management Studio.

使用SQL Server Management Studio在SQL Server中成功創建了數據庫。

翻譯自: https://www.journaldev.com/24204/sql-create-database-postgresql-mysql-sql-server

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/183024.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息