PostgresSql Tutorial 4 Create and Delete Table

Опубликовано: 19 Февраль 2020
на канале: txt2text
1,324
22

PostgresSql Tutorial 4 Create and Delete Table
-------------------------------------------------------------------------------------------------------------------------------
Using CREATE DATABASE
This command will create a database from PostgreSQL shell prompt, but you should have appropriate privilege to create a database. By default, the new database will be created by cloning the standard system database template1.
Syntax:
The basic syntax of CREATE DATABASE statement is as follows −

CREATE DATABASE dbname;
where dbname is the name of a database to create.

Example:
The following is a simple example, which will create testdb in your PostgreSQL schema

postgres=# CREATE DATABASE testdb;
postgres-#

Open the command prompt and go to the directory where PostgreSQL is installed. Go to the bin directory and execute the following command to create a database.

createdb -h localhost -p 5432 -U postgres testdb
password ******
The above given command will prompt you for password of the PostgreSQL admin user, which is postgres, by default. Hence, provide a password and proceed to create your new database

Once a database is created using either of the above-mentioned methods, you can check it in the list of databases using \l, i.e., backslash el command


На этой странице сайта вы можете посмотреть видео онлайн PostgresSql Tutorial 4 Create and Delete Table длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь txt2text 19 Февраль 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,324 раз и оно понравилось 22 зрителям. Приятного просмотра!