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 get a value from a PostgreSQL XML column?
- How can I use PostgreSQL XOR to compare two values?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How do I parse XML data using PostgreSQL?
- How do I set the PostgreSQL work_mem parameter?
- How can I set a PostgreSQL interval to zero?
- How can I use PostgreSQL's "zero if null" feature?
- How can I use PostgreSQL with YAML?
- How do I use PostgreSQL variables in my software development project?
See more codes...