In this post you will learn how to set up your first AWS Redshift database. The queries below allow you to create, delete, alter, and list a database on your Amazon Redshift instance using the AWS query editor.
Table of Contents:
At the first you must have already an AWS account. Connect to your AWS account Here.
The query below allows you to create a new database by running the CREATE command:
create database MyDatabase;
The query below allows you changes the attributes of an existing database by running the ALTER command:
Rename a database
alter database MyDatabase rename to MyNewDatabase;
Change the owner of a database
alter database MyNewDatabase owner to simpleuser;
The query below allows you delete an existing database by running the DROP command. Note that you can't drop the current database:
drop database MyTestDatabase;
To list all the existing databases of an AWS Redshift cluster run the query below:
SELECT * FROM pg_database;
ERBuilder Data Modeler is a GUI data modeling tool that allows you to visualize, design and model databases by using entity relationship diagrams and automatically generates the most popular SQL databases including Amazon Redshift. Generate and share the data Model documentation with your team. Optimize your data model by using advanced features such as test data generation, schema compare and schema synchronization. Try now ERBuilder for 15 days FREE
Subscribe to our email newsletter today to receive updates of the latest news, tutorials and special offers!