📜  柜员 邮票 , bmo , PDF - SQL 代码 示例(1)

📅  最后修改于: 2023-12-03 15:26:35.618000             🧑  作者: Mango

柜员、邮票、BMO、PDF - SQL 代码 示例

本篇文章将介绍柜员、邮票、BMO和PDF相关的SQL代码示例。

柜员
柜员分组统计代码示例
SELECT teller_id, COUNT(*) as num_transactions, SUM(amount) as total_amount
FROM transactions
GROUP BY teller_id;
每位柜员平均每天处理的交易量代码示例
SELECT teller_id, COUNT(*) as num_transactions, COUNT(*) / DATEDIFF(MAX(date), MIN(date)) as avg_daily_transactions
FROM transactions
GROUP BY teller_id;
邮票
邮票类型排序代码示例
SELECT *
FROM stamps
ORDER BY type ASC;
邮票价格分组代码示例
SELECT type, COUNT(*) as num_stamps, MIN(price) as min_price, MAX(price) as max_price
FROM stamps
GROUP BY type;
BMO
BMO银行分行分类代码示例
SELECT branch_name,
  CASE
    WHEN branch_id < 100 THEN 'Small'
    WHEN branch_id between 100 and 200 THEN 'Medium'
    ELSE 'Large'
  END as branch_size
FROM branches;
BMO银行每个分行客户平均余额统计代码示例
SELECT branch_id, AVG(balance) as avg_balance
FROM accounts
GROUP BY branch_id;
PDF
PDF文档中搜索关键字代码示例
SELECT *
FROM pdf_documents
WHERE MATCH(content) AGAINST ('database' IN NATURAL LANGUAGE MODE);
从PDF文件中提取结构化数据代码示例
SELECT document_id,
  REGEXP_SUBSTR(content, 'Order Number: (\d+)') as order_number,
  REGEXP_SUBSTR(content, 'Total Amount: \$(\d+\.\d{2})') as total_amount,
  REGEXP_SUBSTR(content, 'Customer Name: (.+)') as customer_name
FROM pdf_documents;

以上是与柜员、邮票、BMO和PDF相关的SQL代码示例。无论你是需要掌握柜员统计还是PDF文档中关键词搜索,这些SQL代码示例能够帮助你更好地了解和掌握相关的技术。