`
JerryWang_SAP
  • 浏览: 1030467 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

在SAP HANA Express Edition里创建数据库表

阅读更多

使用命令行访问hdbsql:

# hdbsql -u SYSTEM -d SYSTEMDB -i 90

输入SYSTEM用户的密码。

在默认的HXE database tenant上启用document store:

ALTER DATABASE HXE ADD 'docstore';

使用下面的命令行创建一个document store collection:

CREATE COLLECTION food_collection;

注:hqlsql主要是用于Administration类型的工作使用,开发过程中最好还是用sqlpad等工具连接SAP HANA express.

往该document store里插入数据:
INSERT INTO food_collection VALUES('{ "name" : "Kiwi", "group" : "Fruits", "subgroup" : "Tropical fruits", "nutrients" : { "Carbohydrate" : 20945.0, "Energy" : 176.0, "Fat" : 1955.0, "Fiber" : 1925.0, "Proteins" : 1421.3 }, "description" : "The kiwifruit, often shortened to kiwi in many parts of the world, is the edible berry of a woody vine in the genus Actinidia. The most common cultivar group of kiwifruit (''Hayward'') is oval, about the size of a large hen''s egg (5?8 centimetres in length and 4.5?5.5 centimetres in diameter). It has a fibrous, dull greenish-brown skin and bright green or golden flesh with rows of tiny, black, edible seeds. The fruit has a soft texture and a sweet but unique flavor, and today is a commercial crop in several countries, such as Italy, New Zealand, Chile, Greece and France." }');
INSERT INTO food_collection VALUES('{ "name" : "Onion", "group" : "Vegetables", "subgroup" : "Onion-family vegetables", "nutrients" : { "Carbohydrate" : 18057.407, "Energy" : 345.333, "Fat" : 0.0, "Fiber" : 2296.154, "Proteins" : 2150.741 }, "description" : "Allium haematochiton is a species of wild onion known by the common name redskin onion. It is native to northern Baja California and southern California. It it grows on the slopes of the coastal hills and mountains, such as those of the Peninsular Ranges, Transverse Ranges, and southern California Coast Ranges." }');
INSERT INTO food_collection VALUES('{ "name" : "Garlic", "group" : "Herbs and Spices", "subgroup" : "Herbs", "nutrients" : { "Carbohydrate" : 50898.333, "Energy" : 770.333, "Fat" : 0.0, "Fiber" : 3850.000, "Proteins" : 8301.667 }, "description" : "With a history of human use of over 7,000 years, garlic (Allium sativum) is native to central Asia, and has long been a staple in the Mediterranean region, as well as a frequent seasoning in Asia, Africa, and Europe. There are two sub-varieties of allium sativum: Allium sativum var. sativum (soft-necked garlic) and Allium sativum var. ophioscorodon (hard-necked garlic). Soft-necked garlic is the most commonly found. Bulb garlic is available in many forms, including fresh, frozen, dried, fermented (black garlic) and shelf stable products (in tubes or jars)." }');
INSERT INTO food_collection VALUES('{ "name" : "Cashew nut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 33540.993, "Energy" : 1622.625, "Fat" : 15466.667, "Fiber" : 2381.818, "Proteins" : 13402.857 }, "description" : "The cashew, or caju, is a small tree native to Brazil. Cashew nuts are the seeds of the cashew apple, and are found in the grey bump at the end of the fruit. The cashew apple itself is sweet, soft and juicy.Cashews are usually sold roasted and salted and eaten as a snack." }');
INSERT INTO food_collection VALUES('{ "name" : "Pineapple", "group" : "Fruits", "subgroup" : "Tropical fruits", "nutrients" : { "Carbohydrate" : 17650.476, "Energy" : 179.613, "Fat" : 2188.600, "Fiber" : 705.263, "Proteins" : 542.857 }, "description" : "The Pineapple (Ananas comosus), named for its resemblance to the pine cone, is a tropical plant with edible multiple fruit consisting of coalesced berries, and the most economically significant plant in the Bromeliaceae family. Pineapples may be cultivated from a crown cutting of the fruit, possibly flowering in 20–24 months and fruiting in the following six months. Pineapple does not ripen significantly post-harvest. Pineapples are consumed fresh, cooked, juiced, and preserved, and are found in a wide array of cuisines. In addition to consumption, in the Philippines the pineapple''s leaves are used to produce the textile fiber piña- employed as a component of wall paper and furnishings, amongst other uses." }');
INSERT INTO food_collection VALUES('{ "name" : "Peanut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 19706.341, "Energy" : 1571.563, "Fat" : 14543.900, "Fiber" : 6891.892, "Proteins" : 22098.293 }, "description" : "The peanut, also known as the groundnut and the goober and taxonomically classified as Arachis hypogaea, is a legume crop grown mainly for its edible seeds. It is widely grown in the tropics and subtropics, being important to both small and large commercial producers. It is classified as both a grain legume and, because of its high oil content, an oil crop. World annual production of shelled peanuts was 42 million tonnes in 2014. Atypically among crop plants, peanut pods develop underground rather than aboveground. It is this characteristic that the botanist Linnaeus used to assign the specific name hypogaea, which means ''under the earth''." }');
INSERT INTO food_collection VALUES('{ "name" : "Horseradish", "group" : "Herbs and Spices", "subgroup" : "Spices", "nutrients" : { "Carbohydrate" : 22922.500, "Energy" : 229.000, "Fat" : 700.000, "Fiber" : 3600.000, "Proteins" : 4557.500 }, "description" : "Horseradish (Armoracia rusticana, syn. Cochlearia armoracia) is a perennial plant of the Brassicaceae family (which also includes mustard, wasabi, broccoli, and cabbage). The plant is probably native to southeastern Europe and western Asia. It is now popular around the world. It grows up to 1.5 metres (5 feet) tall, and is cultivated primarily for its large, white, tapered root. The intact horseradish root has hardly any aroma. When cut or grated, however, enzymes from the now-broken plant cells break down sinigrin to produce allyl isothiocyanate, which irritates the mucous membranes of the sinuses and eyes. Once exposed to air (via grating) or heat, if not used immediately or mixed in vinegar, the grated mash darkens, loses its pungency, and becomes unpleasantly bitter-tasting." }');
INSERT INTO food_collection VALUES('{ "name" : "Asparagus", "group" : "Vegetables", "subgroup" : "Shoot vegetables", "nutrients" : { "Carbohydrate" : 4725.000, "Energy" : 58.364, "Fat" : 2150.000, "Fiber" : 1276.471, "Proteins" : 2872.889 }, "description" : "Asparagus officinalis is a spring vegetable, a flowering perennial plant species in the genus Asparagus. It was once classified in the lily family, like its Allium cousins, onions and garlic, but the Liliaceae have been split and the onion-like plants are now in the family Amaryllidaceae and asparagus in the Asparagaceae. Asparagus officinalis is native to most of Europe, northern Africa and western Asia, and is widely cultivated as a vegetable crop." }');
INSERT INTO food_collection VALUES('{ "name" : "Brazil nut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 11897.863, "Energy" : 2082.000, "Fat" : 67459.500, "Fiber" : 4266.667, "Proteins" : 11679.000 }, "description" : "The Brazil nut (Bertholletia excelsa) is a South American tree in the family Lecythidaceae, and also the name of the tree''s commercially harvested edible seed." }');
INSERT INTO food_collection VALUES('{ "name" : "Common beet", "group" : "Vegetables", "subgroup" : "Leaf vegetables", "nutrients" : { "Carbohydrate" : 9100.909, "Energy" : 102.500, "Fat" : 0.0, "Fiber" : 2327.273, "Proteins" : 1490.000 }, "description" : "The beet (Beta vulgaris) is a plant in the Chenopodiaceae family which is now included in Amaranthaceae family. It is best known in its numerous cultivated varieties, the most well known of which is the root vegetable known as the beetroot or garden beet. However, other cultivated varieties include the leaf vegetable chard, as well as the root vegetable sugar beet, which is important in the production of table sugar, and mangelwurzel, which is a fodder crop. Three subspecies are typically recognised. All cultivated varieties fall into the subspecies Beta vulgaris subsp. vulgaris, while Beta vulgaris subsp. maritima, commonly known as the sea beet, is the wild ancestor of these, and is found throughout the Mediterranean, the Atlantic coast of Europe, the Near East, and India. A second wild subspecies, Beta vulgaris subsp. adanensis, occurs from Greece to Syria. The roots are most commonly deep red-purple in color, but come in a wide variety of other shades, including golden yellow and red-and-white striped. Beta vulgaris is a herbaceous biennial or, rarely, perennial plant with leafy stems growing to 1–2 m tall. The leaves are heart-shaped, 5–20 cm long on wild plants (often much larger in cultivated plants). The flowers are produced in dense spikes; each flower is very small, 3–5 mm diameter, green or tinged reddish, with five petals; they are wind pollinated. The fruit is a cluster of hard nutlets." }');

上述插入的数据可以用SELECT 查询出来:

SELECT "name", "group", "subgroup", "nutrients", "description" FROM food_collection;

指定where条件以获得更小的数据集:

SELECT "name", "group", "subgroup", "nutrients", "description" FROM food_collection WHERE "group" = 'Vegetables';

0
0
分享到:
评论

相关推荐

    SAP HANA 数据库 2.8.22 含 ODBC

    2.8.22是该数据库系统的一个版本号,代表着在该版本中,SAP对HANA进行了多方面的优化和更新,以提供更高效、稳定的服务。 在描述中提到的"含ODBC"意味着此版本的SAP HANA客户端包含了Open Database Connectivity...

    sap hana studio SAP HANA 数据库连接工具

    sap hana studio SAP HANA 数据库连接工具 及安装方式

    SAPHANA数据库.pdf

    在SAP HANA中,表是数据的基本存储单元。表可以存储大量数据,并且可以根据不同的维度进行分析和报表生成。 2.2 模型 模型是SAP HANA中的一种数据模型,它可以定义数据的结构和关系。模型可以用于数据分析和报表...

    SAP HANA数据库直连工具

    标题中的"SAP HANA数据库直连工具"是指用于与SAP HANA高性能内存数据库进行直接交互的软件或程序。SAP HANA是一个企业级的数据管理平台,它支持实时分析和事务处理,为业务应用程序提供了强大的数据处理能力。直连...

    SAP HANA 内存使用分析

    在SAP HANA数据库中,内存是最重要的资源之一。内存的使用情况对于SAP HANA系统的性能有着直接影响。因此,理解和分析SAP HANA系统的内存使用情况,对于优化系统性能和进行系统调优是非常重要的。 SAP HANA的内存...

    Kettle连接SAP HANA数据库包 ngdbc-2.5.49.jar

    Kettle连接SAP HANA DB 数据库支持包 ngdbc-2.5.49.jar 测试过可以使用

    SAP-HANA数据库SQL参考手册.pdf

    SAP HANA数据库是SAP公司推出的一个高性能、实时的数据库和应用平台,专为大规模数据处理而设计。SAP HANA数据库的一个关键特性是其对SQL(结构化查询语言)的支持,这使得它能够处理复杂的数据查询和事务处理。SQL...

    SAP-HANA数据库SQL参考手册.pdf(中文版)

    数据类型在数据库中扮演着核心角色,决定了存储在列中的数据格式,比如整数、浮点数、字符串等。在SAP HANA中,数据类型包括数字类型、日期时间类型、字符类型、二进制类型以及大对象(LOB)类型等,每种类型都有...

    SAP HANA运维文档

    SAP HANA运维工具 自动化脚本 备份工具 SAP HANA运维工具 自动化脚本 备份工具

    SAP HANA Database - System Tables and Monitoring View

    在SAP HANA中,系统表(System Tables)与监控视图(Monitoring Views)是管理和监控数据库性能的重要工具。 #### 目标受众 本文档主要面向以下几类人群: - **咨询顾问**:负责企业信息化建设规划及实施的专业人士。...

    SAP Data Services如何连接HANA

    当需要与SAP HANA进行交互时,SAP Data Services 提供了直接的连接能力,使用户能够轻松地访问和处理存储在HANA数据库中的大量结构化数据。以下将详细介绍如何在SAP Business Objects Data Services (BO Data ...

    华为 SAP HANA一体机 集群安装指南(RH5885H&RH8100 V3+5500 V3+SLES12SP1)02.pdf

    在安装好 SAP HANA 数据库后,需要检测安装是否成功。检测方法包括检查 SAP HANA 数据库的状态、检查 SAP HANA 的性能等。 符号约定 在本文档中,使用了多种符号来表示不同的含义。这些符号包括警示紧急的危险情形...

    SAP HANA-STUDIO 安装包

    3. **数据库管理**:管理HANA数据库的对象,如表、索引、存储过程等,同时进行性能优化和监控。 4. **版本控制**:集成Git等版本控制系统,便于团队协作和代码管理。 5. **调试与测试**:提供调试器和测试工具,...

    中文版SAP-HANA数据库SQL参考手册.docx

    1. **数据类型**:数据类型定义了存储在数据库中的数据的种类和格式。SAP HANA支持多种数据类型,如: - **数据类型的分类**:包括数值类型(如整数、浮点数)、字符串类型、日期时间类型(Date、Time、Timestamp)...

    hana express VM Env

    SAP HANA Express 版(SAP HANA, express edition)是SAP为开发者提供的一款轻量级数据库解决方案,它包含了SAP HANA核心功能的一个子集,非常适合学习和开发使用。本文档主要介绍了如何安装和开始使用SAP HANA 2.0,...

    Sap Hana.zip

    2 SAP HANA数据库 帮助您安全地操作和配置SAP HANA数据库的清单和建议 提示 SAP Note 1969700包含有用的SQL语句的集合,用于监视和分析SAP HANA数据库。文件HANA_Security_MiniChecks.txt中包含的语句执行所有 ...

    SAP HANA操作手册

    总结而言,这份SAP HANA操作手册详细介绍了联想为SAP HANA平台版提供的硬件支持和软件解决方案,强调了高性能硬件配置对于保证SAP HANA数据库性能的重要性,以及在实际操作中需要注意的兼容性和性能评估问题。

    sap hana的jdbc驱动包以及测试连接的代码

    在这个场景中,"ngdbc.jar" 是SAP HANA提供的JDBC驱动程序,它使得Java应用程序能够连接到HANA数据库并执行SQL查询。 首先,我们需要了解`ngdbc.jar`的作用。这是一个二进制的Java类库,包含了所有必要的类和方法,...

    SAP HANA Platform 2.0参考手册完整版

    扩展性方面,SAP HANA 2.0 支持多租户数据库容器(MTDC),允许多个独立的数据库实例在同一硬件上运行,隔离不同的业务应用。这不仅提高了硬件利用率,也便于管理和升级。 最后,SAP HANA 2.0 提供了丰富的分析功能...

Global site tag (gtag.js) - Google Analytics