- You need to produce a report where each customer’s credit limit has been incremented by $1000. In the output,the customer’s last name should have the heading name and the incremented credit limit should be labeled new credit limit. The column should have only the first letter of each word in uppercase. Which statement would accomplish this requirement?
A. SELECT cust_last_name Name,cust_credit_limit+1000 “New Credit Limit” FROM customers;
B. SELECT cust_last_name AS Name,cust_credit_limit+1000 AS New Credit Limit FROM customers;
C. SELECT cust_last_name AS “Name”,cust_credit_limit+1000 AS “New Credit Limit” FROM customers;
D. SELECT INITCAP(cust_last_name) “Name”,cust_credit_limit+1000 INITCAP(“New Credit Limit”) FROM customers; 字段别名加不加 as 都可以,表别名后面 不能加 as 双引号括起来的表示特殊名字,比如名 称中间有空格,带有小写字符(Oracle 默认名称为大写) ,和 sqlserver 的方括号类似。 - Choose the best answer Examine the structure and data in the PRICE_ LIST table: Name Null? Type
PROD_ ID NOT NULL NUMBER(3) PROD_ PRICE VARCHAR2 (10)
PROD ID PROD_ PRICE
100 $234.55
101 $6, 509.75
102 $1,234
You plan to give a discount of 25% on the product price and need to display the di scount amount in the same format as the PROD_ PRICE. Which SQL statement would give the required result?
A) SELECT TO_ CHAR(prod_ price* .25, ‘$99, 999.99’) FROM PRICE_ LIST;
B) SELECT TO_ CHAR (TO_ NUMBER (prod_ price)* .25, ‘$99, 999.00) FROM PRICE_ LIST;
C) SELECT TO_ CHAR (To_ NUMBER (prod_ price, ‘$99,999.99’) .25,’$99,999.00’) FROM PRICE LIST;*
D) SELECT TO_ NUMBER (To_ NUMBER(prod. price, ‘$99,999.99)*.25,’$99,999.000’) FROM PRICE_ LIST;
- Choose two. Which two statements are true? (Choose two.)
A) The USER_ SYNONYMS view can provide information about private synonyms.
B) The user SYSTEM owns all the base tables and user-accessible views of the data dictionary.
C) All the dynamic performance views prefixed with vs are accessible to all the database users.
D) The USER_ OBJECTS view can provide information about the tables and views created by the user who queries the view.
E) DICTIONARY is a view that contains the names of all the data dictionary views that the user can access.
分析: 本题考点是数据字典/data dictionary B. system 用户是操作系统管理员,sys 才是数据库管理员,数据字典的所有基表和视图都 属于 sys 用户。 C. v$为前缀的动态性能视图要有 DBA 权限才能访问。 D. USER_OBJECTS 视图不仅包含用户的表、视图信息,还包括了其他对象如触发器、索引、 过程等等。