64.View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of
来源:互联网 发布:c语言简单程序实例 编辑:程序博客网 时间:2024/05/15 17:08
64.View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of
the PROMOTIONS table.
Evaluate the following two queries:
SQL>SELECT DISTINCT promo_category to_char(promo_cost)"code"
FROM promotions ORDER BY code;
SQL>SELECT DISTINCT promo_category promo_cost "code"
FROM promotions ORDER BY 1;
B.Only the second query executes successfully.
C.Both queries execute successfully but give different results.
D.Both queries execute successfully and give the same result.
答案:B
解析:在设置列别名的时候,是不区分大小写的,数据库都会转换成大写,但是如果加上双引号后
就会保持原样,第一个sql语句,order by code,其实会转化为 order by CODE,而列别名"code"
还是保持小写,因此会报错
SQL> select '1' "code" from dual order by code;
select '1' "code" from dual order by code
*
ERROR at line 1:
ORA-00904: "CODE": invalid identifier
第二条sql语句,使用的是阿拉伯数字,它代表的其实是列的位置,从1开始
the PROMOTIONS table.
Evaluate the following two queries:
SQL>SELECT DISTINCT promo_category to_char(promo_cost)"code"
FROM promotions ORDER BY code;
SQL>SELECT DISTINCT promo_category promo_cost "code"
FROM promotions ORDER BY 1;
Which statement is true regarding the execution of the above queries?
B.Only the second query executes successfully.
C.Both queries execute successfully but give different results.
D.Both queries execute successfully and give the same result.
答案:B
解析:在设置列别名的时候,是不区分大小写的,数据库都会转换成大写,但是如果加上双引号后
就会保持原样,第一个sql语句,order by code,其实会转化为 order by CODE,而列别名"code"
还是保持小写,因此会报错
SQL> select '1' "code" from dual order by code;
select '1' "code" from dual order by code
*
ERROR at line 1:
ORA-00904: "CODE": invalid identifier
第二条sql语句,使用的是阿拉伯数字,它代表的其实是列的位置,从1开始
0 0
- 64.View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of
- 92.View the Exhibit and examine the data in the PROMO_NAME and PROMO_END_DATE columns of the PROMOTI
- 85.View the Exhibit and examine the structure and data in the INVOICE table.
- 107.View the Exhibit and examine the structure and data in the INVOICE table.
- 15.View the Exhibit and examine the data in the CUSTOMERS table.
- 17.View the Exhibit and examine the data in the EMPLOYEES table.
- 53.View the Exhibit and examine the data in the PROMOTIONS table.
- 59.View the Exhibit and examine the data in the PRODUCTS table.
- 66.View the Exhibit and examine the data in the COSTS table.
- 126.View the Exhibit and examine the data in the PROJ_TASK_DETAILS table.
- 130.View the Exhibit and examine the data in the EMPLOYEES table:
- 150.View the Exhibit and examine the data in the PROMOTIONS table.
- 106.Examine the data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table:
- 79.View the Exhibit and examine the structure of the CUSTOMERS table. In the CUSTOMERS table, the CU
- 1.View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables.
- 124.View the Exhibit and examine the structure of the PROMOTIONS, SALES, and CUSTOMER tables.
- 131.View the Exhibit and examine the structure of the PRODUCT, COMPONENT, and PDT_COMP tables.
- 132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables.
- Python爬虫入门一之综述
- Android Studio module里面放switch语句报错 R文件找不到
- 2016-03-03 名句诗
- 小范围排序
- [从头学数学] 第117节 相交线与平行线 小结与复习题
- 64.View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of
- Profiler内存查看|Navmesh动态加载...
- openGL在surfaceView中实例
- AAA Spring精讲
- c++的几种典型数据类型
- iOS开发UItextfile弹出日期选择控制器输入日期
- @Autowired与@Resource
- 算法导论第三版习题8.1
- Android 圆角图形和圆角头像的完美实现