You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Michael J. Carey (JIRA)" <ji...@apache.org> on 2019/06/15 06:24:00 UTC

[jira] [Issue Comment Deleted] (ASTERIXDB-2594) Data setup for Don C's SQL++ tutorial

     [ https://issues.apache.org/jira/browse/ASTERIXDB-2594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael J. Carey updated ASTERIXDB-2594:
----------------------------------------
    Comment: was deleted

(was: I couldn't figure out how to format it nicely in the box above - and I couldn't attach my script file because I get errors every time I try.)

> Data setup for Don C's SQL++ tutorial
> -------------------------------------
>
>                 Key: ASTERIXDB-2594
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2594
>             Project: Apache AsterixDB
>          Issue Type: Improvement
>          Components: DOC - Documentation
>    Affects Versions: 0.9.4.1
>            Reporter: Michael J. Carey
>            Assignee: Ian Maxon
>            Priority: Major
>             Fix For: 0.9.4.2
>
>         Attachments: DonSQL++Data.txt
>
>
> We should add this setup script somewhere on the Apache AsterixDB site - possibly in docs?
>  {{
> -- AsterixDB setup for Don Chamberlin's "SQL++ for SQL Users" book
> DROP DATAVERSE dontutorial IF EXISTS;
> CREATE DATAVERSE dontutorial;
> USE dontutorial;
> CREATE TYPE customer_t AS {custid: string};
> CREATE DATASET customers (customer_t) PRIMARY KEY custid;
> CREATE TYPE order_t AS {orderno: int};
> CREATE DATASET orders (order_t) PRIMARY KEY orderno;
> INSERT INTO customers ([
>   { "custid": "C13",
>     "name": "T. Cruise",
>     "address": 
>        { "street": "201 Main St.",
>          "city": "St. Louis, MO",
>          "zipcode": "63101"
>        },
>     "rating": 750
>   },
>   { "custid": "C25",
>     "name": "M. Streep",
>     "address": 
>        { "street": "690 River St.",
>          "city": "Hanover, MA",
>          "zipcode": "02340"
>        }, 
>     "rating": 690
>   },
>   { "custid": "C31",
>     "name": "B. Pitt",
>     "address": 
>        { "street": "360 Mountain Ave.",
>          "city": "St. Louis, MO",
>          "zipcode": "63101"
>        }
>   },
>   { "custid": "C35",
>     "name": "J. Roberts",
>     "address": 
>        { "street": "420 Green St.",
>          "city": "Boston, MA",
>          "zipcode": "02115"
>        },
>     "rating": 565 
>   },
>   { "custid": "C37",
>     "name": "T. Hanks",
>     "address": 
>        { "street": "120 Harbor Blvd.",
>          "city": "Boston, MA",
>          "zipcode": "02115"
>        }, 
>     "rating": 750
>   }, 
>   { "custid": "C41",
>     "name": "R. Duvall",
>     "address": 
>        { "street": "150 Market St.",
>          "city": "St. Louis, MO",
>          "zipcode": "63101"
>        },
>     "rating": 640
>   },
>   { "custid": "C47",
>     "name": "S. Lauren",
>     "address": 
>        { "street": "17 Rue d'Antibes",
>          "city": "Cannes, France"
>        },
>     "rating": 625
>   }
> ]);
> INSERT INTO orders ([
>   { "orderno": 1001,
>     "custid": "C41",
>     "order_date": "2017-04-29",
>     "ship_date": "2017-05-03",
>     "items": [ { "itemno": 347,
>                  "qty": 5,
>                  "price": 19.99
>                },
>                { "itemno": 193,
>                  "qty": 2,
>                  "price": 28.89
>                }
>              ]
>   },
>   { "orderno": 1002,
>     "custid": "C13",
>     "order_date": "2017-05-01",
>     "ship_date": "2017-05-03",
>     "items": [ { "itemno": 460,
>                  "qty": 95,
>                  "price": 100.99
>                },
>                { "itemno": 680,
>                  "qty": 150,
>                  "price": 8.75
>                }
>              ]
>   },
>   { "orderno": 1003,
>     "custid": "C31",
>     "order_date": "2017-06-15",
>     "ship_date": "2017-06-16",
>     "items": [ { "itemno": 120,
>                  "qty": 2,
>                  "price": 88.99
>                },
>                { "itemno": 460,
>                  "qty": 3,
>                  "price": 99.99
>                }
>              ]
>   }, 
>   { "orderno": 1004,
>     "custid": "C35",
>     "order_date": "2017-07-10",
>     "ship_date": "2017-07-15",
>     "items": [ { "itemno": 680,
>                  "qty": 6,
>                  "price": 9.99
>                },
>                { "itemno": 195,
>                  "qty": 4,
>                  "price": 35.00
>                }
>              ]
>   }, 
>   { "orderno": 1005,
>     "custid": "C37",
>     "order_date": "2017-08-30",
>     "items": [ { "itemno": 460,
>                  "qty": 2,
>                  "price": 99.98
>                },
>                { "itemno": 347,
>                  "qty": 120,
>                  "price": 22.00
>                },
>                { "itemno": 780,
>                  "qty": 1,
>                  "price": 1500.00
>                },
>                { "itemno": 375,
>                  "qty": 2,
>                  "price": 149.98
>                }
>              ]
>   }, 
>   { "orderno": 1006,
>     "custid": "C41",
>     "order_date": "2017-09-02",
>     "ship_date": "2017-09-04",
>     "items": [ { "itemno": 680,
>                  "qty": 51,
>                  "price": 25.98
>                },
>                { "itemno": 120,
>                  "qty": 65,
>                  "price": 85.00
>                },
>                { "itemno": 460,
>                  "qty": 120,
>                  "price": 99.98
>                }
>              ]
>   },
>   { "orderno": 1007,
>     "custid": "C13",
>     "order_date": "2017-09-13",
>     "ship_date": "2017-09-20",
>     "items": [ { "itemno": 185,
>                  "qty": 5,
>                  "price": 21.99
>                },
>                { "itemno": 680,
>                  "qty": 1,
>                  "price": 20.50
>                }
>              ]
>   },
>   { "orderno": 1008,
>     "custid": "C13",
>     "order_date": "2017-10-13",
>     "items": [ { "itemno": 460,
>                  "qty": 20,
>                  "price": 99.99
>                }
>              ]
>   }
> ]);
> SELECT VALUE c FROM customers AS c ORDER BY c.custid;
> SELECT VALUE o FROM orders AS o ORDER BY o.orderno;
> }}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)