Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说
oracle ocp ocm_SQL题库,希望能够帮助你!!!。
QUESTION 6
Which two statements are true regarding constraints? (Choose two)
A. A constraint is enforced only for an INSERT operation on a table.
B. A foreign key cannot contain NULL values.
C. A column with the UNIQUE constraint can store NULLS.
D. You can have more than one column in a table as part of a primary key.
答案:CD
解析:约束constraints:
QUESTION 7
Evaluate the following statement.
INSERT ALL WHEN order_total < 10000 THEN INTO small_orders WHEN order_total >10000 AND order_total < 20000 THEN INTO small_orders WHEN order_total > AND order_total < 20000 THEN INTO small_orders SELECT order_id order_total,customer_id FROM orders;
Which statement is true regarding the evaluation of rows returned by the subquery in the INSERT statement?
A. They are evaluated by all the three WHEN clauses regardless of the results of the evaluation of any other WHEN clause.
B. They are evaluated by the first WHEN clause. If the condition is true, then the row would be evaluated by the subsequent WHEN clauses.
C. They are evaluated by the first WHEN clause. If the condition is false, then the row would be evaluated by the subsequent WHEN clauses.
D. The insert statement would give an error because the ELSE clause is not present for support in case none of WHEN clauses are true.
答案:A
解析:条件多表INSERT语句,注意点:
QUESTION 8
Examine the structure of the MEMBERS table:
Name NULL? Type ------------------ -------------- ---------------- MEMBER NOT NULL VARCHAR2(6) FIRST_NAME VARCHAR2(50) LAST_NAME NOT NULL VARCHAR2(50) ADDREDD VARCHAR2(50) CITY VARCHAR2(25) STATE
You want to display details of all members who reside in states starting with the letter A followed by exactly one character.
Which SQL statement must you execute?
A. SELECT * FROM MEMBERS WHERE state LIKE '%A_';
B. SELECT * FROM MEMBERS WHERE state LIKE 'A_';
C. SELECT * FROM MEMBERS WHERE state LIKE 'A_%';
D. SELECT * FROM MEMBERS WHERE state LIKE 'A%';
答案:B
解析:通配符:
QUESTION 9
You want to display 5 percent of the rows from the SALES table for products with the lowest MOUNT_SOLD and also want to include the rows that have the same AMOUNT_SOLD even if this causes the output to exceed 5 percent of the rows.
Which query will provide the required result?
A. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES;
B. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS ONLY WITH TIES;
C. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES ONLY;
D. SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS ONLY;
答案:A
解析:使用FETCH来指定SELECT语句返回的行数限制,FETCH子句,注意点:
QUESTION 10
Examine the structure of the MEMBERS table:
Name NULL? Type ------------------ -------------- ---------------- MEMBER NOT NULL VARCHAR(6) FIRST_NAME VARCHAR(50) LAST_NAME NOT NULL VARCHAR(50) ADDREDD VARCHAR(50)
You execute the SQL statement:
SQL > SELECT member_id, ' ' , first_name, ' ' , last_name "ID FIRSTNAME LASTNAME" FROM members;
What is the outcome?
A. It fails because the alias name specified after the column names is invalid.
B. It fails because the space specified in single quotation marks after the first two column names is invalid.
C. It executes successfully and displays the column details in a single column with only the alias column heading.
D. It executes successfully and displays the column details in three separate columns and replaces only the last column heading with the alias.
答案:D
解析:SELECT可以通过加引号(' ')命名新的列,并对该列的每列赋值引号中的内容。
后续陆续更新,转载请注明出处。
本人水平有限,欢迎指正。
今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
上一篇
已是最后文章
下一篇
已是最新文章