最初的

Kratos
专注于用户阅读体验的响应式博客主题
  1. 首页
  2. 华为云考试
  3. 正文

华为云GaussDB考试解答

2025年10月29日 11点热度 0人点赞 0条评论

2.

#建用户和库
gsql -h xxx.xx.xx.x -d postgres -p 8000 -U root -W yourpassword -r
CREATE USER db_dev  SYSADMIN IDENTIFIED BY 'Huawei123!@';
CREATE DATABASE finance WITH OWNER db_dev ENCODING 'UTF8';
\q

#导数据
gsql -h xxx.xx.xx.x -p 8000 -U db_dev -d finance -f /root/create_object.sql

#执行sql
gsql -h xxx.xx.xx.x -d db_dev  -p 8000 -U root -W  'Huawei123!@' -r
SELECT SUM(count)
FROM (SELECT count(*) FROM finance.card_asset
UNION ALL SELECT count(*) FROM finance.client
UNION ALL SELECT count(*) FROM finance.bank_card
UNION ALL SELECT count(*) FROM finance.financial_product
UNION ALL SELECT count(*) FROM finance.financial_asset);
\q

3.好像是一个查询,具体内容忘了,sql是

SELECT n.nspname AS schema_name, c.relname AS table_name, CAST(c.reltuples AS INTEGER) AS table_rows FROM pg_class c JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'finance' AND c.relkind = 'r' ORDER BY table_rows ASC;

4、5、6、7都是改代码。用下面的内容填到对应函数的。编译、运行之后记得按题目要求查询

conn.prepareStatement("") 里的引号里就行了

4.查余额

SELECT bc.b_number, bc.b_type, ca.card_money, ca.moneytype " +
                 "FROM finance.client cl " +
                 "JOIN finance.bank_card bc ON cl.c_id = bc.b_client_id " +
                 "JOIN finance.card_asset ca ON bc.b_number = ca.card_num " +
                 "WHERE cl.c_id = ?
  1. 开卡加存取款信息
INSERT INTO finance.card_asset (card_num, card_money, moneytype) VALUES (?, ?, ?)

6.销卡删存取款信息

DELETE FROM finance.card_asset WHERE card_num = ?

7.存取款

UPDATE finance.card_asset SET card_money = card_money + ? WHERE card_num = ?
标签: gaussDb
最后更新:2025年10月29日

skybreak

这个人很懒,什么都没留下

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2025 年 10 月
  • 2025 年 9 月
  • 2025 年 8 月

分类

  • NAT64
  • VPS测评
  • 前端
  • 前端面试题
  • 华为云考试
  • 教程
  • 未分类
  • 油猴插件
  • 纯IPV6
  • 羊毛

COPYRIGHT © 2025 最初的. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang