CREATE TABLE creates a relational table by declaring its name and columns. Each column receives a data type, giving application data a defined structure. section 2.1
Create a stock-trades table
CREATE TABLE trades( id bigint, buyer_id integer, symbol text, order_quantity integer, bid_price numeric(5,2), order_time timestamp ); section 1.5
Listing 1.4 Creating a sample table
CREATE TABLE trades(
id bigint,
buyer_id integer,
symbol text,
order_quantity integer,
bid_price numeric(5,2),
order_time timestamp
);
Inspect the complete sample definition and its column types. section 1.5
After creation, the table can support a short mock-data workflow:
- Use \d to list the table among existing relations. section 1.5
- Use generate_series with INSERT to populate sample trades. section 1.5





