postgresqlHow do I use an online compiler for PostgreSQL?
Using an online compiler for PostgreSQL is a great way to quickly test out code snippets without needing to install PostgreSQL on a local machine.
The following example code snippet uses the PostgreSQL online compiler to create a table called table1
and insert data into it:
CREATE TABLE table1 (
id serial PRIMARY KEY,
name VARCHAR (50),
age INTEGER
);
INSERT INTO table1 (name, age)
VALUES ('John', 30);
SELECT * FROM table1;
The output of this code would look like:
id | name | age
----+--------+-----
1 | John | 30
(1 row)
To use an online compiler for PostgreSQL, you need to:
- Open an online PostgreSQL compiler such as SQL Fiddle
- Enter your PostgreSQL code in the
Schema
text box - Click
Build Schema
- Enter any data you want to insert in the
Data
text box - Click
Run SQL
You can also use the online compiler to view the output of queries and view the structure of your tables.
Helpful links
More of Postgresql
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How can Zalando use PostgreSQL to improve its software development?
- How do I install and configure PostgreSQL on a Windows machine?
- How can I use PostgreSQL and ZFS snapshots together?
- How can I set a PostgreSQL interval to zero?
- How can I use PostgreSQL XML functions to manipulate XML data?
- How can I convert XML data to a PostgreSQL table?
- How can I use PostgreSQL and Node.js together to develop a software application?
- How do I use the PostgreSQL hash function?
- How can I use PostgreSQL's "zero if null" feature?
See more codes...