如果你考证只背题库,但是考完证保证你一个月之后忘光,如果你想弄点谈资,看一遍《051考试指南》,然后背题库。

如果你想靠这门技术吃饭或维系生活,首先看一遍模拟题库,阅读051考试指南3遍以上,然后再做题;即使你能很快就能拿到证书,把书中的每个案例和题库的各种情况模拟下,你会真正理解。推荐大家都看下daved博客。

051中文

该文囊括了刘老师的注解和案例

本人粗略进行中文翻译

1、

CREATE TABLE new_sales(prod_id, cust_id, order_dateDEFAULTSYSDATE)AS

SELECT prod_id, cust_id, time_idFROM sales;

Which statement is true regarding the above command?上面命令哪个是正确的?

B. The NEW_SALES table wouldget created and all the NOT NULL constraints defined on the specified columnswould be passed to the new table.

隐式声明的NOT NULL约束(例如主键的NOT NULL约束)不会继承。

2、

Which views can have all DML operations performed on it?(Choose all that apply.)

--A.

CREATE VIEW v3 AS SELECT * FROM SALESWHERE cust_id=2034WITHCHECKOPTION;

--B.

CREATE VIEW v1 AS SELECT * FROM SALESWHERE time_id<=SYSDATE-2*365WITHCHECKOPTION;

解释:插入视图中没有记录是可以的。

C,D因为指定了具体的列,而且D中指定了分组函数。

3、

Youneed to extract details of those products in the SALES table where the PROD_IDcolumn contains the string '_D123'.

Which WHERE clausecould be used in the SELECT statement to get the required output? (B)

B.WHEREprod_idLIKE'%\_D123%' ESCAPE'\'

4、

Whichtwo statements are true regarding single row functions? (Choose two.) (DE)

D. They always return asingle result row for every row of a queried table.他们总是返回单个结果行(为一个查询表的每行)

E. They can return adata type value different from the one that is referenced.他们返回一个数据类型值区别于引用的的那个

单行函数可以嵌套任意层,而分组函数最多可以嵌套2层。

C,也可以是函数的返回值。

5、

Which SQL statementswould display the value 1890.55 as $1,890.55? (Choose three)

A. SELECTTO_CHAR(1890.55,'$0G000D00')FROM DUAL;

D. SELECTTO_CHAR(1890.55,'$99G999D00')FROM DUAL;

E. SELECTTO_CHAR(1890.55,'$99G999D99')FROM DUAL;

不允许混合合适符号和字母指定格式

6、

Examine the structure of the SHIPMENTS table:

name            Null       Type

PO_ID           NOT NULL    NUMBER(3)

PO_DATE         NOT NULL    DATE

SHIPMENT_DATE  NOT NULL    DATE

SHIPMENT_MODE               VARCHAR2(30)

SHIPMENT_COST               NUMBER(8,2)

你想产生一个报告显示PO_ID,如果shipment_date比PO_DATE时间晚1个月,将罚款;每天罚款20美元;执行以下查询::

SELECT po_id,

CASE WHEN MONTHS_BETWEEN (shipment_date,po_date)>1 THEN TO_CHAR((shipment_date- po_date)*20)ELSE'No Penalty'END PENALTY

FROM shipments;

SELECT po_id,DECODE(MONTHS_BETWEEN(po_date,shipment_date)>1,TO_CHAR((shipment_date- po_date)*20),'No Penalty') PENALTY

FROM shipments;

Which statement is true regarding the above commands?

C. Only the first queryexecutes successfully and gives the correct result.

DECODE函数在此不适用。

7、

Which two statements are true regarding the USING and ONclauses in table joins? (Choose two.)哪两个语句是正确的,关于usingon条件(在表连接中)

A. Both USING and ON clauses can beused for equijoins and nonequijoins.

B. A maximum of one pair of columns can be joinedbetween two tables using the ON clause.

C. The ON clause can beused to join tables on columns that have different names but compatible datatypes.On条件可以用join表的列,有不同名字,但兼容数据类型)

D. The WHERE clause can be used to apply additionalconditions in SELECT statements containing the ON or the USING clause.Where条件可以被用于去应用slect语句中的额外条件(包含onusing条件)

A. USING只能用于等值连接。

B. 使用ON子句进行连接时,可以指定多个列对。

C.ON条件可以用于连接表(列有不同的名字,但兼容数据类型)

D.WHERE条件可以用于应用额外的条件(在select语句中包含on或using条件之外)

8、

View the Exhibit and examine the structureof the CUSTOMERS table.

Which twotasks would requiresubqueriesorjoins to be executed in a singlestatement? (Choose two.)在单个语句中需要执行子查询或连接才能实现的任务?

A. listing of customers who do not have acredit limit and were born before 1980列出没有credit限制且出生在1980年前的客户

B. finding the number of customers, in eachcity, whose marital status is 'married'找出每个城市中已婚客户的数量

C. finding the average credit limit of malecustomers residing in 'Tokyo' or 'Sydney'找出位于tokyo或sydney中male客户的credit限制的平均值

D. listing of thosecustomers whose credit limit is the same as the credit limit of customersresiding in the city 'Tokyo'列举这些customerscredit limit与相同的(位于tokyo城市的customers相同))

E. finding the number of customers, in each city, whose creditlimit is more than the average credit limit of all the customers发现每城市中客户的数量,哪些客户限制大于所有客户的平均限制。)

A SELECT*FROM customersWHERE cust_credit_limitIS NULL AND cust_year_of_birth<1980;

B SELECT cust_city,COUNT(maritial_status)WHERE maritial_status ='married'GROUPBY cust_city;

C SELECTAVG(cust_credit_limit)FROM customers WHERE cityIN('Tokyo','Sydney')AND gender ='M'

9

Which statement is true regarding the INTERSECT operator?关于交叉intersect操作符正确的是

A. It ignores NULL values.

B. Reversing the order of the intersectedtables alters the result.交叉表倒序改变结果X

C. The names of columns in all SELECTstatements must be identical.

D. The number of columns and data types must be identical forall SELECT statements in the query.在查询中所有的select语句的列数量和数据类型必须是完全相同的。

Intersect操作不忽略空值。它会比较null,此时可以认为null =null

10、

View the Exhibit; examine the structure ofthe PROMOTIONS 提升推广table.

Each promotion has a duration of at leastseven days .每一次推广至少有7天的期限

Your manager has asked you to generate areport, which provides the weekly cost for each promotion done to l date.你管理者让你生成一个报告,按照周成本

Which query would achieve the required result? 哪个查询可完成你要求的结果

A. SELECT promo_name, promo_cost/promo_end_date-promo_begin_date/7FROM promotions;

B. SELECT promo_name,(promo_cost/promo_end_date-promo_begin_date)/7FROM promotions;

C. SELECT promo_name, promo_cost/(promo_end_date-promo_begin_date/7)FROM promotions;

D. SELECT promo_name, promo_cost/((promo_end_date-promo_begin_date)/7)FROM promotions;

11、

View the Exhibit and examine the structureof the PRODUCTS table. Allproducts have a list price. 所有产品有一个公开列价You issuethe following command to display the total price of each product after adiscount of 25% and a tax of 15% are applied on it. Freight charges of $100have to be applied to all the products.你发起下列命令去显示每一个产品的总价(折扣25%,税金提升15%之后);货运费100美元已经应用到所有的产品中。

SELECT prod_name, prod_list_price-(prod_list_price*(25/100)) +(prod_list_price -(prod_list_price*(25/100))*(15/100))+100

AS "TOTAL PRICE"

FROM products;

What would be the outcome if all the parentheses(括号) areremoved from the above statement?如果所有的括号从上面的语句中删除,会有什么的结果?

A. It produces a syntax error.

B. The result remains unchanged.

C. The total price value would be lowerthan the correct value.

D. The total price value would be higherthan the correct value.

12、

You need to produce a report where eachcustomer's credit limit has been incremented by $1000. In the output, thecustomer's last name should have the heading Name and the incremented credit limitshould be labeled New Credit Limit. The column headings should have only thefirst letter of each word in uppercase .你需要生成一个报告(每个客户的creditlimit增加1000美元),在最后输出时,客户的last name有heading Name, New Credit Limit.

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+1000ASNew CreditLimit FROM customers;

C. SELECT cust_last_nameAS"Name", cust_credit_limit+1000 AS"New Credit Limit"FROM customers;

D.SELECTINITCAP(cust_last_name)"Name", cust_credit_limit+1000 INITCAP("NEW CREDIT LIMIT")FROM customers;headings

A也正确

13、

View the Exhibit and examine the structureof the PRODUCTS table. You need to generate a report in the following format:

CATEGORIES

5MP Digital PhotoCamera's category is Photo Y Box's category is Electronics

Envoy Ambassador'scategory is Hardware

Which two queries would give the requiredoutput? (Choose two.)

A.SELECT prod_name|| q'''scategory is ' || prod_category CATEGORIESFROM products;

B. SELECT prod_name || q'['s ]'category is ' || prod_category CATEGORIESFROM products;

C. SELECT prod_name || q'\'s\'    ' ||categoryis ' || prod_category CATEGORIES FROM products;

D. SELECT prod_name || q'<'s >' ||'category is ' || prod_category CATEGORIESFROM products;

注意:从Oralce 10g开始,可以使用q’<>/[]/{}’,引号中用特殊字符括起来即可。

14

Usingthe CUSTOMERS table, you need to generate a report that shows 50% of eachcredit amount in each income level. The report shouldNOTshow anyrepeatedcredit amounts ineachincome level. 使用customers表,你需要产生一个报告来显示在每一个收入级别中的每个赊账金额的50% 报告不应该显示每一个收入级别的重复的信贷额。Which query would give the required result?

A.SELECT cust_income_level,DISTINCT cust_credit_limit*0.50AS"50% Credit Limit"FROM customers;

B. SELECT DISTINCT cust_income_level,DISTINCT cust_credit_limit*0.50AS"50% Credit Limit"FROM customers;

C.SELECTDISTINCT cust_income_level|| cust_credit_limit* 0.50 AS "50% Credit Limit"FROM customers;

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

解释:

A. DISTINCT关键字只能出现在第一列之前。

B. 一个SELECT语句上只能出现一个DISTINCT关键字

15

View theExhibit and examine the data in the CUSTOMERS table.

Evaluatethe following query:评价下列查询

SELECT cust_nameAS"NAME",

cust_credit_limit/2AS MIDPOINT,

MIDPOINT +100AS"MAX LOWER LIMIT"

FROM customers;

Theabove query produces an error on execution. What is the reason for the error?

A. An alias cannot be used inan expression.别名不能用在表达式中

B. Thealias NAME should not be enclosed with in double quotation marks .

C. TheMIDPOINT+100 expression gives an error because CUST_CREDIT_LIMIT contains NULLvalues.

D. The aliasMIDPOINT should be enclosed within double quotation marks for theCUST_CREDIT_LIMIT/2 expression .

16

Evaluatethe following query:

SELECT promo_name || q'{'sstartdate was}' || promo_begin_date

AS "Promotion Launches"

FROM promotions;

What would be theoutcome of the above query?

A. Itproduces an error because flower braces have been used.

B. Itproduces an error because the data types are not matching.

C. It executes successfully and introduces an 's at the end of eachpromo_name in the output.执行成功7369's start date was SMITH

D. Itexecutes successfully and displays the literal " {'s start date was }" for each row in the output.

17

View theExhibit and examine the data in the EMPLOYEES table.

You wantto generate a report showing the total compensation paid to each employee to date.You issue the following query:你想生成一个报告显示总和的赔偿支付给每个员工的日期。

SELECT ename || ' joined on '|| hiredate||

', the total compensation paid is '||

TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365)* sal + comm)

"COMPENSATION UNTIL DATE"

FROM employees;

What is the outcome?

A. Itgenerates an error because the alias is not valid.

B. Itexecutes successfully and gives the correct output.

C. It executes successfullybut does not give the correct output.

D. Itgenerates an error because the usage of the       ROUND function in the expression is not valid.

E. It generates an error because theconcatenation operator can be used to combine only two items.

解释:有些记录的comm为空。

18

Examinethe structure of the PROMOTIONS table:

name             Null       Type

PROMO_ID        NOT NULL    NUMBER(6)

PROMO_NAME      NOT NULL    VARCHAR2(30)

PROMO_CATEGORY NOT NULL    VARCHAR2(30)

PROMO_COST      NOT NULL    NUMBER(10,2)

Themanagement wants to see a report of unique promotion costs in each promotioncategory. 管理者想看一个报告(每一个推广类别的推广费用唯一的)Which querywould achieve the required result?

A.

SELECT DISTINCT promo_cost, promo_categoryFROM promotions;

B.

SELECT promo_category,DISTINCT promo_costFROM promotions;

C.

SELECT DISTINCT promo_cost, DISTINCT promo_category FROM promotions;

D.

SELECTDISTINCT promo_category, promo_costFROM promotionsORDER BY 1;

19重点查询资料

Evaluatethe following query:

SELECT INTERVAL '300' MONTH,INTERVAL'54-2'YEARTO MONTH,

INTERVAL '11:12:10.1234567' HOUR TO SECOND

FROM dual;

What is the correctoutput of the above query?

A. +25-00 , +54-02, +00 11:12:10.123457

B.+00-300, +54-02, +00 11:12:10.123457

C.+25-00 , +00-650, +00 11:12:10.123457

D. +00-300 , +00-650, +00 11:12:10.123457

SQL Language Reference->Literal

20

Whichthree statements are true regarding the data types in Oracle Database 10g/11g?(Choose three.)

A. Only one LONG column canbe used per table.每表中只有一个long列可用

B. ATIMESTAMP data type column stores only time values with fractional seconds.

C. TheBLOB data type column is used to store binary data in an operating system file.

D. The minimum column widththat can be specified for a VARCHAR2 data type column is one.  varchar2数据类型列可以指定最小的列宽度为1

E. The value for a CHAR datatype column is blank-padded to the maximum defined column width.Char数据类型列的值可以通过填充空格来设置列宽度

21

Examinethe description of the EMP_DETAILS table given below:

name        NULL        TYPE

EMP_ID      NOT NULL    NUMBER

EMP_NAME    NOT NULL    VARCHAR2 (40)

EMP_IMAGE               LONG

Which two statements are true regarding SQLstatements that can be executed on the EMP_DETAIL table? (Choose two.)

A. AnEMP_IMAGE column can be included in the GROUP BY clause.

B. An EMP_IMAGE column cannot be included in the ORDER BY clause.

C. You cannot add a new column to the table with LONG as the datatype.

D. Youcan alter the table to include the NOT NULL constraint on the EMP_IMAGE column.

Long列不能groupby,order by;每表只有一long列;不能设置为not null;

22

You needto create a table for a banking application. One of the columns in the tablehas the following requirements:你需要创建一个表给银行应用。表中某列有以下要求:

1) Youwant a column in the table to store the duration of the credit period.你想一列存储贷款期限的时间

2) Thedata in the column should be stored in a format such that it can be easilyadded and subtracted with DATE data type without using conversion functions.列的数据应该存储在这样的格式(容易添加和扣除date数据类型;没有使用转换函数)

3) Themaximum period of the credit provision in the application is 30 days.(信用贷款条款最大事件为30天)

4) Theinterest has to be calculated for the number of days an individual has taken acredit for.(利息不得不按照天独立来计算)

Whichdata type would you use for such a column in the table?表中该列数据类型:

A. DATE

B. NUMBER

C. TIMESTAMP

D. INTERVAL DAY TO SECONDinterval day to second

E. INTERVALYEAR TO MONTH

23

Examinethe structure proposed推荐的 for theTRANSACTIONS table:

name         Null      Type

TRANS_ID    NOT NULL  NUMBER(6)

CUST_NAME   NOT NULL  VARCHAR2(20)

CUST_STATUS NOT NULL  CHAR

TRANS_DATE  NOT NULL  DATE

TRANS_VALIDITY        VARCHAR2

CUST_CREDIT_LIMIT     NUMBER

Whichstatements are trueregarding the creation and storage of data in the above table structure?(Choose all that apply.)哪个语句是正确的,关于上述表结构的数据创建和存储方面:

A. The CUST_STATUS column would give anerror.

B. The TRANS_VALIDITY column would give an error.

C. The CUST_STATUS column would store exactly one character.

D. TheCUST_CREDIT_LIMIT column would not be able to store decimal values.()

E. TheTRANS_VALIDITY column would have a maximum size of one character.

F. TheTRANS_DATE column would be able to store day, month, century, year, hour,minutes, seconds, andfractionsof seconds.X

解释:

B,VARCHAR2类型必须指定最大长度

F,DATE类型,没有fractions of seconds.

Number类型可以存储小数值

24

Examinethe structure proposed for the TRANSACTIONS table:

name         Null       Type

TRANS_ID    NOT NULL   NUMBER(6)

CUST_NAME   NOT NULL   VARCHAR2(20)

CUST_STATUS NOT NULL   VARCHAR2

TRANS_DATE  NOT NULL   DATE

TRANS_VALIDITY         INTERVALDAYTO SECOND

CUST_CREDIT_VALUE      NUMBER(10)

Which two statements are true regarding thestorage of data in the above table structure? (Choose two.)

A. TheTRANS_DATE column would allow storage of dates only in the dd-mon-yyyy format.

B. The CUST_CREDIT_VALUE column would allow storage of positive andnegative integers.该列允许存储正和负数

C. The TRANS_VALIDITY column would allow storage of a time intervalin days, hours, minutes, and seconds.基于时间间隔天,小时,分钟,秒

D. TheCUST_STATUS column would allow storage of data up to the maximum VARCHAR2 sizeof 4,000 characters.

25

You needto create a table with the following column specifications:你需要下面的列要求创建表:

1. EmployeeID (numeric data type) for each employee

2. EmployeeName (character data type) that stores the employee name

3. Hiredate, which stores the date of joining the organization for each employee

4. Status(character data type), that contains the value 'ACTIVE' if no data is entered

5. Resume(character large object [CLOB] data type), which contains the resume submittedby the employee

Which isthe correct syntax to create this table?创建这个表的正确的语法

A.

CREATE TABLE EMP_1

(

emp_id     NUMBER(4),

emp_name   VARCHAR2(25),

start_date DATE,

e_status   VARCHAR2(10)DEFAULT'ACTIVE',

resume     CLOB(200)

);

B.

CREATE TABLE 1_EMP

(

emp_id     NUMBER(4),

emp_name   VARCHAR2(25),

start_date DATE,

emp_status VARCHAR2(10)DEFAULT'ACTIVE',

resume     CLOB

);

C.

CREATE TABLE EMP_1

(

emp_id     NUMBER(4),

emp_name   VARCHAR2(25),

start_date DATE,

emp_status VARCHAR2(10)DEFAULT"ACTIVE",

resume     CLOB

);

D.

CREATETABLE EMP_1

(

emp_id      NUMBER,

emp_name    VARCHAR2(25),

start_date  DATE,

emp_status  VARCHAR2(10) DEFAULT 'ACTIVE',

resume      CLOB

);

解释:

ACLOB不能指定精度

B,表名得以字母开头

Cemp_status列默认值应该为’ACTIVE’,不应该用双引号

26

Which isthe valid CREATE TABLE statement?哪个是正确创建表的语句

A.

CREATETABLE emp9$#(emp_noNUMBER (4));表名9$#是正确的

B.

CREATE TABLE 9emp$#(emp_noNUMBER(4));表名数字开头

C.

CREATE TABLE emp*123(emp_noNUMBER(4));表名带*

D.

CREATE TABLE emp9$#(emp_noNUMBER(4),dateDATE);列名date

解释:

B,表名不允许以数字开头

C,表名中不允许出现特殊符号*

D,date为保留字,不能作为列名。

27

Whichtwo statements are true regarding tables? (Choose two.)关于表哪两个是正确的

A. Atable name can be of any length.表名长度30

B. Atable can have any number of columns.表列数

C. Acolumn that has a DEFAULT value cannot store null values.列有默认值不能存储空值,有问题,可以存储空值

D. Atable and a view can have the same name in the same schema.同架构下表和视图有相同的名字错误

E. A table and a synonym can have the same name in the same schema.相同架构下表名和同义词相同名

F. The same table name can be used indifferent schemas in the same database.同一库下不同架构下可以有相同表名

解释:

E,有问题(luise)

28

Whichtwo statements are true regarding constraints? (Choose two.)关于约束的两个正确的语句

A. Aforeign key cannot contain NULL values.纠正:外键可以包含NULL值

B. A column with the UNIQUE constraint can contain NULL values.unique约束列可以包含NULL

C. Aconstraint is enforced only for the INSERT operation on a table.约束只有在insert操作时被强制

D. A constraint can be disabled even if the constraint columncontains data.即使列包含数据约束也可以被禁用

E. Allconstraints can be defined at the column level as well as the table level.所有的约束可以定义在列级也可以定义在表级

问题理解:哪些约束可以定义在列级,哪些可以定义在表级;

29

Whichtwo statements are true regarding constraints? (Choose two.)关于约束正确的两个语句

A. Aforeign key cannot contain NULL values.

B. The column with a UNIQUE constraintcan store NULLS .

C. Aconstraint is enforced only for an INSERT operation on a table.

D. You can have more than one column in a table as part of a primarykey.一个表的多个列可以被看作一个pk

30

Evaluatethe following CREATE TABLE commands:评估一下创建table的命令

CREATE TABLE orders

(

ord_no NUMBER(2)CONSTRAINT ord_pkPRIMARYKEY,

ord_date DATE, cust_idNUMBER(4)

);

CREATE TABLE ord_items

(

ord_no NUMBER(2),

item_no NUMBER(3),

qty NUMBER(3)CHECK(qtyBETWEEN100 AND200),

expiry_date date CHECK (expiry_date >SYSDATE),

CONSTRAINT it_pkPRIMARYKEY(ord_no,item_no),

CONSTRAINT ord_fkFOREIGNKEY(ord_no)REFERENCES orders(ord_no)

);

Theabove command fails when executed. What could be the reason?上面命令执行的时候失败,什么原因造成的;

A. SYSDATE cannot be usedwith the CHECK constraint.Sysdate不能用在check约束中

B. TheBETWEEN clause cannot be used for the CHECK constraint.

C. TheCHECK constraint cannot be placed on columns having the DATE data type.

D. ORD_NOand ITEM_NO cannot be used as a composite primary key because ORD_NO is alsothe FOREIGN KEY.

31

Evaluatethe following SQL commands:

CREATE SEQUENCE ord_seq

INCREMENT BY 10

START WITH 120

MAXVALUE 9999 NOCYCLE;

CREATE TABLE ord_items

(

ord_no NUMBER(4)DEFAULT ord_seq.NEXTVALNOTNULL,

item_no NUMBER(3),

qty NUMBER(3)CHECK(qtyBETWEEN100 AND200),

expiry_date date CHECK (expiry_date>SYSDATE),

CONSTRAINT it_pkPRIMARYKEY(ord_no,item_no),

CONSTRAINT ord_fkFOREIGNKEY(ord_no)REFERENCES orders(ord_no)

);

Thecommand to create a table fails. Identify the reason for the SQL statementfailure? (Choose all that apply.)这个命令创建表失败,识别sql语句失败的原因

A. You cannot use SYSDATE in the condition of a CHECK constraint.你不能使用sysdatecheck约束条件内

B. Youcannot use the BETWEEN clause in the condition of a CHECK constraint.

C. You cannot use the NEXTVAL sequence value as a DEFAULT value fora column.你不能使用nextval序列值作为一个列的默认值

D. Youcannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD_NOis also the FOREIGN KEY.

32

WhichCREATE TABLE statement is valid?下面哪个创建table语句是正确的

A.

CREATE TABLE ord_details

(

ord_no NUMBER(2)PRIMARYKEY,

item_no NUMBER(3)PRIMARYKEY,

ord_date DATE NOT NULL

);

B.

CREATE TABLE ord_details

(

ord_no NUMBER(2)UNIQUENOTNULL,

item_no NUMBER(3),

ord_date DATE DEFAULT SYSDATE NOTNULL

);

C.

CREATE TABLE ord_details

(

ord_no NUMBER(2),

item_no NUMBER(3),

ord_date DATEDEFAULTNOT NULL,

CONSTRAINT ord_uqUNIQUE(ord_no),

CONSTRAINT ord_pkPRIMARYKEY(ord_no)

);

D.

CREATETABLE ord_details

(

ord_no NUMBER(2),

item_no NUMBER(3),

ord_date DATE DEFAULT SYSDATE NOT NULL,

CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no)

);

A,一个表中只能有一个主键

B,UNIQUE和NOT NULL之前多一个,号

C,指定了DEFAULT,没有指定默认值。

33

33. Youwant to create an ORD_DETAIL table to store details for an order placed havingthe following business requirement:你想创建一个ORD_DETAIL表去存储order的详细信息(有以下业务要求)

1) Theorder ID will be uniqueand cannot havenull values.

2) Theorder date cannothave null valuesand the defaultshould be thecurrentdate.

3) The orderamount should notbe less than 50.

4) Theorder status willhave values eithershippedor not shipped.

5) Theorder payment modeshould be cheque, creditcard, or cash on delivery (COD). Which is the valid DDL statement forcreating the ORD_DETAIL table?

A.

CREATE TABLE ord_details

(

ord_id NUMBER(2)CONSTRAINTord_id_nn NOTNULL,

ord_date DATE DEFAULT SYSDATE NOTNULL,

ord_amount NUMBER(5,2)CONSTRAINT ord_amount_min

CHECK (ord_amount >50),

ord_status VARCHAR2(15)CONSTRAINT ord_status_chk

CHECK (ord_status IN ('Shipped','Not Shipped')),

ord_pay_mode VARCHAR2(15)CONSTRAINT ord_pay_chk

CHECK (ord_pay_mode IN ('Cheque','Credit Card','Cash On Delivery'))

);

B.

CREATE TABLE ord_details

(

ord_id NUMBER(2)CONSTRAINT ord_id_ukUNIQUENOTNULL,

ord_date DATE DEFAULT SYSDATE NOTNULL,

ord_amount NUMBER(5,2)CONSTRAINT ord_amount_min

CHECK (ord_amount >50),

ord_status VARCHAR2(15)CONSTRAINT ord_status_chk

CHECK (ord_status IN ('Shipped','Not Shipped')),

ord_pay_mode VARCHAR2(15)CONSTRAINT ord_pay_chk

CHECK (ord_pay_mode IN

('Cheque','Credit Card','Cash On Delivery'))

);

C.

CREATETABLE ord_details

(

ord_id NUMBER(2) CONSTRAINT ord_id_pkPRIMARY KEY,

ord_date DATE DEFAULT SYSDATE NOT NULL,

ord_amount NUMBER(5, 2) CONSTRAINT ord_amount_min

CHECK (ord_amount >= 50),

ord_status VARCHAR2(15) CONSTRAINT ord_status_chk

CHECK (ord_status IN ('Shipped', 'Not Shipped')),

ord_pay_mode VARCHAR2(15) CONSTRAINT ord_pay_chk

CHECK (ord_pay_mode IN

('Cheque', 'Credit Card', 'Cash On Delivery')));

D.

CREATE TABLE ord_details

(

ord_id NUMBER(2),

ord_date DATE NOT NULL DEFAULTSYSDATE,

ord_amount NUMBER(5,2)CONSTRAINT ord_amount_min

CHECK (ord_amount >= 50),

ord_status VARCHAR2(15)CONSTRAINT ord_status_chk

CHECK (ord_status IN ('Shipped','Not Shipped')),

ord_pay_mode VARCHAR2(15)CONSTRAINT ord_pay_chk

CHECK (ord_pay_mode IN

('Cheque','Credit Card','Cash On Delivery'))

);

Aord_id应该定义主键约束

34

Youcreated an ORDERS table with the following description:你创建一个orders表用下列描述

name       Null     Type

ORD_ID     NOTNULLNUMBER(2)

CUST_ID    NOT NULL NUMBER(3)

ORD_DATE   NOT NULL DATE

ORD_AMOUNT NOT NULL NUMBER (10,2)

You insertedsome rows in the table. After some time, you want to alter the table bycreating the PRIMARY KEY constraint on the ORD_ID column. Which statement istrue in this scenario?

A. Youcannot have two constraints on one column.

B. Youcannot add a primary key constraint if data exists in the column.

C. Theprimary key constraint can be created only at the time of table creation .

D. You can add the primary key constraint even if data exists, providedthat there are no duplicate values.你可以添加一个PK,即使数据存在,只要不存在重复值即可

35

Whichtwo statements are true regarding constraints? (Choose two.)关于约束正确的两句:

A. Atable can have only one primary key and one foreign key.

B. A table can have only one primary key but multiple foreign keys一个表只能都有一个主键但可以有多个外键.

C. Only the primary key can be defined at thecolumn and table levels.

D. Theforeign key and parent table primary key must have the same name.

E. Both primary key and foreign key constraints can be defined atboth column and table levels.主键和外键约束可以定义在列级和表级

36

Examine thefollowing SQL commands:

CREATE TABLE products

(

prod_id NUMBER(3)CONSTRAINT p_ckCHECK(prod_id>0),

prod_name CHAR(30),

prod_qty NUMBER(6),

CONSTRAINT p_nameNOT NULL,

CONSTRAINT prod_pkPRIMARYKEY(prod_id)

);

CREATE TABLE warehouse

(

warehouse_id NUMBER(4),

roomno NUMBER(10)CONSTRAINT r_id

CHECK(roomnoBETWEEN101 AND200),

location VARCHAR2(25),

prod_id NUMBER(3),

CONSTRAINT wr_pr_pkPRIMARYKEY(warehouse_id,prod_id),

CONSTRAINT prod_fkFOREIGNKEY(prod_id)

REFERENCES products(prod_id)

);

A. Bothcommands execute successfully.

B. The first CREATE TABLE command generates an error because theNULL constraint is not valid.第一个命令产生一个错误因为null约束是不正确的。

C. Thesecond CREATE TABLE command generates an error because the CHECK constraint isnot valid.

D. Thefirst CREATE TABLE  command generates anerror because CHECK and  PRIMARY KEYconstraints cannot be used for the same column.

E. Thefirst CREATE TABLE command generates an error because the column PROD_ID cannotbe used in the PRIMARY KEY and FOREIGN KEY constraints.

37

Youissued the following command to drop the PRODUCTS table:你发起下列的命令去drop product表

DROPTABLE products;

What isthe implication of this command? (Choose all that apply.)

A. All data along with the table structure is deleted.所有数据和表结构都删除

B. The pending transaction in the session is committed.会话中的事务是提交的

C. Allindexes on the table will remain but they are invalidated.

D. All views and synonyms will remain but they are invalidated.

E. All data in the table are       deleted but the table structure will remain.

解释:droptable时,索引被删除了,但视图和同义词仍在。

38

Whichtwo statements are true regarding views? (Choose two.)关于视图哪两个语句是正确的

A. Asimple view in which column aliases have been used cannot be updated.

B. Rows cannot be deleted through a view if the view definitioncontains the DISTINCT keyword.如果视图定义中包含distinct关键字,不能通过视图删除行

C. Rowsadded through a view are deleted from the table automatically when the view isdropped.当视图删除的时候通过视图添加的行自动从表中删除X

D. The OR REPLACE option is used to change the definition of anexisting view without dropping and re-creating it.   OR replace选项用于去改变一个已存在视图没有drop和重建它

E. TheWITH CHECK OPTION constraint can be used in a view definition to restrict thecolumns displayed through the view.

39

Evaluatethe following command:评估以下命令

CREATE TABLE employees

(

employee_id   NUMBER(2)PRIMARYKEY,

last_name VARCHAR2(25)NOTNULL,

department_id NUMBER(2)NOTNULL,

job_id    VARCHAR2(8),

salary    NUMBER(10,2)

);

Youissue the following command to create a view that displays the IDs and lastnames of the sales staff in the organization:你发起以下命令去创建一个视图,显示IDs和组织中的销售员工的lastname

CREATE OR REPLACE VIEW sales_staff_vuAS

SELECT employee_id, last_name,job_id

FROM employees

WHERE job_id LIKE 'SA_%'WITHCHECKOPTION;

Whichtwo statements are true regarding the above view? (Choose two.)关于上面视图正确的是:

A. Itallows you to insert rows into the EMPLOYEES table .

B. It allows you to delete details of the existing sales staff fromthe EMPLOYEES table.它允许你去从employees表中删除已存在的销售员工的详细信息

C. Itallows you to update job IDs of the existing sales staff to any other job ID inthe EMPLOYEES table. 用check选项不能

D.It allows you to insert IDs, last names, and job IDs of the sales staff fromthe view if it is used in multitable INSERT statements(关于多表插入)

A,视图基表中有列未出现在视图中,且它具有NOT NULL约束。所以不能插入行

C,因为具有WITH CHECK OPTION

D,关于多表插入

INSERT  ALL

INTO sal_historyVALUES(EMPID,HIREDATE,SAL)

INTO mgr_historyVALUES(EMPID,MGR,SAL)

SELECT employee_id EMPID, hire_date HIREDATE,

salary SAL, manager_id MGR

FROM  employees

WHERE employee_id>200;

40

View theExhibit to examine the description for the SALES and PRODUCTS tables. You wantto create a SALE_PROD view by executing the following SQL statement: 查看sales和products表的描述;你通过执行以下语句想创建一个sale_prod视图

CREATE VIEW sale_prod

AS SELECT p.prod_id, cust_id,SUM(quantity_sold)"Quantity",

SUM(prod_list_price)"Price"

FROM products p, sales s

WHERE p.prod_id=s.prod_id

GROUP BY p.prod_id, cust_id;

Whichstatement is true regarding the execution of the above statement?

A. Theview will be created and you can perform DML operations on the view.

B. The view will be created but no DML operations will be allowed onthe view.视图将被创建,但没有DML操作将被允许在这个视图上。

C. Theview will not be created because the join statements are not allowed forcreating a view.

D. Theview will not be created because the GROUP BY clause is not allowed forcreating a view.

41

Whichtwo statements are true regarding views? (Choose two.)关于视图描述正确的两句

A. A subquerythat defines a view cannot include the GROUP BY clause.

B. A viewthat is created with the subquery having the DISTINCT keyword can be updated. X

C. A view that is created with the subquery having the pseudo columnROWNUM keyword cannot be updated.用子查询创建的视图有一个伪列ROWNUM关键字,该视图不能被更新

D. A data manipulation language (DML) operation can be performed on a view that is created with the subqueryhaving all the NOT NULL columns of a table. DML操作可以被执行在视图(用子查询,一个表的所有列都是not null创建的视图)

A子查询定义视图时可包括group by条件

B一个视图被创建时使用的子查询有distinct关键字不可以被更新

42

Whichthree statements are true regarding views? (Choose three.)关于视图描述正确的3个语句

A. Viewscan be created only from tables.

B. Views can be created from tables or other views.视图可以从其他视图或表来创建

C. Only simpleviews can use indexes existing on the underlying tables.

D. Both simple and complex views can use indexes existing on theunderlying tables.不论是简单的还是复杂的视图都可以使用存在基础表的索引

E. Complexviews can be created only on multiple tables that exist in the same schema.

F. Complex views can be created on multiple tables that exist in thesame or different schemas.复杂视图可以创建在多个表上(存在相同或不同架构上)

43

Evaluatethe following CREATE SEQUENCE statement:评估创建sequence语句

CREATE SEQUENCE seq1

START WITH 100

INCREMENT BY 10

MAXVALUE 200 CYCLE NOCACHE;

The SEQ1sequence has generated numbers up to the maximum limit of 200. You issue thefollowing SQL statement: SELECT seq1.nextval FROM dual;SEQ1序列已产生,数值上限为200.你发起下列sql语句:  select seq1.nextval from dual;

What isdisplayed by the SELECT statement? 这个select语句将显示什么?

A. 1

B. 10

C. 100

D. an error

原因:指cycle选项后,如果达到了该序列的最大值(maxvalue),则会从它的最小值(minvalue)开始,产生下一个值。注意,不是从startwith开始。如果没指定minvalues,则相当于指定nominvalue选项,则minvalue的值为1

44

View theExhibit and examine the structure of the ORD table.

Evaluatethe following SQL statements that are executed in a user session in thespecified order:评估下面的sql语句(在一个用户会话中按照特定次序执行)

CREATE SEQUENCE ord_seq;

SELECT ord_seq.nextvalFROM dual;

INSERT INTO ord

VALUES (ord_seq.CURRVAL,'25-jan-2007',101);

UPDATE ord

SET ord_no= ord_seq.NEXTVALWHERE cust_id =101;

Whatwould be the outcome of the above statements?上面的语句的输出:

A. All the statements would execute successfully andthe ORD_NO column would contain the value 2 for the CUST_ID 101.所有语句将执行成功,ord_no列将包含2 cust_id=101

B. TheCREATE SEQUENCE command would not execute because the minimum value and maximumvalue for the sequence have not been specified.

C. TheCREATE SEQUENCE command would not execute because the starting value of thesequence and the increment value have not been specified.

D. Allthe statements would execute successfully and the ORD_NO column would have thevalue 20 for the CUST_ID 101 because the default CACHE value is 20.

45

45. Whichtwo statements are true about sequences created in a single instance database?(Choose two.)创建在单实例数据库上的序列描述正确的两条语句

A. Thenumbers generated by a sequence can be used only for one table.被一个序列产生的数值只能被应用在一个表X

B. DELETE<sequencename> would remove a sequence from the database.删除序列DROP SEQUENCE seq_newsId

C. CURRVAL is used to refer to the last sequence number that hasbeen generated. CURRVAL用于查阅最后生成的序列号

D. When the MAXVALUE limit for a sequence is reached, you canincrease the MAXVALUE limit by using the ALTER SEQUENCE statement.maxvalue限制达到,你可以使用alter sequence语句来增加maxvalue

E. Whena database instance shuts down abnormally, the sequence numbers that have beencached but not used would be available once again when the database instance isrestarted.当数据库实例异常关闭,序列号已经被cache还未使用的,当数据库实例重启后,能继续使用X。

46

Whichstatements are correct regarding indexes? (Choose all that apply.)关于索引正确的是:

A. When a table is dropped, the corresponding indexes areautomatically dropped.当表drop时,对应的索引也自动dropped

B. AFOREIGN KEY constraint on a column in a table automatically creates a nonuniqueindex.一个列上的外键约束自动创建一个非唯一索引 X

C. A nondeferrable PRIMARY KEY or UNIQUE KEY constraint in a tableautomatically creates a unique index.表中的非延迟的PK或唯一键约束自动创建一个唯一索引。

D. For each data manipulation language (DML) operation performed, thecorresponding indexes are automatically updated.每一个DML操作执行时,对应的索引自动更新。

47

View theExhibit and examine the structure of ORD and ORD_ITEMS tables.

The ORD_NO column is PRIMARY KEY in the ORDtable and the ORD_NO and ITEM_NO columns are composite PRIMARY KEY in the ORD_ITEMS table.查看ord和ord_items表的结构。 Ord_no列在ord表中是PK。Ord_no和item_no列在ord_items表中是复合型PK

Whichtwo CREATE INDEX statements are valid? (Choose two.)哪两个创建索引的语句是正确的?

A.

CREATE INDEX ord_idx1 ON ord(ord_no);

B.

CREATEINDEX ord_idx2ON ord_items(ord_no);

C.

CREATEINDEX ord_idx3ON ord_items(item_no);

D.

CREATE INDEX ord_idx4 ON ord,ord_items(ord_no, ord_date,qty);

解释:

A,不能在主键列上再次创建索引

D,索引不能同时建立在2个表上

48

Whichtwo statements are true regarding indexes? (Choose two.)关于索引描述正确的两个:

A. They can be created on tables and clusters.可以创建在表和clusters

B Theycan be created on tables and simple views.他们可以创建在表和简单视图上X

C. Youcan create only one index by using the same columns.

D. You can create more than one index by using the same columns ifyou specify distinctly different combinations of the columns.如果你指定明确的不同的列组合,你可以使用相同列创建多个索引

49

TheORDERS table belongs to the user OE. OE has granted the SELECT privilege on theORDERS table to the user HR. orders表由用户OE拥有,OE授权select权限给HR。

Whichstatement would create a synonym ORD so that HR can execute the following querysuccessfully? 哪个语句创建一个ORD的同义词,因此HR可以成功执行下面的查询select * from ord;  。

SELECT * FROM ord;

A. This command is issued by OE.

CREATE SYNONYM ord FOR orders;

B. This command is issued by OE.

CREATE PUBLIC SYNONYM ordFOR orders;

C. This command is issued by the database administrator.

CREATE SYNONYM ord FOR oe.orders;

D. This command is issued by the database administrator.

CREATEPUBLIC  SYNONYM  ord  FOR  oe.orders;

50

SLS is aprivate synonym for the SH.SALES table. The user SH issues the followingcommand: DROP SYNONYM sls; SLS是一个专用的同义词给SH.SALES表。用户SH发起下列命令;drop synonym sls;

Whichstatement is true regarding the above SQL statement?关于这个语句正确的描述

A. Only the synonym would be dropped.只有同义词被dropped

B. Thesynonym would be dropped and the corresponding table would become invalid.

C. Thesynonym would be dropped and the packages referring to the synonym would bedropped.

D. Thesynonym would be dropped and any PUBLIC synonym with the same name becomesinvalid.

51

51. Whichstatement is true regarding synonyms?关于同义词描述正确的是:

A. Synonymscan be created only for a table.只能为表创建同义词X

B. Synonymsare used to reference only those tables that are owned by another user.同义词只可以用于管理别人拥有的表X

C. A public synonym and a private synonym can exist with the samename for the same table.相同的表可以有相同名字的一个公共的同义词和一个专用的同义词

D. TheDROP SYNONYM statement removes the synonym, and the table on which the synonymhas been created becomes invalid. Drop synonym语句删除了同义词,关联的表也变得无效X。

52

View theExhibit and examine the structure of the PRODUCTS table.查看products表结构

Usingthe PRODUCTS table, you issue the following query to generate the names,current list price, and discounted list price for all those products whose listprice falls below $10 after a discount of 25% is applied on it.使用products表,你发起以下查询去产生names,当前公开列价,贴现价(在折扣25%之后,下降10美元),

SELECT prod_name, prod_list_price,

prod_list_price - (prod_list_price *.25)"DISCOUNTED_PRICE"

FROM products

WHERE discounted_price<10;

Thequery generates an error. What is the reason for the error?查询产生一个错误。什么原因生成的。

A. Theparenthesis should be added to enclose the entire expression.

B. Thedouble quotation marks should be removed from the column alias.

C. The column alias should be replaced with the expression in the WHEREclause.列别名不能应用在where条件中;

D. The column alias should be put in uppercaseand enclosed with in double quotation marks in the WHERE clause.

注释:Where子句中不能使用列别名

53

View the Exhibit and examine the data in thePROMOTIONS table. 观察promotions表的数据。PROMO_BEGIN_DATE is stored in thedefault date format,dd-mon-rr.

You need to produce a report that provides the name, cost, and start date of all promos inthe POST category that were launched before January 1, 2000.你需要生成报告提供name,cost,开始时间(2000年1月1日之前)

Which SQL statement would you use?

A.

SELECT promo_name, promo_cost, promo_begin_dateFROM promotions

WHERE promo_category='post'AND promo_begin_date<'01-01-00';

B.

SELECT promo_name, promo_cost, promo_begin_dateFROM promotions

WHERE promo_costLIKE'post%'AND promo_begin_date<'01-01-2000';

C.

SELECT promo_name, promo_cost, promo_begin_dateFROM promotions

WHERE promo_categoryLIKE'P%'AND promo_begin_date<'1-JANUARY-00';

D.

SELECT promo_name, promo_cost, promo_begin_dateFROM promotions

WHERE promo_categoryLIKE '%post%'AND promo_begin_date < '1-JAN-00';

注意日期比较

54

View theExhibit and examine the structure of the CUSTOMERS table. Evaluate the querystatement:查看customers表的结构。评估查询语句。

SELECT cust_last_name, cust_city, cust_credit_limit

FROM customers

WHERE cust_last_nameBETWEEN'A' AND'C'

AND cust_credit_limitBETWEEN1000 AND3000;

Whatwould be the outcome of the above statement?上面语句的输出

A. It executes successfully.

B. Itproduces an error because the condition on CUST_LAST_NAME is invalid.

C. Itexecutes successfully only if the CUST_CREDIT_LIMIT column does not contain anynull values.

D. Itproduces an error because the       ANDoperator cannot be used to combine multiple BETWEEN clauses.

55

Evaluatethe following two queries:评估下面两个查询

SELECT cust_last_name, cust_city

FROM customers

WHERE cust_credit_limitIN(1000,2000,3000);

SELECT cust_last_name, cust_city

FROM customers

WHERE cust_credit_limit=1000OR cust_credit_limit=2000

OR cust_credit_limit=3000;

Which statementis true regarding the above two queries?关于上面两个查询正确的是:

A. Performancewould improve in query 2.

B. Performancewould degrade in query 2.

C. There would be no change in performance.

D. Performancewould improve in query 2 only if there are null values in the CUST_CREDIT_LIMITcolumn.

56

View theExhibit and examine the structure of the PROMOTIONS table.

Usingthe PROMOTIONS table, you need to find out the names and cost of all the promosdone on 'TV' and 'internet' that ended in the time interval 15th March '00 to15th October '00.使用promotions表,你需要发现所有的promos的名字和成本(TV,INTERNET;结束时间为15th march ‘00’ 到15th October ‘00’)

Whichtwo queries would give the required result? (Choose two.)哪两个查询可以给出所需要的结果

A.

SELECT promo_name, promo_cost

FROM promotions

WHERE promo_categoryIN ('TV', 'internet')

AND promo_end_dateBETWEEN '15-MAR-00'AND '15-OCT-00';

B.

SELECT promo_name, promo_cost

FROM promotions

WHERE promo_category='TV'OR promo_category='internet'

AND promo_end_date>='15-MAR-00'

OR promo_end_date<='15-OCT-00';

C.

SELECT promo_name, promo_cost

FROM promotions

WHERE(promo_categoryBETWEEN'TV' AND'internet')

AND (promo_end_date IN ('15-MAR-00','15-OCT-00'));

D.

SELECT promo_name,  promo_costFROM promotions

WHERE(promo_category= 'TV' OR promo_category='internet')

AND(promo_end_date>='15-MAR-00' AND promo_end_date<='15-OCT-00');

57

TheCUSTOMERS table has the following structure:

name            Null       Type

CUST_ID         NOT NULL    NUMBER

CUST_FIRST_NAME NOT NULL    VARCHAR2(20)

CUST_LAST_NAME  NOT NULL    VARCHAR2(30)

CUST_INCOME_LEVEL            VARCHAR2(30)

CUST_CREDIT_LIMIT            NUMBER

You needto write a query that       does thefollowing tasks:你需要写一个查询(做以下任务)

1. Displaythe first name and tax amount of the customers. Tax is 5% of their creditlimit.显示firstname和税金。税金按照credit limit的5%

2. Onlythose customers whose income level has a value should be considered.只有那些收入级别有一个值的可以考虑

3. Customerswhose tax amount is null should not be considered.顾客税金为null的不考虑

Whichstatement accomplishes all the required tasks?哪个语句可以完全以上要求:

A.

SELECT cust_first_name,cust_credit_limit*.05AS TAX_AMOUNT

FROM customers

WHERE cust_income_levelISNOT NULL AND tax_amount ISNOT NULL;

B.

SELECT cust_first_name, cust_credit_limit* .05AS TAX_AMOUNT

FROM customers

WHERE cust_income_levelIS NOT NULL ANDcust_credit_limitIS NOT NULL;

C.

SELECT cust_first_name, cust_credit_limit*.05AS TAX_AMOUNT

FROM customers

WHERE cust_income_level<>NULL ANDtax_amount <>NULL;

D.

SELECT cust_first_name, cust_credit_limit*.05AS TAX_AMOUNT

FROM customers

WHERE (cust_income_level,tax_amount)ISNOT NULL;

58

ThePART_CODE column in the SPARES table contains the following list of values:spares表中的part_code列包含下列值:

PART_CODE

A%_WQ123

A%BWQ123

AB_WQ123

Evaluatethe following query:评估下列查询

SELECT part_code

FROM spares

WHERE part_code LIKE '%\%_WQ12%'ESCAPE'\';

Whichstatement is true regarding the outcome of the above query?

A. Itproduces an error.

B. Itdisplays all values.

C. Itdisplays only the values A%_WQ123 and AB_WQ123 .

D. It displays only the values A%_WQ123 and A%BWQ123 .

E. Itdisplays only the values A%BWQ123 and AB_WQ123.

59

View theExhibit and examine the data in the PRODUCTS table.

You needto display product names from the PRODUCTS table that belong to the'Software/Other ' category       withminimum prices as either $2000 or $4000 and no unit of measure. You issue thefollowing query:你需要显示products表中的product name(属于software/other类;最小价格是2000或4000;无单元度量)

SELECT prod_name, prod_category, prod_min_price

FROM products

WHERE prod_categoryLIKE'%Other%'

AND (prod_min_price =2000OR prod_min_price=4000)

AND prod_unit_of_measure <>'';

whichstatement is true regarding the above query?关于以上查询正确的语句是

A. It executes successfully but returns no result.

B. Itexecutes successfully and returns the required result.

C. It generates an error because the conditionspecified for PROD_UNIT_OF_MEASURE is not valid.

D. It generates an error because the conditionspecified for the PROD_CATEGORY column is not valid.

60

View theExhibit and examine the structure of CUSTOMERS table. Evaluate the followingquery:评估下列查询

SELECT cust_id, cust_cityFROM customers

WHERE cust_first_nameNOTLIKE'A_%g_%'

AND cust_credit_limitBETWEEN5000 AND15000

AND cust_credit_limitNOTIN (7000,11000)

AND cust_city NOT BETWEEN'A'AND'B';

Whichstatement is true regarding the above query?

A. It executes successfully.

B. Itproduces an error because the condition on the CUST_CITY column is not valid.

C. Itproduces an error because the condition on the CUST_FIRST_NAME column is notvalid.

D. Itproduces an error because conditions on the CUST_CREDIT_LIMIT column are notvalid.

61

View theExhibit and examine the structure of the PROMOTIONS table.

You needto generate a report of all promos from the PROMOTIONS table based on thefollowing conditions: 你需要产生一个报告(所有promos,基于以下条件的)

1. Thepromo name should not begin with 'T' or 'N'. 名字不应以T或N开头

2. Thepromo should cost more than $20000. Cost > 20000

3. Thepromo should have ended after 1st January 2001.  2001,1,1之后结束

Which WHERE clause would give therequired result?

A.

WHERE promo_nameNOTLIKE'T%'OR promo_nameNOTLIKE'N%'

AND promo_cost > 20000AND promo_end_date>'1-JAN-01'

B.

WHERE (promo_name NOT LIKE 'T%' AND promo_nameNOTLIKE'N%')

OR promo_cost > 20000OR promo_end_date>'1-JAN-01'

C.

WHERE promo_nameNOT LIKE 'T%'AND promo_name NOT LIKE 'N%'

AND promo_cost> 20000AND promo_end_date > '1-JAN-01'

D.

WHERE (promo_name NOT LIKE '%T%' OR promo_nameNOTLIKE'%N%')

AND(promo_cost>20000AND promo_end_date>'1-JAN-01')

62

View theExhibit and examine the structure of the CUSTOMERS table.

You wantto generate a report showing the last names andcredit limits of all customers whoselast names start with A, B,or C, and credit limitis below 10, 000.

Evaluatethe following two queries:

SELECT cust_last_name, cust_credit_limitFROM customers

WHERE (UPPER(cust_last_name)LIKE'A%'

OR UPPER(cust_last_name)LIKE'B%'

OR UPPER(cust_last_name)LIKE'C%')

AND cust_credit_limit<10000;

SELECT cust_last_name, cust_credit_limitFROM customers

WHERE UPPER(cust_last_name)BETWEEN'A'AND'C'

AND cust_credit_limit<10000;

Whichstatement is true regarding the execution of the above queries?

A. Only the first query givesthe correct result.

B. Onlythe second query gives the correct result.

C. Bothexecute successfully and give the same result.

D. Bothexecute successfully but do not give the required result.

63(Luise)

View theExhibit and examine the structure of the PRODUCTS table.

You wantto display only thoseproduct names with their list prices where the list price isat least double the minimumprice. The report should start with theproduct name having the maximum list price satisfying thiscondition.

Evaluatethe following SQL statement:

SELECT prod_name,prod_list_price

FROM products

WHERE prod_list_price>=2* prod_min_price

WhichORDER BY clauses can be added to the above SQL statement to get the correctoutput? (Choose all that apply.)哪一个order by条件可以添加到上面的sql语句来得到正确输出。

A. ORDER BY prod_list_price DESC, prod_name;

B. ORDER BY (2*prod_min_price)DESC, prod_name;

C. ORDER BY prod_name,(2*prod_min_price)DESC;

D. ORDER BY prod_name DESC, prod_list_priceDESC;

E. ORDER BY prod_list_price DESC, prod_nameDESC;

64

View the Exhibit and examine the data in thePROMO_CATEGORY and PROMO_COST columns of the PROMOTIONS table.

Evaluatethe following two queries:

SELECT DISTINCT promo_category, to_char(promo_cost)"code"

FROM promotions ORDER BYcode;

SELECT DISTINCT promo_category, promo_cost "code"

FROM promotions ORDER BY1;

Whichstatement is true regarding the execution of the above queries?关于上面语句正确的是:

A. Only thefirst query executes successfully.

B. Only the second query executes successfully.

C. Bothqueries execute successfully but give different results.

D. Both queries execute successfully and givethe same result.

解释:

A,列的别名加了引号,order by中别名也必须加引号

65

View theExhibit and examine the structure of the CUSTOMERS table.

You havebeen asked to produce a report on the CUSTOMERS table showing the customersdetails sorted in descending order of the city and in the descending order oftheir income level in each city. Which query would accomplish this task?你被请求去声称一个customers表的报告(按照城市降序和每个城市收入降序来显示顾客的详细信息)哪个查询能够完成这个任务

A.

SELECT cust_city, cust_income_level, cust_last_name

FROM customers

ORDERBY cust_citydesc, cust_income_level DESC ;

B.

SELECT cust_city, cust_income_level, cust_last_name

FROM customers

ORDER BY cust_income_level desc, cust_cityDESC;

C.

SELECT cust_city, cust_income_level, cust_last_name

FROM customers

ORDER BY (cust_city, cust_income_level)DESC;

D.

SELECT cust_city, cust_income_level, cust_last_name

FROM customers

ORDER BY cust_city, cust_income_levelDESC;

66

View theExhibit and examine the data in the COSTS table.

You needto generate a report that displays the IDs of all products in the COSTS tablewhose unit price isatleast 25% more than the unit cost. The details should be displayed inthe descending order of 25% of the unit cost.你需要产生一个报告显示IDS(单价>=unitcost*1.25;)按照unitcost25%的降序来显示

Youissue the following query:

SELECT prod_id FROM costs

WHERE unit_price>= unit_cost*1.25

ORDER BY unit_cost * 0.25 DESC;

Whichstatement is true regarding the above query?

A. It executes and producesthe required result.

B. Itproduces an error because an expression cannot be used in the ORDER BY clause.

C. Itproduces an error because the DESC option cannot be used with an expression inthe ORDER BY clause.

D. Itproduces an error because the expression in the ORDER BY clause should also bespecified in the SELECT clause.

67

Whichtwo statements are true regarding the ORDER BY clause? (Choose two.)关于order by条件正确的两句:

A. It isexecuted first in the query execution. 在查询执行中它首先执行X

B. It must be the last clause in the SELECT statement.必须放置在select语句的最后

C. Itcannot be used in a SELECT statement containin g a HAVING clause.它不能使用一个包含having条件的select语句X

D. Youcannot specify a column name followed by an expression in this clause.

E. You can specify a combination of numeric positions and columnnames in this clause.你可以指定一个数字位置和列名的组合在一个条件中

68(Luise)

Whichstatement is true regarding the default behavior of the ORDER BY clause?关于order by条件默认行为是

A. In a character sort,       thevalues are case-sensitive在一个字符排序中值区分大小写.

B. NULLvalues are not considered at all by the sort operation.在所有排序中null值不被考虑X

C. Onlythose columns that are specified in the SELECT list can be used in the ORDER BYclause.

D. Numericvalues are displayed from the maximum to the minimum value if they have decimalpositions.

69

You needto generate a list of all customer last names with their credit limits from theCUSTOMERS table. Those customers who do not have a credit limit should appearlast in the list.你需要生成一个所有客户lastnames和他们的credit limits;没有credit limit的客户显示在列表最后

Whichtwo queries would achieve the required result? (Choose two.)

A.

SELECT cust_last_name, cust_credit_limit

FROM customers ORDER BY cust_credit_limitDESC;

B.

SELECT cust_last_name, cust_credit_limit

FROM customersORDERBY cust_credit_limit;

C.

SELECT cust_last_name, cust_credit_limit

FROM customersORDERBY cust_credit_limit NULLSLAST;

D.

SELECT cust_last_name, cust_credit_limit

FROM customers ORDER BY cust_last_name, cust_credit_limit NULLSLAST;

70(Luise)

View theExhibit and examine the structure of the PRODUCTS table.

You wantto display only thoseproduct names withtheirlist prices where the list price is at least double the minimum price. The reportshould start with the product name having themaximum list price satisfying this condition.

Evaluatethe following SQL statement:

SELECT prod_name, prod_list_price

FROM products

WHERE prod_list_price>=2* prod_min_price

WhichORDER BY clauses can be added to the above SQL statement to get the correctoutput? (Choose all that apply.)哪个order by条件可以添加到上面的sql语句去得到正确的结果

A. ORDER BY prod_list_priceDESC, prod_name;

B. ORDER BY (2*prod_min_price)DESC, prod_name;

C. ORDER BY prod_name,(2*prod_min_price)DESC;

D. ORDER BY prod_name DESC, prod_list_priceDESC;

E. ORDER BY prod_list_priceDESC, prod_nameDESC;

71

Whicharithmetic operations can be performed on a column by using a SQL function thatis built into Oracle database ? (Choose three .)哪个算术运算可以在一个列上执行(使用一个sql函数,数据库固化函数)

A. addition加法

B. subtraction减法

C. raising to a power乘法

D. findingthe quotient商

E. finding the lowest value求最小值

A,加法

C,乘方(POWER)

72

Whichtasks can be performed using SQL functions built into Oracle Database ? (Choosethree.)使用oracle固化sql函数可以执行哪些任务?

A. displaying a date in a nondefault format显示一个非默认格式的日期

B. finding the number of characters in an expression 找出一个表达式中字符数量

C. substituting a character string in a text expression with aspecified string用一个特定的字符串替换一个文本表达式中的字符

D. combiningmore than two columns or expressions into a single column in the output在一个输出中将多个列或表达式组合成一个单列X

73(Luise)

Whichtasks can be performed using SQL functions that are built into Oracle database? (Choose three .)

A. finding the remainder of a division发现除法的余数

B. addinga number to a date for a resultant date value

C. comparing two expressions to check whether they are equal比较两个表达式检查是否相等

D. checking whether a specified character exists in a given string检查在一个字符串中是否包含一个特定的字符

E. removingtrailing, leading, and embedded characters from a character string从一个字符串中删除头、尾和嵌入式字符

74

Whichstatements are true regarding single row functions? (Choose all that apply.)关于单行函数正确的是

A. MOD:returns the quotient of a division 取余函数

B. TRUNCcan be used with NUMBER and DATE values可以用于数字和日期值

C. CONCAT:can be used to combine any number of values将字符串连接在一起

D. SYSDATEreturns the database server current date and time返回数据库服务器当前日期和时间

E. INSTR:can be used to find only the first occurrenceof a character in a string

F. TRIM:can be used to remove all the occurrences of acharacter from a string

instr函数返回要截取的字符串在源字符串中的位置

Oracle TRIM函数最简单的功能就是用来删除给定字符串或者给定数字中的头部或者尾部的给定字符。

75

Thefollowing data exists in the PRODUCTS table:

PROD_ID PROD_LIST_PRICE

123456  152525.99

Youissue the following query:

SELECT RPAD(( ROUND(prod_list_price)),10,'*')

FROM products WHERE prod_id =123456;

Whatwould be the outcome?

A. 152526 ****

B.**152525.99

C.152525** **

D. anerror message

rpad函数从右边对字符串使用指定的字符进行填充   
rpad(string,padded_length,[pad_string])   
string 表示:被填充的字符串   
padded_length 表示:字符的长度,是返回的字符串的数量,如果这个数量比原字符串的长度要短,rpad函数将会把字符串截取成从左到右的n个字符;   
pad_string 是个可选参数,这个字符串是要粘贴到string的右边,如果这个参数未写,lpad函数将会在string的右边粘贴空格。   
例如:   
rpad('tech', 7); 将返回'tech '   
rpad('tech', 2); 将返回'te'   
rpad('tech', 8, '0'); 将返回'tech0000'   
rpad('tech on the net', 15, 'z'); 将返回 'tech on the net'   
rpad('tech on the net', 16, 'z'); 将返回 'tech on the netz'

SQL> select rpad('aa',5)||decode('bbb',null,' ',rpad('bbb',8))||rpad('cccc',12) from dual;
 
RPAD('AA',5)||DECODE('BBB',NUL
------------------------------
aa   bbb     cccc

substr(字符串,截取开始位置,截取长度) //返回截取的字

substr('Hello World',0,1) //返回结果为 'H'  *从字符串第一个字符开始截取长度为1的字符串

substr('Hello World',1,1) //返回结果为 'H'  *01都是表示截取的开始位置为第一个字符

substr('Hello World',2,4) //返回结果为 'ello'

substr('Hello World',-3,3)//返回结果为 'rld' *负数(-i)表示截取的开始位置为字符串右端向左数第i个字符

测试:

select substr('Hello World',-3,3) value from dual;

附:javasubstring(index1,index2)的简单用法

作用:从字符串索引(下标)index1的字符开始截取长度为index2-index1的字符串。

String str="Hello World";

System.out.println(str.substring(0,5));

打印结果为:Hello

76

You needto display the first names of all customers from the CUSTOMERS table thatcontain the character 'e' and have the character 'a' in the second lastposition.你需要显示firstnames,包含e字符,a在倒数第2个位置

Whichquery would give the required output?

A.

SELECT cust_first_nameFROM customers

WHEREINSTR(cust_first_name, 'e') <>0

ANDSUBSTR(cust_first_name, -2, 1) ='a';

B.

SELECT cust_first_nameFROM customers

WHERE INSTR(cust_first_name,'e')<>''

AND SUBSTR(cust_first_name,-2,1)='a';

C.

SELECT cust_first_nameFROM customers

WHERE INSTR(cust_first_name,'e')ISNOTNULL

AND SUBSTR(cust_first_name,1,-2)='a';

D.

SELECT cust_first_nameFROM customers

WHERE INSTR(cust_first_name,'e')<>0

AND SUBSTR(cust_first_name,LENGTH(cust_first_name),-2)='a';

77

In the CUSTOMERStable, the CUST_CITY column contains the value 'Paris' for the CUST_FIRST_NAME 'ABIGAIL'.

Evaluatethe following query:

SELECT INITCAP(cust_first_name || ‘ ‘ ||

UPPER(SUBSTR(cust_city, -LENGTH(cust_city),2)))

FROM customers

WHERE cust_first_name='ABIGAIL';

Whatwould be the outcome?

A. AbigailPA

B. Abigail Pa

C. AbigailIS

D. anerror message

Upper—每个单词都转换成大写

Substr(string1,开始位置,长度)

Initcap—每个单词首写字母大写,其他小写

78

Evaluatethe following query:

SELECT TRUNC(ROUND(156.00,-1),-1)FROM DUAL;

Whatwould be the outcome?

A. 16

B. 100

C. 160

D. 200

E. 150

79

View theExhibit and examine the structure of the CUSTOMERS table.

In theCUSTOMERS table, the CUST_LAST_NAMEcolumn contains the values'Anderson'and'Ausson'. Youissue the following query:

SELECT LOWER(REPLACE(TRIM('son'FROM cust_last_name),'An','O'))

FROM CUSTOMERS

WHERE LOWER(cust_last_name)LIKE'a%n';

Whatwould be the outcome?

A. 'Oder'and 'Aus'

B. an error because the TRIM function specified is not valid

C. anerror because the LOWER function specified is not valid

D. an error because the REPLACE functionspecified is not valid

解释:TRIM函数的第一个参数应该是单个字符。

80(Luise)

Whichtwo statements are true regarding working with dates? (Choose two.)

A. The default internal storage of dates is in the numeric format.默认的日期存储格式是数字格式

B. Thedefault internal storage of dates is in the character format.

C. TheRR date format automatically calculates the century from the SYSDATE functionand does not allow the user to enter the century.

D. The RR date format automatically calculates the century from theSYSDATE function but allows the user to enter the century if required.  RR日期格式自动计算世纪从SYSDATE函数中(但允许你键入所需要的世纪)

81

You arecurrently located in Singapore and have connected to a remote database inChicago. You issue the following command:当前你处于新加坡,连接到芝加哥的数据库,你发起以下命令:

SELECT ROUND(SYSDATE- promo_begin_date,0)

FROM promotions

WHERE (SYSDATE - promo_begin_date)/365>2;

PROMOTIONSis the public synonym for the public database link for the PROMOTIONS table.What is the outcome?

A. anerror because the ROUND function specified is invalid

B. anerror because the WHERE condition specified is invalid

C. number of days since thepromo started based on the current Chicago date and time

D. numberof days since the promo started based on the current Singapore date and time

82

Examinethe data in the CUST_NAME column of the CUSTOMERS table.

CUST_NAME

Renske Ladwig

Jason Mallin

Samuel McCain

Allan MCEwen

Irene Mikkilineni

Julia Nayer

You needto display customers' secondnames where the second name starts with"Mc" or "MC." Which querygives the required output?

A.

SELECT SUBSTR(cust_name,INSTR(cust_name,' ')+1)

FROM customers

WHERE INITCAP(SUBSTR(cust_name,INSTR(cust_name,' ') +1))='Mc';

B.

SELECTSUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

WHEREINITCAP(SUBSTR(cust_name, INSTR(cust_name, ' ') + 1))

LIKE 'Mc%';

C.

SELECT SUBSTR(cust_name,INSTR(cust_name,' ')+1)

FROM customers

WHERE SUBSTR(cust_name,INSTR(cust_name,' ')+1)

LIKE INITCAP('MC%');

D.

SELECT SUBSTR(cust_name,INSTR(cust_name,' ') +1)

FROM customers

WHERE INITCAP(SUBSTR(cust_name,INSTR(cust_name,' ') +1))

= INITCAP('MC%');

83

Examinethe data in the CUST_NAME column of the CUSTOMERS table.

CUST_NAME

Lex De Haan

Renske Ladwig

Jose Manuel Urman

Jason Mallin

You wantto extract only those customer names that have three names and display the *symbol in place of the first name as follows:你想提取那些客户名字有3个名字,显示*

CUST NAME

*** De Haan

**** Manuel Urman

Whichtwo queries give the required output? (Choose two.)

A.

SELECTLPAD(SUBSTR(cust_name, INSTR(cust_name,' ')),

LENGTH(cust_name), '*') "CUST NAME"

FROM customers

WHEREINSTR(cust_name, ' ',1,2) <> 0;

B.

SELECTLPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),

LENGTH(cust_name),'*') "CUST NAME"

FROM customers

WHEREINSTR(cust_name, ' ', -1, 2) <> 0;

C.

SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,'  ')),

LENGTH(cust_name)-INSTR(cust_name,' '),'*')"CUST NAME"

FROM customers

WHERE INSTR(cust_name,' ',-1,-2)<>0;

D.

SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),

LENGTH(cust_name) -INSTR(cust_name,' '),'*')"CUST NAME"

FROM customers

WHERE INSTR(cust_name,' ',1,2) <>0;

84

View theExhibit and examine the structure of the EMPLOYEES table.

Examinethe data in the ENAMEand HIREDATEcolumns of the EMPLOYEES table:

ENAME   HIREDATE

SMITH   17-DEC-80

ALLEN   20-FEB-81

WARD    22-FEB-81

You wantto generate a list of user IDs as follows:你想产生一个user id的列表

USERID

Smi17DEC80

All20FEB81

War22FEB81

Youissue the following query:你发起下列查询

SELECT CONCAT(SUBSTR(INITCAP(ename),1,3),

REPLACE(hiredate,'-'))"USERID"

FROM employees;

What isthe outcome?

A. It executes successfullyand gives the correct output.

B. Itexecutes successfully but does not give the correct output.

C. Itgenerates an error because the REPLACE function is not valid.

D. Itgenerates an error because the SUBSTR function cannot be nested in the CONCATfunction.

85

View theExhibit and examine the structure and data in the INVOICE发票 table.

Whichstatements are trueregarding data typeconversion in expressionsused in queries? (Choose all that apply.)哪个语句是正确的,关于数据类型转换(在查询中使用的表达式中的)

A. inv_amt='0255982':requires explicit conversion

B. inv_date> '01-02-2008:uses implicit conversion

C. CONCAT(inv_amt,inv_date):requires explicit conversion

D. inv_date = '15-february-2008'uses implicit conversion

E. inv_no BETWEEN '101' AND '110'uses implicitconversion

B,不符合默认的日期格式,隐式类型转换会失败。

86

Examinethe structure and data of the CUST_TRANS table:

CUST_TRANS

Name              Null    Type

CUSTNO            NOT NULL CHAR(2)

TRANSDATE                  DATE

TRANSAMT                   NUMBER(6,2)

CUSTNO TRANSDATE    TRANSAMT

Datesare stored in the default date format dd-mon-rr in the CUST_TRANS table. WhichSQL statements would execute successfully? (Choose three .)

A. SELECT transdate + '10' FROM cust_trans;

B. SELECT* FROM cust_trans WHERE transdate = '01-01-07';

C. SELECT transamt FROM cust_trans WHERE custno > '11';

D. SELECT * FROM cust_trans WHERE transdate='01-JANUARY-07';

E. SELECTcustno + 'A' FROM cust_trans WHERE transamt > 2000;

87

You want to display the date for the first Mon day of the next      month and issue the followingcommand:

SELECT TO_CHAR(NEXT_DAY(LAST_DAY(SYSDATE),'MON'),

'dd "is the first Monday for" fmmonth rrrr')

FROM DUAL;

What isthe outcome?

A. It executes successfully and returns the correct result.

B. Itexecutes successfully but does not return the correct result.

C. Itgenerates an error because TO_CHAR should be replaced with TO_DATE.

D. Itgenerates an error because rrrr should be replaced by rr in the format string.

E. Itgenerates an error because fm and double quotation marks should not be used inthe format string.

Last_day,本月最后一天

Next_day,星期内指定的日期下一次出现的日期

88

You needto calculate the number of days from 1st January 2007 till date. Dates arestored in the default format of dd-mon-rr.你先搞计算从2007.1.1至今多少天;日期存储按照dd-mon-rr来存储

WhichSQL statements would give the required output? (Choose two .)哪个语句将给出所需要的:

A. SELECTSYSDATE - '01-JAN-2007' FROM DUAL;

B. SELECT SYSDATE - TO_DATE('01/JANUARY/2007') FROM DUAL;

C. SELECT SYSDATE - TO_DATE('01-JANUARY-2007') FROM DUAL;

D. SELECTTO_CHAR(SYSDATE, 'DD-MON-YYYY') - '01-JAN-2007' FROM DUAL;

E. SELECTTO_DATE(SYSDATE, 'DD/MONTH/YYYY') - '01/JANUARY/2007' FROM DUAL;

89

You needto display the date 11-oct-2007 in words as 'Eleventh of October, Two ThousandSeven'. Which SQL statement would give the required result?你需要显示日期11-oct-2007为单词如eleventh of October,thousand seven. 哪个sql语句将给出所需的结果

A.

SELECT TO_CHAR('11-oct-2007','fmDdspth "of" Month, Year')FROM DUAL;

B.

SELECT TO_CHAR(TO_DATE('11-oct-2007'),'fmDdspth of month, year')

FROM DUAL;

C.

SELECTTO_CHAR(TO_DATE('11-oct-2007'), 'fmDdthsp "of" Month, Year')

FROM DUAL;

D.

SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year'))

FROM DUAL;

90

Examinethe 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 planto give a discount of 25% on the product price and need to display the discountamount in the same format as the PROD_PRICE.你计划25%折扣;需要按照prod_price相同的格式来显示折扣价格

WhichSQL 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.

SELECTTO_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.00')

FROM PRICE_LIST;

91

View theExhibit and examine the structure of the PROMOTIONS table. Which two SQL statements would executesuccessfully? (Choosetwo.)

A.

UPDATE promotions

SET promo_cost= promo_cost+ 100

WHERETO_CHAR(promo_end_date, 'yyyy') > '2000';

B.

SELECT promo_begin_dateFROM promotions

WHERETO_CHAR(promo_begin_date,'mon dd yy')='jul 01 98';

C.

UPDATE promotions

SET promo_cost = promo_cost +100

WHERE promo_end_date>TO_DATE(SUBSTR('01-JAN-2000',8));

D.

SELECT TO_CHAR(promo_begin_date,'dd/month')FROM promotions

WHERE promo_begin_dateIN

(TO_DATE('JUN 01 98'),TO_DATE('JUL 01 98'));

92重点看下

View theExhibit and examine the data in the PROMO_NAME and PROMO_END_DATE columns of the PROMOTIONS table, and the requiredoutput format. Whichtwoqueries give thecorrectresult? (Choose two.)

A.

SELECT promo_name,TO_CHAR(promo_end_date,'Day') ||', ' ||

TO_CHAR(promo_end_date,'Month')||

TO_CHAR(promo_end_date,'DD, YYYY')ASlast_day

FROM promotions;

B.

SELECT promo_name,TO_CHAR(promo_end_date,'fxDay')|| ', ' ||

TO_CHAR(promo_end_date,'fxMonth')||

TO_CHAR(promo_end_date,'fxDD, YYYY')ASlast_day

FROM promotions;

C.

SELECT promo_name, TRIM(TO_CHAR(promo_end_date,'Day'))  || ', '||

TRIM(TO_CHAR(promo_end_date,'Month')) ||

TRIM(TO_CHAR(promo_end_date,'DD, YYYY'))

AS last_day

FROM promotions;

D.

SELECT promo_name, TO_CHAR(promo_end_date,'fmDay') || ',' ||

TO_CHAR(promo_end_date,'fmMonth') ||

TO_CHAR(promo_end_date,'fmDD, YYYY') AS last_day

FROM promotions;

93

View theExhibit and examine the structure of the CUSTOMERS table.

Usingthe CUSTOMERS table, you need to generate a report that shows an increase inthe credit limit by 15% for all customers. Customers whose credit limit has notbeen entered should have the message " Not Available" displayed.使用customers表,你需要生成一个报告(显示一个增长,15%);假设credit limit没有键入的话,显示notavailable

WhichSQL statement would produce the required result?

A.

SELECT NVL(cust_credit_limit,'Not Available') *.15"NEW CREDIT"

FROM customers;

B.

SELECT NVL(cust_credit_limit *.15,'Not Available')"NEW CREDIT"

FROM customers;

C.

SELECT TO_CHAR(NVL(cust_credit_limit*.15,'Not Available')) "NEW CREDIT"

FROM customers;

D.

SELECTNVL(TO_CHAR(cust_credit_limit*.15),'Not Available') "NEW CREDIT"

FROM customers;

94

Examinethe structure of the PROGRAMS table:

name         Null      Type

PROG_ID      NOT NULL NUMBER(3)

PROG_COST               NUMBER(8,2)

START_DATE   NOT NULL DATE

END_DATE                DATE

Which two SQL statements wouldexecute successfully?(Choose two.)

A.

SELECTNVL(ADD_MONTHS(END_DATE,1), SYSDATE) FROM programs;

B.

SELECT TO_DATE(NVL(SYSDATE-END_DATE,SYSDATE))FROM programs;

C.

SELECT NVL(MONTHS_BETWEEN(start_date,end_date),'Ongoing')

FROM programs;

D.

SELECTNVL(TO_CHAR(MONTHS_BETWEEN(start_date,end_date)),'Ongoing')

FROM programs;

B, 如果END_DATE不为NULL,则返回的为数字,再做TO_DATE就会出错。

C, NVL函数要求第一个参数,与第二个参数的类型要兼容。

95

The PRODUCTStable has the following structure:

name             Null      Type

PROD_ID          NOT NULL NUMBER(4)

PROD_NAME                  VARCHAR2(25)

PROD_EXPIRY_DATE          DATE

Evaluatethe following two SQL statements:

SELECT prod_id,NVL2(prod_expiry_date, prod_expiry_date+ 15,'')

FROM products;

SELECT prod_id,NVL(prod_expiry_date, prod_expiry_date+ 15)

FROM products;

Whichstatement is true regarding the outcome?

A. Both the statementsexecute and give different results.

B. Boththe statements execute and give the same result.

C. Onlythe first SQL statement executes successfully.

D. Onlythe second SQL statement executes successfully.

96(Luise,两个Date类型相减后的类型是什么)

Examinethe structure of the INVOICE table.

name    Null     Type

INV_NO  NOT NULL NUMBER(3)

INV_DATE         DATE

INV_AMT          NUMBER(10,2)

Whichtwo SQL statements would execute successfully? (Choose two.)

A.

SELECT inv_no,NVL2(inv_date,'Pending','Incomplete') FROM invoice;

B.

SELECT inv_no,NVL2(inv_amt,inv_date,'Not Available') FROM invoice;

C.

SELECT inv_no,NVL2(inv_date,sysdate-inv_date,sysdate) FROM invoice;

D.

SELECT inv_no,NVL2(inv_amt,inv_amt*.25,'Not Available') FROM invoice;

B,参数类型不一致,隐式转换失败

D,如果第二个参数为numeric,则会比较exp2和exp3哪个具有最高的数字等级。

97

View theExhibit and evaluate the structure and data in the CUST_STATUS table. You issuethe following SQL statement:

SELECT custno,NVL2(NULLIF(amt_spent, credit_limit),0,1000)"BONUS"

FROM cust_status;

Whichstatement is trueregarding the execution of the above query?

A. Itproduces an error because the       AMT_SPENTcolumn contains a null value.

B. Itdisplays a bonus of 1000 for all customers whose AMT_SPENT is less thanCREDIT_LIMIT.

C. It displays a bonus of 1000 for all customers whose AMT_SPENT equalsCREDIT_LIMIT,  or AMT_SPENT is null .如果amt_spent等于credit_limit时,显示bonus 1000,负责amt_spentnull

D. It produces an error because the TO_NUMBERfunction must be used to convert the result of the NULLIF function before itcan be used by the NVL2 function.

只是说NULLIF的第一个参数不能指定为NULL字面量,但来自列中的NULL是可以接受的。

CREATE TABLE cust_status

(

CustNo      NUMBER(2)NOTNULL,

AmtSpent    NUMBER(10,2),

CreditLimit NUMBER(10,2)

);

INSERT INTO cust_status VALUES(1,1000,1000);

INSERT INTO cust_status VALUES(2,2000,2500);

INSERT INTO cust_status VALUES(3,NULL,3000);

INSERT INTO cust_status VALUES(4,3000,2800);

SELECT custno,NVL2(NULLIF(amtspent, creditlimit),0,1000)"BONUS"

FROM cust_status;

98

Whichstatement is true regarding the COALESCE function?关于联合函数正确的是

A. Itcan have a maximum of five expressions in a list.

B. Itreturns the highest NOT NULL value in the list for all rows.

C. It requires that all expressions in the list must be of the samedata type.要求列表中的所有表达式具有相同的数据类型

D. Itrequires that at least one of the expressions in the list must have a NOT NULL value.

99

View theExhibit and examine the structure of the PROMOTIONS table.

Using the PROMOTIONS table,   you need to find out the average cost for allpromos in the ranges $0-2000 and $2000-5000 in category AYou       issue the following SQL statement:使用promotions表,你需要找出所有promos(0-2000 and 2000-5000类中)的平均值

SELECT AVG(CASE WHEN promo_cost BETWEEN0AND2000

AND promo_category='A'then promo_cost

ELSE null END)"CAT_2000A",

AVG(CASEWHEN promo_costBETWEEN2001AND5000

AND promo_category='A'THEN promo_cost

ELSE null END)"CAT_5000A"

FROM promotions;

Whatwould be the outcome?

A. It executes successfullyand gives the required result.

B. Itgenerates an error because NULL cannot be specified as a return value.

C. Itgenerates an error because CASE cannot be used with group functions.

D. Itgenerates an error because multiple conditions cannot be specified for the WHENclause.

100

View theExhibit and examine the structure of the PROMOTIONS table. Which SQL statements are valid?       (Chooseall that apply.)

A.

SELECT promo_id, DECODE(NVL(promo_cost,0), promo_cost,

promo_cost * 0.25, 100) "Discount"

FROM promotions;

B.

SELECT promo_id, DECODE(promo_cost, 10000,

DECODE(promo_category, 'G1', promo_cost*.25, NULL), NULL) "Catcost"

FROM promotions;

C.

SELECT promo_id,DECODE(NULLIF(promo_cost,10000),

NULL, promo_cost*.25,'N/A')"Catcost"

FROM promotions;

D.

SELECT promo_id,DECODE(promo_cost,>10000,'High',<10000,'Low')

"Range" FROM promotions;

Cdecode会将所有的结果值转换成第一个结果值的类型,因此’N/A’转数字会失败。

Ddecode中每个比较的对象应该为一个表达式。(>10000,不为表达式)

101

Examinethe data in the PROMO_BEGIN_DATEcolumn of the PROMOTIONS table:

PROMO_BEGIN _DATE

04-jan-00

10-jan-00

15-dec-99

18-oct-98

22-aug-99

You wantto display the numberof promotions started in1999and 2000. Which query gives the correct output?

A.

SELECTSUM(DECODE(SUBSTR(promo_begin_date, 8), '00',1, 0)) "2000",

SUM(DECODE(SUBSTR(promo_begin_date, 8), '99', 1, 0)) "1999"

FROM promotions;

Decode(expr1,comp1,iftrue1,comp2,iftrue2,..)

B.

SELECT SUM(CASE TO_CHAR(promo_begin_date,'yyyy')

WHEN '99' THEN 1 ELSE 0 END)"1999",

SUM(CASETO_CHAR(promo_begin_date,'yyyy')

WHEN '00' THEN 1 ELSE 0 END)"2000"

FROM promotions;

C.

SELECT COUNT(CASETO_CHAR(promo_begin_date,'yyyy')

WHEN '99' THEN 1 ELSE 0 END)"1999",

COUNT(CASETO_CHAR(promo_begin_date,'yyyy')

WHEN '00' THEN 1 ELSE 0 END)"2000"

FROM promotions;

D.

SELECT COUNT(DECODE(SUBSTR(TO_CHAR(promo_begin_date,'yyyy'),8),

'1999',1,0))"1999",

COUNT(DECODE(SUBSTR(TO_CHAR(promo_begin_date,'yyyy'),8),

'2000',1,0))"2000"

FROM promotions;

B,是分开统计的不符合条件

C,to_char转换之后应该是四位的年

D,取子串时第2个参数应该指定为1

102

Examinethe structure of the TRANSACTIONS table:

name       Null       Type

TRANS_ID   NOT NULL NUMBER(3)

CUST_NAME             VARCHAR2(30)

TRANS_DATE            DATE

TIMESTAMPTRANS_AMT  NUMBER(10,2)

You wantto display the date, time, and transaction amount of transactions that wheredone before 12 noon. The value zero should be displayed for transactions wherethe transaction amount has not been entered.你想显示date,time,交易总量(中午12点之前)。值是0应该显示交易总量没有键入

Whichquery gives the required result?

A.

SELECT TO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

TO_CHAR(trans_amt,'$99999999D99')

FROM transactions

WHERE TO_NUMBER(TO_DATE(trans_date,'hh24'))<12

AND COALESCE(trans_amt,NULL)<>NULL;

B.

SELECTTO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

NVL(TO_CHAR(trans_amt,'$99999999D99'),0)

FROM transactions

WHERETO_CHAR(trans_date,'hh24') < 12;

C.

SELECT TO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

COALESCE(TO_NUMBER(trans_amt,'$99999999.99'),0)

FROM transactions

WHERE TO_DATE(trans_date,'hh24')<12;

D.

SELECT TO_DATE (trans_date,'dd-mon-yyyy hh24:mi:ss'),

NVL2(trans_amt,TO_NUMBER(trans_amt,'$99999999.99'),0)

FROM transactions

WHERE TO_DATE(trans_date,'hh24')<12;

A,<>NULL就错了

C,D,不应该调用TO_NUMBER()函数

103

Examinethe structure of the TRANSACTIONS table:

name        Null        Type

TRANS_ID    NOT NULL    NUMBER(3)

CUST_NAME               VARCHAR2(30)

TRANS_DATE              DATE

TRANS_AMT               NUMBER(10,2)

You wantto display the transaction date and specify whether it is a weekday or weekend.Evaluate the following two queries:你想显示交易日期,指定它是一个工作日还是周末。评估下面2个查询:

SELECT TRANS_DATE,CASEWHEN TRIM(TO_CHAR(trans_date,'DAY'))

IN ('SATURDAY','SUNDAY')THEN'weekend'

ELSE 'weekday' END "Day Type" FROM transactions;

SELECT TRANS_DATE,CASEWHEN TO_CHAR(trans_date,'DAY')

BETWEEN 'MONDAY' AND 'FRIDAY' THEN 'weekday'

ELSE 'weekend' END "Day Type" FROM transactions;

Whichstatement is true regarding the above queries?

A. Bothgive wrong results.

B. Bothgive the correct result.

C. Only the first query givesthe correct result.

D. Onlythe  second query gives the correctresult.

104

Examinethe structure of the PROMOS table:

name             Null    Type

PROMO_ID         NOT NULL    NUMBER(3)

PROMO_NAME                     VARCHAR2(30)

PROMO_START_DATE NOT NULL   DATE

PROMO_END_DATE                 DATE

You wantto generate a report showing promonames andtheirduration (number of days). If the PROMO_END_DATE has not been entered,the message 'ONGOING' should be displayed.

Which queries give the correct output?(Choose all that apply.)

A.

SELECT promo_name,

TO_CHAR(NVL(promo_end_date-promo_start_date,'ONGOING'))

FROM promos;

B.

SELECT promo_name,

COALESCE(TO_CHAR(promo_end_date- promo_start_date),'ONGOING')

FROM promos;

C.

SELECT promo_name,

NVL(TO_CHAR(promo_end_date-promo_start_date),'ONGOING')

FROM promos;

D.

SELECT promo_name, DECODE(promo_end_date- promo_start_date,

NULL, 'ONGOING',promo_end_date- promo_start_date)

FROM promos;

E.

SELECT promo_name,decode(coalesce(promo_end_date,promo_start_date),

null,'ONGOING', promo_end_date- promo_start_date)

FROM promos;

105

Examinethe structure of the PROMOS table:

name             Null    Type

PROMO_ID         NOT NULL NUMBER(3)

PROMO_NAME                VARCHAR2(30)

PROMO_START_DATE NOT NULL DATE

PROMO_END_DATE   NOT NULL DATE

You want to display the list of promonames with the message 'Same Day' for promos that started and ended on the sameday.

Whichquery gives the correct output?

A.

SELECT promo_name,

NVL(NULLIF(promo_start_date, promo_end_date),'Same Day')

FROM promos;

B.

SELECT promo_name,

NVL(TRUNC(promo_end_date- promo_start_date),'Same Day')

FROM promos;

C.

SELECT promo_name,

NVL2(TO_CHAR(TRUNC(promo_end_date-promo_start_date)),NULL,'Same Day')

FROM promos;

D.

SELECT promo_name,

DECODE((NULLIF(promo_start_date, promo_end_date)), NULL,'Same day')

FROM promos;

Nullifexpr1expr2)如果12相同,则返回空值

Decodenull,null,’Same day’;

106

Examinethe data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table:检查products表中的list_price和min_price列

LIST_PRICE  MIN_PRICE

10000       8000

20000

30000       30000

Whichtwo expressions give the same output? (Choose two.)哪两个表达式给出相同的输出?

A. NVL(NULLIF(list_price, min_price),0)

B. NVL(COALESCE(list_price, min_price), 0)

C. NVL2(COALESCE(list_price, min_price), min_price,0)

D. COALESCE(NVL2(list_price, list_price, min_price), 0)

A,肯定不对,决定list_price和min_price是否相等。

COALESCE返回第一非空表达式

107

View theExhibit and examine the structure and data in the INVOICE table. Which two SQL statements would executesuccessfully?(Choosetwo.)

A. SELECT AVG(inv_date) FROM invoice;

B. SELECT MAX(inv_date),MIN(cust_id) FROM invoice;

C. SELECT MAX(AVG(SYSDATE- inv_date))FROM invoice;

D. SELECT AVG( inv_date - SYSDATE), AVG(inv_amt) FROM invoice;

A,AVG只能应用于数值类型

B, 分组函数嵌套使用,需要使用GROUP BY子句。

108

Which two statements are true regarding the COUNT function? (Choosetwo.)

A. The COUNTfunction can be used only for CHAR, VARCHAR2, and NUMBER data types.

B. COUNT(*) returns the number of rows including duplicate rows androws containing NULL value in any of the columns.  Count*)返回行的数量包括重复行和行所有列都为NULL

C. COUNT(cust_id)returns the number of rows including rows with duplicate customer IDs and NULLvalue in the CUST_ID column.  包含重复的值,但不包含空值

D. COUNT(DISTINCT inv_amt)returns the number of rows excluding rowscontaining duplicates and NULL values in the INV_AMT column. Count(distinctinv_amt)返回行的数量(不包括重复值的行和inv_amt列为控制的行)

E. A SELECT statement using the COUNT functionwith a DISTINCT keyword cannot  have  a WHERE clause.

C,包含重复的值,但不包含空值。

E,可以有WHERE子句,先过滤掉不需要的行。

109

Examinethe structure of the MARKS table:

name         Null     Type

STUDENT_ID   NOT NULL VARCHAR2(4)

STUDENT_NAME          VARCHAR2(25)

SUBJECT1              NUMBER(3)

SUBJECT2              NUMBER(3)

SUBJECT3              NUMBER(3)

Which two statements wouldexecute successfully?(Choose two.)

A.

SELECT student_name,subject1FROM marks

WHERE subject1 > AVG(subject1);  //统计分析函数不能放在where语句中

B.

SELECT student_name,SUM(subject1)FROM marks

WHERE student_nameLIKE'R%';

C.

SELECTSUM(subject1+subject2+subject3) FROM marks

WHERE student_nameIS NULL;

D.

SELECTSUM(DISTINCT NVL(subject1,0)), MAX(subject1)

FROM marksWHERE subject1> subject2;

110

View theExhibit and examine the structure of the CUSTOMERS table.

Usingthe CUSTOMERS table, you need to generate a report that shows the averagecredit limit for customers in WASHINGTON and NEW YORK.使用customers表,你需要产生一个报告(显示平均 credit limit),在washington和new york。

WhichSQL statement would produce  the requiredresult?

A.

SELECT cust_city,AVG(cust_credit_limit)FROM customers

WHERE cust_city IN ('WASHINGTON','NEW YORK')

GROUP BY cust_credit_limit, cust_city;

B.

SELECT cust_city,AVG(cust_credit_limit)FROM customers

WHERE cust_city IN ('WASHINGTON','NEW YORK')

GROUP BY cust_city,cust_credit_limit;

C.

SELECT cust_city, AVG(cust_credit_limit) FROM customers

WHERE cust_cityIN ('WASHINGTON','NEW YORK')

GROUPBY cust_city;

D.

SELECT cust_city,AVG(NVL(cust_credit_limit,0))FROM customers

WHERE cust_city IN ('WASHINGTON','NEW YORK');

111

View theExhibit and examine the structure of the CUSTOMERS table.

Whichstatement would display the highestcredit limitavailableineach income levelin each city in theCUSTOMERS table?

A.

SELECT cust_city, cust_income_level,MAX(cust_credit_limit)

FROM customers

GROUP BY cust_city, cust_income_level, cust_credit_limit;

B.

SELECT cust_city, cust_income_level, MAX(cust_credit_limit)

FROM customers

GROUPBY cust_city, cust_income_level;

C.

SELECT cust_city, cust_income_level,MAX(cust_credit_limit)

FROM customers

GROUP BY cust_credit_limit, cust_income_level, cust_city;

D.

SELECT cust_city, cust_income_level,MAX(cust_credit_limit)

FROM customers

GROUP BY cust_city, cust_income_level,MAX(cust_credit_limit);

112

View theExhibit and examine the structure of the PROMOTIONS table. Evaluate thefollowing SQL statement:

SELECT promo_category,AVG(promo_cost) Avg_Cost,

AVG(promo_cost)*.25 Avg_Overhead

FROM promotions

WHERE UPPER(promo_category)IN('TV','INTERNET','POST')

GROUP BY Avg_Cost ORDER BY Avg_Overhead;

Theabove query generates an error on execution.上面的查询产生了一个错误。

Whichclause in the above SQL statement causes the error?哪个条件以前你错误

A. WHERE

B. SELECT

C. GROUP BY

D. ORDER BY

应该是按promo_category分组

113

Examinethe structure of the ORDERS table:

Name        Null     Type

ORDER_ID    NOT NULL NUMBER(12)

ORDER_DATE  NOT NULL TIMESTAMP(6)

CUSTOMER_ID NOT NULL NUMBER(6)

ORDER_STATUS         NUMBER(2)

ORDER_TOTAL          NUMBER(8,2)

You wantto find the total value of all the orders for each year and issue the followingcommand:你想发现所有订单中的总值(每年)

SELECT TO_CHAR(order_date,'rr'),SUM(order_total)

FROM orders

GROUP BY TO_CHAR(order_date,'yyyy');

Whichstatement is true regarding the outcome?

A. Itexecutes successfully and gives the correct output.

B. Itgives an error because the TO_CHAR function is not valid.

C. Itexecutes successfully but does not give the correct output.

D. It gives an error because the data type conversion in the SELECTlist does not match the data type conversion in the GROUP BY clause.

114

View theExhibit and examine the structure of the SALES table.

Thefollowing query is written to retrieve all those product ID s from the SALEStable that have more than 55000 sold and have been ordered more than 10 times.检索所有的产品IDs从sales表中(已经销售超过55000和已经订购超过10次)

SELECT prod_id FROM sales

WHERE quantity_sold>55000ANDCOUNT(*) >10GROUPBY prod_id

HAVING COUNT(*)>10;

Whichstatement is trueregarding this SQL statement?

A. Itexecutes successfully and generates the required result.

B. Itproduces an error because COUNT(*) should be specified in the SELECT clausealso.

C. It produces an error because COUNT(*) should be only in theHAVING clause and not in the WHERE clause.它产生一个错误,因为count(*)应该只在having条件中而不能在where条件中

D. Itexecutes successfully but produces no result because COUNT(prod_id) should beused instead of COUNT(*).

115

View theExhibit and examine the structure of the CUSTOMERS table. Evaluate thefollowing SQL statement:

SELECT cust_city,COUNT(cust_last_name)FROM customers

WHERE cust_credit_limit>1000

GROUP BY cust_city

HAVING AVG(cust_credit_limit)BETWEEN5000AND6000;

Whichstatement is trueregarding the outcome of the above query?

A. It executes successfully.

B. Itreturns an error because the BETWEEN operator cannot be used in the HAVINGclause.

C. Itreturns an error because WHERE and HAVING clauses cannot be used in the sameSELECT statement.

D. Itreturns an error because WHERE and HAVING clauses cannot be used to applyconditions on the same column.

116

Examinethe data in the ORD_ITEMS table:

ORD_NO   ITEM_NO  QTY

You wantto find out if there is any item in the table for which the average maximumquantity is more than 50.你想找出表中的条目(平均最大量>50)

Youissue the following query:你发起下列查询:

SELECT AVG(MAX(qty))

FROM ord_items

GROUP BY item_no

HAVING AVG(MAX(qty)) >50;

Whichstatement is trueregarding the outcome of this query?

A. Itexecutes successfully and gives the correct output.

B. It gives anerror because the HAVING clause is not valid.

C. Itexecutes successfully but does not give the correct output.

D. It gives an error because the GROUP BYexpression is not valid.

会显示分组函数嵌套太深。

117

Whichstatements are true regarding the WHERE and HAVING clauses in a SELECTstatement? (Choose all that apply.) (在select语句中的where和having条件,描述正确的是)

A. The HAVING clause can be used with aggregate functions insubqueries.在子查询中having条件可以用在aggregate函数中

B. TheWHERE clause can be used to exclude rows after dividing them into groups.

C. The WHERE clause can be used to exclude rows before dividing them intogroups.where条件可以用于去排除行(分组之前)

D. Theaggregate functions and columns used in the HAVING clause must be specified inthe SELECT list of the query.聚合函数和列用在having条件中(必须被指定在查询的select列表中X)

E. TheWHERE and HAVING clauses can be used in the same statement only if they areapplied to different columns in the table. Where和having条件用在相同的语句中(如果它们被应用在表中的不同列上X)。

118

View theExhibit and examine the structure of the PROMOTIONS table. Examine thefollowing two SQL statements:

-- Statement 1

SELECT promo_category,SUM(promo_cost)FROM promotions

WHERE promo_end_date-promo_begin_date>30

GROUP BY promo_category;

--Statement 2

SELECT promo_category,sum(promo_cost)FROM promotions

GROUP BY promo_category

HAVING MIN(promo_end_date-promo_begin_date)>30;

Whichstatement is true regarding the above two SQL statements?

A. statement1 gives an error, statement 2 executes successfully

B. statement2 gives an error, statement 1 executes successfully

C. statement1 and statement 2 execute successfully and give the same output

D. statement 1 and statement2 execute successfully and give a different output

119

Examinethe data in the ORD_ITEMS table:

ORD_NO   ITEM_NO  QTY

Evaluatethe following query:

SELECT item_no,AVG(qty)FROM ord_items

HAVING AVG(qty)>MIN(qty)*2

GROUP BY item_no;

Whichstatement is trueregarding the outcome of the above query?

A. Itgives an error because the HAVING clause should be specified after the GROUP BYclause.

B. Itgives an error because all the aggregate functions used in the HAVING clausemust be specified in the SELECT list.

C. It displays the item noswith their average quantity where the average quantity is more than double theminimum quantity of that item in the table.

D. It displays the item nos with their averagequantity where the average quantity is

more than double the overall minimum quantityof all the items in the table.

AHaving子句可以放在Group By子句之前。

120需要进一步研究

View theExhibits and examine the structures of the PRODUCTS, SALES, and CUSTOMERS tables. You issuethe following query:

SELECT p.prod_id, prod_name, prod_list_price, quantity_sold,

cust_last_name

FROM products p NATURAL JOIN sales sNATURALJOIN customers c

WHERE prod_id =148;

Whichstatement is true regarding the outcome of this query?

A. Itexecutes successfully.

B. Itproduces an error because the NATURAL join can be used only with two tables.

C. It produces an error because a    columnused in the NATURAL join cannot have a qualifier.

D. Itproduces an error because all columns used in the NATURAL join should have aqualifier.

121

Which two statements are true regarding the USING clause in tablejoins? (Choose two .)

A. Itcan be used to join a maximum of three tables.可以用于连接最大3表X

B. It can be used to restrict the number of columns used in aNATURAL join.在一个natural连接中,可以用于去限制使用的列的数量

C. Itcan be used to access data from tables through equijoins as well asnonequijoins.

D. It can be used to join tables that have columns with the samename and compatible data types.它可以用于去连接表(有相同名字和兼容性数据类型)

122

View theExhibit for the structure of the STUDENT and FACULTY tables. You need todisplay thefaculty namefollowed by the number of students handled by the faculty at the base location.Examine the following two SQL statements:你需要去显示faculty name,学生的数量,基础位置;

--statement1

SELECT faculty_name,COUNT(student_id)

FROM studentJOIN faculty

USING (faculty_id, location_id)

GROUP BY faculty_name;

--statement2

SELECT faculty_name,COUNT(student_id)

FROM studentNATURALJOIN faculty

GROUP BY faculty_name;

Whichstatement is trueregarding the outcome?

A.   Onlystatement 1 executes successfully and gives the required result.

B.    Onlystatement 2 executes successfully and gives the required result.

C.    Bothstatements 1 and 2 execute successfully and give different results.

D. Bothstatements   1 and 2 execute successfullyand give the same required result.

CREATE TABLE Student

(

StudentID NUMBER(2)NOTNULL,

StudentName VARCHAR2(20),

FacultyID VARCHAR2(2),

LocationID NUMBER(2)

);

CREATE TABLE Faculty

(

FacultyID NUMBER(2)NOTNULL,

FacultyName VARCHAR2(20),

LocationID NUMBER(2)

);

123 重点理解下on,join连接

View theExhibits and examine thestructures of the PRODUCTS, SALES, and CUSTOMERS tables. You need togenerate a report that givesdetailsof the customer's last name, name of the product,      and the quantity sold for all customers in ' Tokyo' .Whichtwo queries givethe required result? (Choose two.)

A.

SELECT c.cust_last_name, p.prod_name, s.quantity_sold

FROM sales sJOIN products p

USING(prod_id) JOIN customers cUSING(cust_id)

WHERE c.cust_city='Tokyo';

B.

SELECT c.cust_last_name, p.prod_name, s.quantity_sold

FROM products p JOIN sales s JOIN customers cON(p.prod_id=s.prod_id)

ON(s.cust_id=c.cust_id)WHERE c.cust_city='Tokyo';

C.

SELECT c.cust_last_name, p.prod_name, s.quantity_sold

FROM products pJOIN sales s

ON(p.prod_id=s.prod_id) JOIN customers cON(s.cust_id=c.cust_id)

AND c.cust_city='Tokyo';

D.

SELECT c.cust_id,c.cust_last_name,p.prod_id, p.prod_name, s.quantity_sold

FROM products p JOIN sales s

USING(prod_id)JOIN customers cUSING(cust_id)

WHERE c.cust_city='Tokyo';

ONWHERE可以同时使用,ON后面还可以接AND增加过滤条件。

124

View theExhibit and examine the structure of the PROMOTIONS, SALES, and CUSTOMERtables. You need to generate a report showing thepromo name along with thecustomer name for all products that weresoldduring their promo campaignand before 30th October2007. You issue the following query:

SELECT promo_name, cust_name

FROM promotions pJOIN sales sON(time_idBETWEEN promo_begin_dateAND promo_end_date)

JOIN customer c ON (s.cust_id= c.cust_id)AND time_id <'30-oct-2007';

Whichstatement is trueregarding the above query?

A. Itexecutes successfully and gives the required result.

B. It executes successfullybut does not give the required result.

C. Itproduces an error because the join order of the tables is incorrect.

D. It produces an error because equijoin andnonequijoin conditions cannot be used in the same SELECT statement.

Promotions表和sales表进行连接时,除了要指定时间在相应的范围外,还要指定promo_id相等。

125

Examinethe structure of the CUSTOMERS table:

name              Null      Type

CUSTNO            NOT NULL NUMBER(3)

CUSTNAME          NOT NULL VARCHAR2(25)

CUSTADDRESS                 VARCHAR2(35)

CUST_CREDIT_LIMIT          NUMBER(5)

CUSTNOis the PRIMARY KEY in the table. You want to find out if any customers' detailshave been entered more than once using different CUSTNO, by listing all theduplicate names. Whichtwomethods can you use to get the required result? (Choose two.) Custno是表中的PK。你想发现客户的详细信息〉1次,使用不同的custno;通过列举重复名。

A. self-join自连接

B. subquery子查询

C. full outer-joinwith self-join

D. leftouter-join with self-join

E. rightouter-join with self-join

126 自连接,左连接

View theExhibit and examine the data in the PROJ_TASK_DETAILS table.

ThePROJ_TASK_DETAILS table stores information about tasks involved in a projectand the relation between them. The BASED_ON column indicates dependenciesbetween tasks. Some tasks do not depend on the completion of any other tasks. Youneed to generate a report showing all task IDs, the corresponding task ID theyare dependent on, and the name of the employee in charge of the task it dependson. Which query would give the required result?   PROJ_TASK_DETAILS表存储信息(工程中任务和关系)。Based_on列暗示任务之间的关系。一些任务U以来其他任务的完成。你需要产生一个报告显示task ids,他们依赖的任务id,任务以来的负责人的名字。

A.

SELECT p.task_id, p.based_on, d.task_in_charge

FROM proj_task_details pJOIN proj_task_details d

ON (p.based_on = d.task_id);

B.

SELECT p.task_id, p.based_on, d.task_in_charge

FROM proj_task_details pLEFT OUTER JOIN proj_task_details d

ON(p.based_on= d.task_id);

C.

SELECT p.task_id, p.based_on, d.task_in_charge

FROM proj_task_details p FULLOUTERJOIN proj_task_details d

ON (p.based_on = d.task_id);

D.

SELECT p.task_id, p.based_on, d.task_in_charge

FROM proj_task_details pJOIN proj_task_details d

ON (p.task_id = d.task_id);

127

Examinethe data in the CUSTOMERS table:

You wantto list all cities that have more than one customer along with the customerdetails. Evaluate the following query:

你想列出所有的城市(有>1个顾客,以及顾客的详细信息);评估下列查询:

SQL>SELECT c1.custname, c1.city

FROM Customersc1 Customers c2

ON(c1.city = c2.city AND c1.custname <> c2.custname);

Which two JOIN options can be used in the blank in theabove query to give thecorrectoutput? (Choose two.)

A. JOIN

B. NATURALJOIN

C. LEFTOUTER JOIN

D. FULLOUTER JOIN

E. RIGHT OUTER JOIN

CREATE TABLE Customers

(

custno NUMBER(2),

custname VARCHAR2(10),

city VARCHAR2(10)

);

INSERT INTO Customers VALUES(1,'KING','SEATTLE');

INSERT INTO Customers VALUES(2,'GREEN','BOSTON');

INSERT INTO Customers VALUES(3,'KOCHAR','SEATTLE');

INSERT INTO Customers VALUES(4,'SMITH','NEWYORK');

128

View the Exhibits and examine the structures ofthe CUSTOMERS, SALES,  and COUNTRIES tables. You need to generate areport that shows all country names, with corresponding customers (if any) andsales details (if any), for all customers. 你需要产生一个报告显示所有的国家名,对应的顾客(如有)和销售信息(如果有)

Which FROM clause gives the required result?

A.

FROM sales JOIN customers USING(cust_id) FULL

OUTER JOIN countries USING (country_id);

B.

FROM sales JOIN customers USING(cust_id)

RIGHT OUTER JOIN countries USING(country_id);

C.

FROM customersLEFT OUTER JOIN salesUSING (cust_id)

RIGHTOUTER JOIN countriesUSING (country_id);

D.

FROM customers LEFT OUTER JOIN sales USING (cust_id)

LEFT OUTER JOIN countries USING(country_id);

即所有的国家需要全部显示。Customers表与sales表连接时,用户需要全部显示。

129

View theExhibits and examine the structures of the PROMOTIONS and SALES tables. Evaluatethe following SQL statement:

SELECT p.promo_id, p.promo_name, s.prod_id

FROM sales s RIGHT OUTER JOIN promotions p

ON (s.promo_id = p.promo_id)

Whichstatement is true regarding the output of the above query?

A. Itgives the details of promos for which there have been sales.

B. Itgives the details of promos for which there have been no sales.

C. It gives details of all promos irrespective不考虑的 of whether theyhave resulted in a sale or not.

D. Itgives details of product ID s that have been sold irrespective of whether theyhad a promo or not.

130(from)

View theExhibit and examine the data in the EMPLOYEES table:

You wantto display all the employee names and their corresponding manager names.你想显示所有的雇员名字和他们对应的管理者的名字:

Evaluate the following query:

SELECTe.employee_name "EMP NAME", m.employee_name "MGR NAME" FROMemployees eemployeesm

ONe.manager_id = m.employee_id;

Which JOIN option can be usedin the blank in the above query to get the required output?

A. onlyinner JOIN

B. onlyFULL OUTER JOIN

C. only LEFT OUTER JOIN

D. onlyRIGHT OUTER JOIN

131

View theExhibit and examine the structure of the PRODUCT, COMPONENT, and PDT_COMPtables.

InPRODUCT table, PDTNO is the primary key. PDTNO是PK

InCOMPONENT table, COMPNO is the primary key. Compno是PK

InPDT_COMP table, (PDTNO,COMPNO) is the primary key, PDTNO is the foreign keyreferencing PDTNO in PRODUCT table and COMPNO is the foreign key referencingthe COMPNO in COMPONENT table.

You wantto generate a report listing theproduct names and theircorresponding component names, if thecomponent names and product names exist.你想生成一个报告列出产品名和他们对应的部件名,如果部件名和产品名存在的话。

Evaluatethe following query:

SELECT pdtno, pdtname, compno, compname

FROM productpdt_comp

USING (pdtno) component USING(compno)

WHERE compname IS NOT NULL;

Which combination of joins used in theblanks in the above query gives the correct output?

A. JOIN;JOIN

B. FULLOUTER JOIN; FULL OUTER JOIN

C. RIGHT OUTER JOIN; LEFT OUTER JOIN

D. LEFTOUTER JOIN; RIGHT OUTER JOIN

132

View theExhibit and examine the structure of the SALES and PRODUCTS tables.

In theSALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTStable, You want to list each product ID and the number of times it has beensold. Evaluate the following query:

SELECT p.prod_id,COUNT(s.prod_id)

FROM products psales sON p.prod_id  = s.prod_id

GROUP BY p.prod_id;

Whichtwo JOIN options can be used in the blank in the above query to get therequired output? (Choose two.)

A. JOIN

B. FULL OUTER JOIN

C. LEFT OUTER JOIN

D. RIGHTOUTER JOIN

133

Whichtwo statements are true regarding subqueries? (Choose two.) 关于子查询正确的两个语句:

A. A subquery can retrieve zero or more rows. 子查询可以检索0或多行

B. Onlytwo subqueries can be placed at one level. 只有2个子查询可以被放置在一级别

C. Asubquery can be used only in SQL query statements. 子查询只可以在sql查询语句中使用

D. A subquery can appear on either side of a comparison operator.子查询可以出现在比较运算符的两边

E. Thereis no limit on the number of subquery levels in the WHERE clause of a SELECTstatement. 在where条件中子查询的数量

-- B错误

SELECT a.empno, a.ename, b.job, b.sal, c. deptno

FROM (SELECT empno, enameFROM emp) a,

(SELECT empno, job, salFROM emp) b,

(SELECT empno, deptnoFROM emp) c

WHERE a.empno= b.empnoAND a.empno= c.empno;

-- D正确

SELECT * FROM emp

WHERE (SELECT sal FROM empWHERE empno=7369)= sal;

E,错误,WHERE子句中的子查询的嵌套深度最大为255

134

Wherecan subqueries be used? (Choose all that apply.)子查询可以被应用在哪里?

A. field names in the  SELECTstatement    select语句的fields name

B. the FROM clause in the SELECT statement  select语句的from条件

C. the HAVING clause in the SELECT statement  select语句的having条件

D. the GROUPBY clause in the SELECT statement  X

E. the WHEREclause in only the SELECT statement

F. the WHERE clause in SELECT as well as all DML statements所有的DML语句的where条件

135

Whichthree statements are true regarding subqueries? (Choose three.) 关于子查询的语句正确的是:

A. Subqueries can contain GROUP BY and ORDER BY clauses.子查询可以包含group byorder by语句

B. Main query and subquery can get data from different tables.主查询和子查询可以从不同的表获取数据

C. Mainquery and subquery must get data from the same tables.

D. Subqueriescan contain ORDER BY but not the GROUP BY clause.

E. Onlyone column or expression can be compared between the main query and subquery.

F. Multiple columns or expressions can be compared between the mainquery and subquery.多列或表达式可以被比较在主查询和子查询之间。

136

View theExhibit and examine the structure of the PRODUCTS table. Which two tasks would require subqueries? (Choose two.)哪两个任务需要子查询。

A. Displaythe minimum list price for each product status. 显示最小公开列价及产品的状态

B. Displayall suppliers whose list price is less than 1000.显示公开列价<1000的供应商

C. Display the number of products whose list price is more than theaverage list price.显示产品的数量(公开列价大于平均列价)

D. Displaythe total number of products supplied by supplier 102 and have product statusas 'obsolete'.供应商102和产品状态为obsolete的的提供的产品的数量

E. Display all products whose minimum list price is more than theaverage list price of products and have the status 'orderable'.显示所有的产品的最小的公开列价

137

View theExhibits and examine PRODUCTS and SALES tables.

Youissue the following query to display product name and the number of times次数 the product has been sold:你发起下列查询去显示product name和 产品已经销售的次数

SELECT p.prod_name, i.item_cnt

FROM (SELECT prod_id,COUNT(*) item_cntFROM sales

GROUP BY prod_id) i RIGHT OUTER JOIN products p

ON i.prod_id= p.prod_id;

Whathappens when the above statement is executed?

A. The statement executessuccessfully and produces the required output.

B. Thestatement produces an error because ITEM_CNT cannot be displayed in the outerquery.

C. Thestatement produces an error because a subquery in the FROM clause andouter-joins cannot be used together.

D. Thestatement produces an error because the GROUP BY clause cannot be used in asubquery in the FROM clause.

138

Whichstatement is true regarding subqueries? 子查询正确的描述?

A. TheLIKE operator cannot be used with single- row subqueries.   Like运算符不能用在单行子查询X

B. TheNOT IN operator isequivalent to IS NULL with single- row subqueries.  NOT IN操作符等于IS NULL(用单行子查询)

C. =ANYand =ALL operators have the same functionality in multiple- row subqueries.  =ANY和=ALL操作符有相同功能在多行子查询中。

D. The NOT operator can be used with IN, ANY, and ALL operators inmultiple- row subqueries.在多行子查询中,NOT操作符号可以与INANYALL操作符一起使用

139

Whichthree statements are true about multiple-row subqueries? (Choose three.) 多行子查询正确的3个语句?

A. They can contain a subquery within a subquery. 在一个子查询中可以包含一个子查询

B. They can return multiple columns as well as rows.他们可以像行一样返回多列

C. Theycannot contain a subquery within a subquery.

D. Theycan return only one column but multiple rows.

E. They can contain group functions and GROUP BY and HAVING clauses.他们可以包含组函数、group byhaving条件。

F. Theycan contain group functions and the GROUP BY clause, but not the HAVING clause.

140

Examinethe structure of the PRODUCTS table:

name        Null     Type

PROD_ID     NOT NULL NUMBER(4)

PROD_NAME            VARCHAR2(20)

PROD_STATUS          VARCHAR2(6)

QTY_IN_HAND          NUMBER(8,2)

UNIT_PRICE           NUMBER(10,2)

You wantto display the names of the products that have the highest total value forUNIT_PRICE * QTY_IN_HAND.

你想显示产品有最高的高值(unit_price*qty_in_hand)的名字:

WhichSQL statement gives the required output? 哪个语句给的需求输出

A.

SELECT prod_nameFROM products

WHERE(unit_price* qty_in_hand) =

(SELECTMAX(unit_price* qty_in_hand) FROM products);

B.

SELECT prod_nameFROM products

WHERE (unit_price * qty_in_hand)=

(SELECTMAX(unit_price* qty_in_hand)FROM products

GROUP BY prod_name);

C.

SELECT prod_nameFROM productsGROUPBY prod_name

HAVING MAX(unit_price * qty_in_hand)=

(SELECTMAX(unit_price* qty_in_hand)FROM products

GROUP BY prod_name);

D.

SELECT prod_nameFROM products

WHERE (unit_price * qty_in_hand)=

(SELECTMAX(SUM(unit_price* qty_in_hand))FROM products)

GROUP BY prod_name;

141

View theExhibit and examine the structure of CUSTOMERS and GRADES tables. You need todisplaynames andgrades of customers whohave the highest creditlimit. WhichtwoSQL statements wouldaccomplishthe task? (Choose two.)

A.

SELECT custname, gradeFROM customers, grades

WHERE (SELECT MAX(cust_credit_limit)FROM customers)BETWEEN startval and endval;

B.

SELECT custname, gradeFROM customers, grades

WHERE(SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startvaland endval

AND cust_credit_limitBETWEEN startvalAND endval;

C.

SELECT custname, gradeFROM customers, grades

WHERE cust_credit_limit= (SELECT MAX(cust_credit_limit) FROM customers)

AND cust_credit_limitBETWEEN startvalAND endval;

D.

SELECT custname, gradeFROM customers, grades

WHERE cust_credit_limitIN(SELECTMAX(cust_credit_limit)FROM customers)

AND MAX(cust_credit_limit)BETWEEN startvalAND endval;

D,最后一句AND MAX(cust_credit_limit)BETWEEN多了一个MAX

142

View theExhibit and examine the structure of the PRODUCTS table. Evaluate the followingquery:

SELECT prod_nameFROM products

WHERE prod_id IN (SELECT prod_idFROM productsWHERE prod_list_price= (SELECTMAX(prod_list_price)

FROM products WHERE prod_list_price < (SELECTMAX(prod_list_price)FROM products)));

Whatwould be the outcome of executing the above SQL statement?

A. Itproduces an error.

B. Itshows the names of all products in the table.

C. It shows the names ofproducts whose list price is the second highest in the table.

D. Itshows the names of all products whose list price is less than the maximum listprice.

143

View theExhibit and examine the structure of the PROMOTIONS table.

You haveto generate a report that displays the promo name andstart date for all promos that started after the last promo宣传 in the 'INTERNET' category. 你不得不生成一个报告(显示promo name和所有promo 启动日期(internet分类中的最后的last promo))

Whichquery would give you the required output?

A.

SELECT promo_name, promo_begin_date

FROM promotions

WHERE promo_begin_date>ALL (SELECTMAX(promo_begin_date)FROM promotions)AND promo_category='INTERNET';

B.

SELECT promo_name, promo_begin_date

FROM promotions

WHERE promo_begin_dateIN(SELECT promo_begin_dateFROM promotionsWHERE promo_category='INTERNET');

C.

SELECT promo_name, promo_begin_date

FROM promotions

WHERE promo_begin_date > ALL (SELECT promo_begin_dateFROM promotions WHERE promo_category = 'INTERNET');

查询出所有的internet的时间(all

D.

SELECT promo_name, promo_begin_date

FROM promotions

WHERE promo_begin_date>ANY (SELECT promo_begin_dateFROM promotions WHERE promo_category='INTERNET');

144

View theExhibit and examine the structure of the PRODUCTS table. You want to displaythecategory withthemaximum numberof items. 你想显示分类(用最大的条目号)

Youissue the following query:

SELECT COUNT(*),prod_category_id

FROM products

GROUP BY prod_category_id

HAVING COUNT(*) =(SELECTMAX(COUNT(*))FROM products);

What isthe outcome?

A.It executessuccessfully and gives the correct output.

B. Itexecutes successfully but does not give the correct output.

C. It generates an error because the subquery does not have a GROUPBY clause.它产生一个错误因为子查询没有一个group by条件

D. Itgenerates an error because = is not valid and should be replaced by the INoperator.

145

View theExhibit and examine the structure of the CUSTOMERS table.

Youissue the following SQL statement on the CUSTOMERS table to display the customers who are in the samecountry as customers with the last name 'KING' and whose credit limit is lessthan the maximum credit limit in countries that have customers with the lastname 'KING'你在customers表上发起下列sql语句去显示客户(在相同国家,last name ‘KING’,谁的credit limit少于最大的credit limit)

SELECT cust_id, cust_last_name

FROM customers

WHERE country_idIN(SELECT country_idFROM customersWHERE cust_last_name='King')AND cust_credit_limit<

SELECT MAX(cust_credit_limit)FROM customersWHERE country_id IN(SELECT country_idFROM customersWHERE cust_last_name='King'));

Whichstatement is true regarding the outcome of the above query?

A. It executes and shows therequired result.

B. Itproduces an error and the < operator should be replaced by < ALL to getthe required output.

C. Itproduces an error and the < operator should be replaced by < ANY to getthe required output.

D. Itproduces an error and the      IN operatorshould be replaced by = in the WHERE clause of the main query to get therequired output.

146 in(null,….)什么结果?

Evaluatethe following SQL statement:

SELECT cust_id, cust_last_name

FROM customers

WHERE cust_credit_limitIN(select cust_credit_limitFROM customersWHERE cust_city='Singapore');

Whichstatement is trueregarding the above query ifoneof the values generated by the subquery is NULL?

A. Itproduces an error.

B. Itexecutes but returns no rows.

C. It generates output forNULL as well as the other values produced by the subquery.

D. Itignores the NULL value and generates output for the other values produced bythe subquery.

147  ???

View theExhibit and examine the structure of the PROMOTIONS table. Evaluate thefollowing SQL statement:

SELECT promo_name,CASEWHEN promo_cost>= (SELECTAVG(promo_cost)FROM promotionsWHERE promo_category='TV')

THEN 'HIGH' ELSE 'LOW' END COST_REMARK

FROM promotions;

Whichstatement is trueregarding the outcome of the above query?

A. It shows COST_REMARK forall the promos in the table.

B. Itproduces an error because the subquery gives an error.

C. Itshows COST_REMARK for all the promos in the promo category 'TV'.

D. Itproduces an error because subqueries cannot be used with the CASE expression.

148

View theExhibit and examine the structure of the PRODUCTS tables. You want to generatea report that displays theaveragelist price of product categories where theaverage list price is less than half the maximum in each category. Which query would give thecorrect output?

A.

SELECT prod_category, avg(prod_list_price)

FROM products

GROUPBY prod_category

HAVINGavg(prod_list_price) < ALL (SELECT max(prod_list_price)/2FROM productsGROUPBY prod_category);

B.

SELECT prod_category,avg(prod_list_price)

FROM products

GROUP BY prod_category

HAVING avg(prod_list_price)>ANY(SELECTmax(prod_list_price)/2FROM productsGROUPBY prod_category);

C.

SELECT prod_category,avg(prod_list_price)

FROM products

HAVING avg(prod_list_price)<ALL (SELECTmax(prod_list_price)/2FROM productsGROUPBY prod_category);

D.

SELECT prod_category,avg(prod_list_price)

FROM products

GROUP BY prod_category

HAVING avg(prod_list_price)>ANY(SELECTmax(prod_list_price)/2FROM products);

149

View theExhibits and examine the structures of the COSTS and PROMOTIONS tables.Evaluate the following SQL statement:

SELECT prod_id FROM costs

WHERE promo_id IN (SELECT promo_idFROM promotionsWHERE promo_cost<ALL (SELECTMAX(promo_cost)FROM promotions

GROUP BY (promo_end_date - promo_begin_date)));

Whatwould be the outcome of the above SQL statement?

A. Itdisplays prod IDs in the promo with the lowest cost.

B. Itdisplays prod IDs in the promos with the lowest cost in the same time interval.

C. Itdisplays prod IDs in the promos with the highest cost in the same timeinterval.

D. It displays prod IDs in the promos with cost less than thehighest costin the sametimeinterval.

150  minus   intersect

View theExhibit and examine the data in the PROMOTIONS table. You need to display allpromo categories that do not have 'discount' in their subcategory. Whichtwo SQL statements givethe required result? (Choose two.) 你需要显示所有promo分类(在它们子分类中没有discount)

A.

SELECT promo_categoryFROM promotions

MINUS

SELECT promo_categoryFROM promotionsWHERE promo_subcategory = 'discount';

B.

SELECT promo_categoryFROM promotions

INTERSECT

SELECT promo_categoryFROM promotionsWHERE promo_subcategory='discount';

C.

SELECT promo_categoryFROM promotions

MINUS

SELECT promo_categoryFROM promotionsWHERE promo_subcategory<>'discount';

D.

SELECT promo_categoryFROM promotions

INTERSECT

SELECT promo_categoryFROM promotionsWHERE promo_subcategory <> 'discount';

151

View the Exhibit and examine the structure ofthe CUSTOMERS and CUST_HISTORY tables. The CUSTOMERS table contains thecurrent location of allcurrently active customers. The CUST_HISTORY table stores historicaldetails relating to anychangesin the location of all current as well as previous customers who areno longer active with thecompany. You need tofindthose customers who have never changed their address. WhichSET operator would youuse to get the required output? 你需要发现哪些customers从未改变过他们的地址?

A. MINUS

B. UNION

C. INTERSECT

D. UNION ALL

152

Whichstatement is true regarding the UNION operator?

A. Bydefault, the output is not sorted.默认的输出是不排序的X

B. NULL values are not ignored during duplicate checking.在重复行的检查过程中null值不能跳过。

C. Namesof all columns must be identical across all SELECT statements. 跨所有select语句的所有的列名必须同一的的X

D. The number of columns selected in all SELECTstatements need not be the same. 在所有的select语句中选定的列名不一定是一样的?

Union和union all的区别有二:是否消除重复的行;是否进行排序(前者进行排序)

153

View theExhibits and examine the structures of the PRODUCTS and SALES tables. Whichtwo SQL statements wouldgive thesameoutput? (Choose two.)

A.

SELECT prod_idFROM products

INTERSECT

SELECT prod_idFROM sales;

B.

SELECT prod_id FROM products

MINUS

SELECT prod_id FROM sales;

C.

SELECTDISTINCT p.prod_id

FROM products pJOIN sales s

ON p.prod_id=s.prod_id;

D.

SELECT DISTINCT p.prod_id

FROM products p JOIN sales s

ON p.prod_id<> s.prod_id;

如果products和sales中的prod_id都对应相同,则B的结果为空,而D的结果不为空。

154

View theExhibit and evaluate structures of the SALES, PRODUCTS, and COSTS tables.Evaluate the following SQL statement:

SELECT prod_id FROM products

INTERSECT

SELECT prod_id FROM sales

MINUS

SELECT prod_id FROM costs;

Whichstatement is trueregarding the above compound query?

A. Itproduces an error.

B. Itshows products that were sold and have a cost recorded.

C. It shows products thatwere sold but have no cost recorded.

D. It shows products that have a cost recorded irrespective of sales.

三个集合操作符的优先级相同。

155

Evaluatethe following SQL statement:

SELECT promo_id, promo_categoryFROM promotionsWHERE promo_category='Internet'ORDERBY 2 DESC

UNION

SELECT promo_id, promo_categoryFROM promotionsWHERE promo_category='TV'

UNION

SELECT promo_id, promo_categoryFROM promotionsWHERE promo_category='Radio

Whichstatement is true regarding the outcome of the above query?

A. Itexecutes successfully and displays rows in the descending order ofPROMO_CATEGORY.

B. Itproduces an error because positional notation cannot be used in the ORDER BYclause with SET operators.

C. Itexecutes successfully but ignores the ORDER BY clause because it is not locatedat the end of the compound statement.

D. It produces an errorbecause the ORDER BY clause should appear only at the end of a compoundquery-that is, with the last SELECT statement.

156

Evaluatethe following SQL statement:评估下面sql语句

SELECT cust_id, cust_last_name"Last Name"FROM customersWHERE country_id=10

UNION

SELECT cust_id CUST_NO, cust_last_nameFROM customersWHERE country_id=30;

Which ORDER BY clauses are valid forthe above query? (Choose all that apply.)

A. ORDER BY 2,1

B. ORDERBY CUST_NO

C. ORDER BY 2,cust_id

D. ORDERBY "CUST_NO"

E. ORDER BY "Last Name"

B,最后的结果集中不会有CUST_NO列,因为它与第一个查询的对应的列名不同,会使用第一个查询中的列名

157

View theExhibit and examine the structure of the ORDERS and CUSTOMERS tables. Evaluatethe following SQL command:

SELECT o.order_id, c.cust_name, o.order_total, c.credit_limit

FROM orders o JOIN customers c USING(customer_id)

WHERE o.order_total> c.credit_limitFORUPDATE

ORDER BY o.order_id;

Which two statements are true regarding theoutcome of the above query? (Choose two.)

A. It locks all the rows thatsatisfy the condition in the statement.它锁定满足语句中条件的所有行

B. Itlocks only the columns that satisfy the condition in both the tables.

C. The locks are releasedonly when a COMMIT or ROLLBACK is issued.commitrollback发起时释放

D. Thelocks are released after a DML statement       is executed on the locked rows.

158

Whichstatements are trueregarding the FOR UPDATE clause in a SELECT statement? (Choose all that apply.)

A. Itlocks only the columns specified in the SELECT list.

B. It locks the rows that satisfy the condition in the SELECTstatement.

C. Itcan be used only in SELECT statements that are based on a single table.

D. It can be used in SELECT statements that are based on a single ormultiple tables.

E. After itis enforced by a SELECT statement, no other query can access the same rowsuntil a COMMIT or ROLLBACK is issued.

E,查询还是可以查询的。

159

View theExhibit and examine the structure of the CUSTOMERS table.

NEW_CUSTOMERSis a new table with the columns CUST_ID, CUST_NAME and CUST_CITY that have thesame data types and sizeas the corresponding columns in the CUSTOMERS table. Evaluate the followingINSERT statement:\

INSERT INTO new_customers (cust_id, cust_name, cust_city)

VALUES(SELECT cust_id,cust_first_name ||cust_last_name,cust_cityFROM customers WHERE cust_id>23004);

TheINSERT statement failswhen executed. What could be the reason?

A. The VALUES clause cannotbe used in an INSERT with a subquery.insert中的values条件不能使用一个子查询。

B. Columnnames in the NEW_CUSTOMERS and CUSTOMERS tables do not match.

C. TheWHERE clause cannot be used in a subquery embedded in an INSERT statement.

D. Thetotal number of columns in the NEW_CUSTOMERS table does not match the totalnumber of columns in the CUSTOMERS table.

160

View theExhibit and examine the structure of ORDERS and CUSTOMERS tables. There isonly one customer withthe cust_last_namecolumn having valueRoberts.Which INSERT statementshould be used to add a row into the ORDERS table for the customer whoseCUST_LAST_NAME is Roberts and CREDIT_LIMIT is 600?

A.

INSERTINTO ordersVALUES (1,'10-mar-2007', 'direct',

(SELECTcustomer_idFROM customersWHERE cust_last_name='Roberts'AND credit_limit=600), 1000);

B.

INSERT INTO orders (order_id,order_date,order_mode,

(SELECT customer_idFROM customersWHERE cust_last_name='Roberts'AND credit_limit=600),order_total)

VALUES(1,'10-mar-2007','direct',&&customer_id,1000);

C.

INSERT INTO (SELECT o.order_id, o.order_date,o.order_mode,c.customer_id, o.order_total

FROM orders o, customers c

WHERE o.customer_id= c.customer_idAND c.cust_last_name='Roberts' ANDc.credit_limit=600)

VALUES (1,'10-mar-2007','direct',(SELECT customer_idFROM customers WHERE cust_last_name='Roberts'AND credit_limit=600),1000);

D.

INSERT INTO orders (order_id,order_date,order_mode,

(SELECT customer_idFROM customersWHERE cust_last_name='Roberts'AND credit_limit=600),order_total)

VALUES(1,'10-mar-2007','direct',&customer_id,1000);

161

View theexhibit and examine the descriptionfor the SALES and CHANNELS tables. You issued the following SQL statement toinsert a row in the SALES table:你发起下列sql语句在sales表中插入行

INSERT INTO sales VALUES (23,2300,SYSDATE, (SELECT channel_idFROM channelsWHERE channel_desc='Direct Sales'),12,1,500);

Whichstatement is true regarding the execution of the above statement?

A. The statement will executeand the new row will be inserted in the SALES table.

B. Thestatement will fail because subquery cannot be used in the VALUES clause.

C. The statementwill fail because the VALUES clause is not required with subquery.

D. Thestatement will fail because subquery in the VALUES clause is not enclosed within single quotation marks .

162

View theExhibit and examine the structure of the PRODUCTS, SALES, and SALE_SUMMARY tables. SALE_VW is a view createdusing the following command :

CREATE VIEW sale_vw AS SELECTprod_id,SUM(quantity_sold) QTY_SOLDFROM sales GROUPBY prod_id;

Youissue the following command to add a row to the SALE_SUMMARY table :

INSERT INTO sale_summary x,x,xSELECT prod_id, prod_name, qty_sold FROM sale_vwJOIN productsUSING(prod_id)WHERE prod_id=16;

What isthe outcome?

A. Itexecutes successfully.

B. Itgives an error because a complex view cannot be used to add data into theSALE_SUMMARY table.

C. Itgives an error because the column names in the subquery and the SALE_SUMMARYtable do not match.

D. It gives an error because the number of columns to be inserteddoes not match with the number of columns in the SALE_SUMMARY table.他给出一个错误,因为被插入的列的数量不能匹配(sale_summary表中的列的数量)

163

View theExhibit and examine the description for the CUSTOMERS table. You want toupdate theCUST_CREDIT_LIMIT columnto NULL for all thecustomers, whereCUST_INCOME_LEVELhasNULL in theCUSTOMERS table. Which SQL statement will accomplish the task?

A. UPDATE customers SET cust_credit_limit=NULL WHERE CUST_INCOME_LEVEL=NULL;

B. UPDATE customersSET cust_credit_limit= NULL WHERE cust_income_levelISNULL;

C. UPDATE customers SET cust_credit_limit=TO_NUMBER(NULL)WHERE cust_income_level=TO_NUMBER(NULL);

D. UPDATE customers SET cust_credit_limit=TO_NUMBER(' ',9999)WHERE cust_income_level ISNULL;

164

View theExhibit and examine the structure of CUSTOMERS and SALES tables. Evaluate thefollowing SQL statement:评估下列SQL语句

UPDATE (SELECT prod_id, cust_id, quantity_sold, time_idFROM sales)SET time_id='22-MAR-2007'

WHERE cust_id = (SELECT cust_idFROM customersWHERE cust_last_name='Roberts'AND credit_limit=600);

Whichstatement is trueregarding the execution ofthe above UPDATE statement?

A. Itwould not execute because two tables cannot be used in a single UPDATEstatement.

B. Itwould not execute because the SELECT statement cannot be used in place of thetable name.

C. It would execute and restrict modifications to only the columnsspecified in the SELECT statement.它将执行,限制修改(在select语句中指定的列)

D. Itwould not execute because a subquery cannot be used in the WHERE clause of anUPDATE statement.

165

View theExhibit and examine the description for the CUSTOMERS table.

You wantto update the CUST_INCOME_LEVELand CUST_CREDIT_LIMIT columns for the customer with theCUST_ID 2360. You wantthe value for theCUST_INCOME_LEVELto have the same value as that of the customer with theCUST_ID 2560 and the CUST_CREDIT_LIMIT to havethe same value as that of the customer withCUST_ID 2566. Which UPDATE statement willaccomplish the task?

A.

UPDATE customersSET cust_income_level= (SELECT cust_income_levelFROM customers WHERE cust_id = 2560),

cust_credit_limit = (SELECT cust_credit_limitFROM customersWHERE cust_id = 2566)

WHERE cust_id=2360;

B.

UPDATE customersSET(cust_income_level,cust_credit_limit)=

(SELECTcust_income_level, cust_credit_limitFROM customersWHERE cust_id=2560OR cust_id=2566)

WHERE cust_id=2360;

C.

UPDATE customersSET(cust_income_level,cust_credit_limit)=

(SELECT cust_income_level, cust_credit_limitFROM customersWHERE cust_idIN(2560,2566)

WHERE cust_id=2360;

D.

UPDATE customersSET(cust_income_level,cust_credit_limit)=

(SELECT cust_income_level, cust_credit_limitFROM customersWHERE cust_id=2560AND cust_id=2566)

WHERE cust_id=2360;

166

View theExhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables.

You wantto update the EMPLOYEES table as follows:你想更新employees表如下:

-Update only those employees who workin Boston or Seattle (locations 2900 and 2700).更新哪些在bostonseattle29002700的员工

-Setdepartment_id for these employees to the department_id corresponding to London(location_id  2100). 设置部门id为london的id

-Set theemployees' salary in location_id  2100 to1.1 times the average salary of their department. 设置员工他们部门平均工资的1.1倍

-Set theemployees' commission佣金 inlocation_id 2100 to 1.5 times the average commission of their department.

Youissue the following command:

UPDATE employeesSET department_id= (SELECT department_idFROM departments WHERE location_id=2100),

(salary, commission)=(SELECT1.1*AVG(salary),1.5*AVG(commission)FROM employees, departments  WHERE departments.location_idIN(2900,2700,2100))

WHERE department_idIN(SELECT department_id  FROM departmentsWHERE location_id=2900OR location_id=2700)

What isthe outcome?

A. It executessuccessfully and gives the correct result.

B. It executes successfully but does not give the correct result.

C. Itgenerates an error because a subquery cannot have a join condition in an UPDATEstatement.

D. Itgenerates an error because multiple columns (SALARY, COMMISION) cannot bespecified together in an UPDATE statement.

167

Evaluatethe following DELETE statement: DELETE FROM sales; There areno other uncommitted transactions on the SALES table.Which statement istrueabout the DELETE statement?

A. Itwould not remove the rows if the table has a primary key.

B. Itremoves all the rows as well as the structure of the table.

C. It removes all the rows inthe table and deleted rows can be rolled back.

D. Itremoves all the rows in the table and deleted rows cannot be rolled back.

168

View theExhibit and examine the description of SALES and PROMOTIONS tables. You want todelete rows from the SALES table, where the PROMO_NAME column in the PROMOTIONStable haseither blowoutsale oreverydaylow price as values. Which DELETE statements arevalid? (Choose all that apply.)你想从sales表中删除行,promotions表中的promo_name列

A.

DELETE FROM sales

WHERE promo_id = (SELECT promo_idFROM promotionsWHERE promo_name='blowout sale')AND promo_id=

(SELECT promo_idFROM promotionsWHERE promo_name='everyday low price');

B.

DELETEFROM sales

WHERE promo_id= (SELECT promo_idFROM promotions WHERE promo_name= 'blowout sale') OR promo_id=

(SELECT promo_idFROM promotionsWHERE promo_name = 'everyday low price');

C.

DELETEFROM sales

WHERE promo_idIN (SELECT promo_idFROM promotions WHERE promo_name= 'blowout sale'OR promo_name = 'everyday low price');

D.

DELETEFROM sales

WHERE promo_idIN (SELECT promo_idFROM promotions WHERE promo_nameIN ('blowout sale','everyday low price'));

169

View theExhibit and examine the description for the PRODUCTS and SALES table. PROD_ID is a primary keyin the PRODUCTS table and foreign key in the SALES table. You want to removeall the rows from thePRODUCTStable for whichno salewas done for thelast three years. Which is thevalid DELETE statement?

A. DELETE FROM products WHERE prod_id=(SELECT prod_idFROM salesWHERE time_id-3*365=SYSDATE);

B. DELETE FROM products WHERE prod_id=(SELECT prod_idFROM salesWHERESYSDATE>= time_id-3*365);X肯定大

C. DELETE FROM products WHERE prod_id  IN (SELECT prod_id FROM salesWHERE SYSDATE - 3*365>= time_id);//销售日期>3年的的prod_id

D. DELETE FROM products WHERE prod_idIN(SELECT prod_idFROM salesWHERE time_id>=SYSDATE-3*365);销售日期在3年之内的prod_id

170

Whichtwo statements are true regarding the DELETE and TRUNCATE commands? (Choose two.)关于delete和truncate命令描述正确的

A. DELETE can be used to remove only rows from only one table at atime.delete可以用于去删除一个表行,一次。

B. DELETEcan be used to remove only rows from multiple tables at a time.

C. DELETEcan be used only on a table that is a parent of a referential integrityconstraint.

D. DELETEcan be used to remove data from specific columns as well as complete rows.

E. DELETE and TRUNCATE can be used ona table that is a parent of a referential integrity constraint having ON DELETErule . deletetruncate命令可以用于一个表(父表,关联完整型约束,用ondelete规则)

E,就是指ONDELETE CASCADEONDELETE SET NULL

171

Whichthree statements/commands would cause a transaction to end? (Choose three.)哪些语句或命令引起一个事务结束

A. COMMIT提交

B. SELECT

C. CREATE   DDL

D. ROLLBACK回滚

E. SAVEPOINT

172

The SQLstatements executed in auser session are as follows:

CREATE TABLE product (pcodeNUMBER(2), pnameVARCHAR2(10));创建表

INSERT INTO product VALUES (1,'pen');插入数据

INSERT INTO product VALUES (2,'pencil'); 插入数据

SAVEPOINT a;保存点a

UPDATE product SET pcode =10WHERE pcode=1;更新1

SAVEPOINT b;保存点b

DELETE FROM product WHERE pcode=2;删除2

COMMIT;提交

DELETE FROM product WHERE pcode=10;

Which two statements describe the consequences ofissuing the ROLLBACK TO SAVE POINT a command in the session? (Choose two.)哪两个语句描述发起rollback to save point命令的结果

A. The rollback generates an error.已提交回滚无效

B. No SQL statements are rolled back.

C. Onlythe DELETE statements are rolled back.

D. Onlythe second DELETE statement is rolled back.

E. Both the DELETE statements and the UPDATEstatement are rolled back.

执行完commit语句后,保存点a已经被释放。

173

Whendoes a transaction complete? (Choose all that apply.)事务完成

A. whena DELETE statement is executed

B. when a ROLLBACK command is executed回滚命令执行

C. whena PL/SQL anonymous block is executed

D. when a data definition language ( DDL) statement is executed  DDL语句执行

E. when a TRUNCATE statement isexecuted after the pending transaction

TRUNCATE语句为DDL语句。

174

Whichstatement is true regarding transactions? (Choose all that apply.)

A. Atransaction can consist only of a set of DML and DDL statements.

B. A part or an entire transaction can be undone by using ROLLBACKcommand.部分或一个完整的事务可以通过使用rollback命令来进行undo

C. A transaction consists of a set of DML or DCL statements.一个事务可以有DMLDCL语句构成

D. Apart or an entire transaction can be made permanent with a COMMIT.

E. A transaction can consist of only a set ofqueries or DML or DDL statements.

175

Whichtwo statements are true regarding savepoints? (Choose two.)

A. Savepointsare effective only for COMMIT.

B. Savepoints may be used to ROLLBACK. 保存点用于回滚

C. Savepoints can be used for only DML statements. 保存点用于DML语句

D. Savepointsare effective for both COMMIT and ROLLBACK.

E. Savepointscan be used for both DML and DDL statements.

oracle 0-5-1-中文注解相关推荐

  1. linux7.0安装oracle乱码,Oracle Linux 7设置中文字符集

    常安装Linux系统本着最简化安装,会默认使用英文字符集,不会安装中文字符集等其他字符.但是在一些必要情况下需要中文的支持,本文将演示如何在Oracle Linux7在安装中文字符集 1.首先使用lo ...

  2. 差分优化算法(DE)matlb源码中文注解

    来源: DE(差分进化)优化算法MATLAB源码详细中文注解 - CSDN博客 https://blog.csdn.net/u013337691/article/details/53018827?lo ...

  3. bartlett 算法 matlab,GWO(灰狼优化)算法MATLAB源码逐行中文注解(转载)

    以优化SVM算法的参数c和g为例,对GWO算法MATLAB源码进行了逐行中文注解. tic % 计时器 %% 清空环境变量 close all clear clc format compact %% ...

  4. FA(萤火虫算法)MATLAB源码详细中文注解

    以优化SVM算法的参数c和g为例,对FA(萤火虫算法)MATLAB源码进行了逐行中文注解. 完整程序和示例文件地址:http://download.csdn.net/detail/u013337691 ...

  5. GWO(灰狼优化)算法MATLAB源码逐行中文注解

    以优化SVM算法的参数c和g为例,对GWO算法MATLAB源码进行了逐行中文注解. 完整程序和示例文件地址:http://download.csdn.net/detail/u013337691/962 ...

  6. GWO(灰狼优化)算法MATLAB源码逐行中文注解()

    以优化SVM算法的参数c和g为例,对GWO算法MATLAB源码进行了逐行中文注解. tic % 计时器 %% 清空环境变量 close all clear clc format compact %% ...

  7. TogetherEC 6.3审计功能简单中文注解

    Together 6.3 for Eclipse 3.0这个插件非常有用.我花了点时间看了Audits功能的docs,没有全部翻译,做了一些简单的中文注解.贴上来跟大家共享一下.这些条款中有一些对我们 ...

  8. CS(布谷鸟搜索)算法MATLAB源码逐行中文注解

    以优化SVM算法的参数c和g为例,对CS算法MATLAB源码进行了逐行中文注解. 完整程序和示例文件地址:http://download.csdn.net/detail/u013337691/9622 ...

  9. 在Oracle中添加的中文变成靠靠靠...

    如果安装的ORACLE字符集为非中文字符集(例如WE8ISO8859P1),使用System.Data.OracleClient作为驱动插入的中文字符串会全部变成"靠靠靠"之类的怪 ...

  10. JAVA中文注解驱动,解决api接口返回的json里面出现中文乱码的问题

    在src/main/resources/springmvc-servlet.xml中加入 <!-- 中文注解驱动 --> <mvc:annotation-driven>< ...

最新文章

  1. 静态切割窗体+关联对话框
  2. HTML全面深入学习-select的optgroup分组
  3. 浏览器加载和渲染html的顺序
  4. 计算机除法和取余在实际运用中的意义
  5. Java中避免if-else-if:策略模式
  6. wizard generated application - how is detail page rendered
  7. 你遇到的面试官是「伯乐」吗?
  8. unity自动生成敌人_Unity 3D做2D坦克大战--敌人自动攻击AI编写
  9. 支付系统设计:支付系统的账户模型(一)
  10. BI报表分析和数据可视化,推荐这三个开源工具!
  11. 苏宁公布双11战报:全渠道订单量增长76% 物流发货完成率达99.6%
  12. 虚拟机Ubuntu20.04.2LTS卸载python3.8出现tty1-tty6循环登录,无法进入图形化界面,乱码(亲测)
  13. mysql默认密码是多少_192.168.3.1默认登录密码是多少【详细介绍】
  14. FZU 2080 最大差值 二维单调队列(甚是巧妙……)
  15. java nginx 重启吗_Nginx的启动、停止、平滑重启
  16. XGBoost和GBDT的区别与联系
  17. 如何将.frm,.MYD,.MYI文件导入数据库
  18. 无需剪辑软件,教你简单快速进行剪辑视频
  19. Date.now()和new.Date().getTime()的区别
  20. android10(Q) API29下,通过getDeviceId()方法获取imei 报错的处理办法

热门文章

  1. 为什么java下载安装程序很慢_【关注】微信小程序开发和APP开发的10种区别!
  2. html选项卡切换代码,js实现简单的可切换选项卡效果
  3. 深度学习AI打电话检测算法
  4. 3个A级学科专业,不愧是中国电气工程师的“摇篮”
  5. 遇上好心的电影售票员
  6. 离散余弦DCT域的数字水印
  7. Mediaplay 的理解 与使用方法
  8. 小米 红米6 线刷兼救砖_解账户锁_纯净刷机包_教程
  9. 富贵不压重发_俗语“贵人不顶重发”,聪明的脑袋不长毛,真是这样吗?
  10. 用户增长是什么?和数据分析有啥关系?