Python PostgreSQL – Create Database
In this article, we will discuss how to create database in PsotgreSQL using pysopg2 in Python.
CREATE DATABASE is one of the Data Definition Language ( DDL ) statements supported by the PostgreSQL Database Management System. It is used to create database in PostgreSQL. Database name should be always unique. If it already exists then it shows that the particular database already exists.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Syntax: CREATE DATABASE database_name;
Example: Creating Database using Pyscopg2
Database has been created successfully !!