071-新增2

  1. Examine the data in the CUSTOMERS table: CUSTNO CUSTNAME CITY ------------- --------------- ---------------- 1 KING SEATTLE 2 GREEN BOSTON 3 KOCHAR SEATTLE 4 SMITH NEW YORK You want to list all cities that have more than one customer along with the customer details.Evaluate the following query:
    SQL>SELECT c1.custname, c1.city FROM Customers c1 ____________Customers c2 ON(c1.city=c2.city AND c1. custname<>c2. custname);
    Which two JOIN options can be used in the blank in the above query to give the correct output?
    A)JOIN
    B) NATURAL JOIN
    C) LEFT OUTER JOIN
    D) FULL OUTER JOIN
    E) RIGHT OUTER JOIN

  2. View the Exhibit and examine the description of SALES and PROMOTIONS tables. You want to delete rows from the SALES table, where the PROMO_NAME column in the PROMOTIONS table has either blowout sales or everyday low price as values Which three DELETE statements are valid?
    A) DELETE FROM sales WHERE promo_ id = (SELECT promo_ id FROM promotions WHERE promo_name = "blowout sale’ AND promo_ id = (SELECT promo_ id FROM promotions WHERE promo_name= ‘everyday low price’);
    B) DELETE FROM sales WHERE promo_ id =(SELECT promo_ id FROM promotions WHERE promo_name = "blowout sale’ OR promo_ id = (SELECT promo_ id FROM promotions WHERE promo_name= ‘everyday low price’);
    C) DELETE FROM sales WHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo_name =‘blowout sale’ OR promo_name= ‘everyday low price’);
    D) DELETE FROM sales WHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo_ name IN (‘blowout sale’,‘everyday low price’));

两个条件是 or,要不这个要不那个

  1. Which two statements are true regarding subqueries? (Choose two.)
    A) Only two subqueries can be placed at one level.
    B) A subquery can be used to access data from one or more tables or views.
    C) If the subquery returns 0 rows, then the value returned by the subquery expression is NULL

    D) The columns in a subquery must always be qualified with the name or alias of the table used.
    E) A subquery in the WHERE clause of a SELECT statement can be nested up to three levels only.

  2. View the Exhibit and examine the data in the PROMOTIONS table. PROMO BEGIN DATE is stored in the default date format, dd-mon-rr. You need to produce a report that provides the name, cost, and start date of all promos in the POST category that were launched before January 1, 2000. Which SQL statement would you use?
    A) SELECT promo name, promo_ cost, promo_begin_date FROM promotions WHERE promo_ category=‘post’ AND promo_begin_date < ‘01-01-00’;
    B) SELECT promo_ name, promo_cost, promo_ begin_ date FROM promotions WHERE promo cost LIKE ‘post%’ AND promo_begin_date< ‘01 01 2000’;
    C) SELECT promo_ name, promo_cost, promo_begin_date FROM promotions WHERE promo_category LIKE ‘p%’ AND promo_begin_date < ‘1-JANUARY-00’;
    D) SELECT promo_name, promo_cost, promo_begin_date FROM promotions WHERE promo_category LIKE ‘%post%’ AND promo_begin_date< ‘1-JAN-00’;

日期格式类型的转换问题

你可能感兴趣的:(Oracle)