14. Using the CUSTOMERS table,  you need to generate a report that shows 50% of each credit 

      amount in each income level. The report should NOT show any repeated credit amounts in each income  level. 

      Which  query would give the required result? 

(题意:使用客户表,须要做一个报表,列出每一个收入等级的信用额度的50%,并去除反复值。以下的哪个查询语句能够得到这个结果?)

A. 

SELECT  cust_income_level, DISTINCT cust_credit_limit * 0.50    

AS "50% Credit Limit" 

FROM customers; 

B. 

SELECT DISTINCT cust_income_level, DISTINCT cust_credit_limit * 0.50    

AS "50% Credit Limit" 

FROM customers; 

C. 

SELECT DISTINCT cust_income_level   ' '  cust_credit_limit * 0.50 

AS "50% Credit Limit" 

FROM customers; 

D. 

SELECT cust_income_level ' ' cust_credit_limit * 0.50 

AS "50% Credit Limit" 

FROM customers;

Answer: C

题目解析:

这道题是关于distinct的使用方法:

1.distinct仅仅能放在第一个字段的前面,如Select distinct x,y from t,

2.当distinct后有多个字段时,表示全部字段的值都同样才视为反复值,如Select distinct x,y from t,

  仅仅有当x,y的值都同样时,才视为反复值去除。



所以选项AB是语法错误,选项D没有去除反复值,不合题意。

事实上C也有点错误,正确的写法是:

SELECT DISTINCT cust_income_level || cust_credit_limit * 0.50
AS "50% Credit Limit"
FROM customers;

语句中的''应该换成连接符||

OCP-1Z0-051-题目解析-第14题的更多相关文章

  1. 1Z0-053 争议题目解析

    1Z0-053 争议题目解析 Summary 题目NO. 题目解析链接地址 题库答案 参考答案 考查知识点  24 http://www.cnblogs.com/jyzhao/p/5319220.ht ...

  2. 1Z0-053 争议题目解析330

    1Z0-053 争议题目解析330 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 330.What will be the end result of this set of RM ...

  3. 1Z0-053 争议题目解析25

    1Z0-053 争议题目解析25 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 25.You enabled Flashback Data Archive on the INVEN ...

  4. 1Z0-053 争议题目解析24

    1Z0-053 争议题目解析24 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 24.Which of the following information will be gath ...

  5. 1Z0-053 争议题目解析46

    1Z0-053 争议题目解析46 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 46.What happens when you run the SQL Tuning Adviso ...

  6. 1Z0-053 争议题目解析86

    1Z0-053 争议题目解析86 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 86.Your production database is running in archivel ...

  7. 1Z0-053 争议题目解析134

    1Z0-053 争议题目解析134 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 134.You are managing an Oracle Database 11g datab ...

  8. 1Z0-053 争议题目解析154

    1Z0-053 争议题目解析154 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 154.A database is running in ARCHIVELOG mode and ...

  9. 1Z0-053 争议题目解析175

    1Z0-053 争议题目解析175 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 175.You are peer reviewing a fellow DBAs backup p ...

随机推荐

  1. libevent book——event | Gaccob的博客

    libevent book——event | Gaccob的博客 libevent book——event 发表于 2013 年 2 月 22 日 由 gaccob 原文地址:http://www.w ...

  2. Python基础 - 关键字

    前言 与C一样,python也有自己的关键字,关键字有特殊的意义,不能作为普通的变量名类名等用途 关键字列表 以python2.7.5为例,有如下关键字: and del from not while ...

  3. poj3295 Tautology , 计算表达式的值

    给你一个表达式,其包括一些0,1变量和一些逻辑运算法,让你推断其是否为永真式. 计算表达式的经常使用两种方法:1.递归: 2.利用栈. code(递归实现) #include <cstdio&g ...

  4. MySql 安装及0基础使用具体解释

    1. sudo apt-get install mysql-server, input administrator password , '123' 2. enter mysql promot in ...

  5. PHPExcel融入ZF2

    下载PHPExcel至vendor下一个 在public\index.php加拿大 require './vendor/Classes/PHPExcel.php'; 之后就能够在不论什么地方按例如以下 ...

  6. 用Java写个ftp传输类实现文件的上传和下载,用ikvmc转成dll

    1.Java类: package com.wjy.ftp.transmission; import java.io.File; import java.io.FileOutputStream; imp ...

  7. java7 API详解

    Java™ Platform, Standard Edition 7API Specification This document is the API specification for the J ...

  8. [Sqlite] 移动嵌入式数据库Sqlite日报SQL操作语句汇总

    ,EXPLAIN分析 没有建立索引之前.分析都是表扫描: sqlite> EXPLAIN SELECT *  FROM COMPANY  WHERE Salary < 20000; add ...

  9. linux--关于shell的介绍

    下面是最近学习shell的一些知识点总结***博客园-邦邦酱好*** 1.什么是shell(1)Shell将我们输入的指令与Kernel沟通,好让Kernel可以控刢硬件来正确无误地工作.(2)我们总 ...

  10. SVN 的revert操作