Database Reference
In-Depth Information
(2, 1500, TO_DATE('03/10/2014','MM/DD/YYYY'));
warehouse_db=# INSERT INTO sales_record
(id, sales_amount, sales_date)
VALUES
(3, 2500, TO_DATE('05/15/2014','MM/DD/YYYY'));
warehouse_db=# INSERT INTO sales_record
(id, sales_amount, sales_date)
VALUES
(4, 2000, TO_DATE('07/25/2014','MM/DD/YYYY'));
warehouse_db=# INSERT INTO sales_record
(id, sales_amount, sales_date)
VALUES
(5, 2200, TO_DATE('09/15/2014','MM/DD/YYYY'));
warehouse_db=# INSERT INTO sales_record
(id, sales_amount, sales_date)
VALUES
(6, 1200, TO_DATE('11/15/2014','MM/DD/YYYY'));
We have inserted six records, and we are now going to perform the SELECT queries
on our child tables to verify that our child tables get the right data. Let's do a SELECT
operation on the sales_record_m3_to_m4 table in the following manner:
warehouse_db=# SELECT * FROM sales_record_m3_to_m4;
id | sales_amount | sales_date
----+--------------+------------
2 | 1500 | 2014-03-10
(1 row)
Let's do a select operation on the sales_record_m9_to_m10 table in the following
manner:
warehouse_db=# SELECT * FROM sales_record_m9_to_m10;
id | sales_amount | sales_date
----+--------------+------------
5 | 2200 | 2014-09-15
(1 row)
As you can see in the preceding result, the sales_record_m9_to_m10 child table
contains the record that has sales_date for September and October.
 
Search WWH ::




Custom Search