GoConqr has a new look! Let us know what you think.

Quiz

barcos1-100

efraim vallejo 100 questions

Take the quiz

Questions in this quiz (100)

  1. 1Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET operator such as UNION?
    1. AEach SELECT statement in the compound query must have its own ORDER BY clause.
    2. BEach SELECT statement in the compound query can have its own ORDER BY clause.
    3. CColumn positions must be used in the ORDER BY clause.
    4. DThe first column in the first SELECT of the compound query with the UNION operator is used by
      default to sort output in the absence of an ORDER BY clause.
    5. EOnly column names from the first SELECT statement in the compound query are recognized.
  2. 2View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables.
    You need to create a view that displays the ORDER_ID, ORDER_DATE, and the total number of items in each order.

    Which CREATE VIEW statement would create the view successfully?
    Image for question 2
    1. ACREATE OR REPLACE VIEW ord_vuAS SELECT o.order_id, o.order_date, COUNT(i.line_item_id)FROM orders o JOIN order_items iON (o.order_id = i.order_id)GROUP BY o.order_id,o.order_date;
    2. BCREATE OR REPLACE VIEW ord_vu (order_id, order_date)AS SELECT o.order_id, o.order_date, COUNT(i.line_item_id)"NO OF ITEMS"FROM orders o JOIN order_items iON (o.order_id = i.order_id)GROUP BY o.order_id, o.order_date;
    3. CCREATE OR REPLACE VIEW ord_vuAS SELECT o.order_id, o.order_date, COUNT(i.line_item_id)"NO OF ITEMS"FROM orders o JOIN order_items iON (o.order_id = i.order_id)GROUP BY o.order_id,o.order_date;
    4. DCREATE OR REPLACE VIEW ord_vuAS SELECT o.order_id, o.order_date, COUNT(i.line_item_id)||'NO OF ITEMS'FROM orders o JOIN order_items iON (o.order_id = i.order_id)GROUP BY o.order_id,o.order_dateWHITH CHECK OPTION;
  3. 3Which two statements are true regarding multiple-row subqueries? (Choose two.)
    1. AThey can contain group functions.
    2. BThey always contain a subquery within a subquery.
    3. CThey use the < ALL operator to imply less than the maximum.
    4. DThey can be used to retrieve multiple rows from a single table only.
    5. EThey should not be used with the NOT IN operator in the main query if NULL is likely to be a part of
      the result of the subquery.
  4. 4Which two queries execute successfully?
    1. ASELKCT COALESCE (100, 'A') FROM DUAL;
    2. BSELECT NULLIF(NULL, 100) FROM DUAL;
    3. CSELECT COALESCE(100, NULL, 200) FROM DUAL;
    4. DSELECT NULLIF (100) FROM DUAL;
    5. ESELECT NULLIF (100, ‘A') FROM DUAL;
  5. 5You must create a SALES table with these column specifications and data types:
    SALESID: Number STOREID: Number ITEMID: Number
    QTY: Number, should be set to 1 when no value is specified

    SLSDATE: Date, should be set to current date when no value is specified

    PAYMENT: Characters up to 30 characters, should be set to CASH when no value is specified Which statement would create the table? (Choose the best answer.)
    1. ACREATE TABLE sales(salesid NUMBER(4),storeid NUMBER(4),itemid NUMBER(4),qty NUMBER
      DEFAULT = 1,slsdate DATE DEFAULT SYSDATE,payment VARCHAR2(30) DEFAULT =
      "CASH")
    2. BCREATE TABLE sales(salesid NUMBER(4),storeid NUMBER(4),itemid NUMBER(4),qty NUMBER
      DEFAULT 1,slsdate DATE DEFAULT 'SYSDATE',payment VARCHAR2(30) DEFAULT CASH);
    3. CCREATE TABLE sales(salesid NUMBER(4),storeid NUMBER(4),itemid NUMBER(4),qty NUMBER
      DEFAULT = 1,slsdate DATE DEFAULT SYSDATE,payment VARCHAR2(30) DEFAULT =
      "CASH");
    4. DCREATE TABLE sales(salesid NUMBER(4),storeid NUMBER(4),itemid NUMBER(4),qty NUMBER
      DEFAULT 1,slsdate DATE DEFAULT SYSDATE,payment VARCHAR2(30) DEFAULT 'CASH');
  6. 6Which two statements are true regarding constraints? (Choose two.)
    1. AA constraint is enforced only for an INSERT operation on a table.
    2. BA foreign key cannot contain NULL values.
    3. CA column with the UNIQUE constraint can store NULLS.
    4. DYou can have more than one column in a table as part of a primary key.
  7. 7View the Exhibit and examine the structure of the ORDER_ITEMS table.
    You must select the ORDER_ID of the order that has the highest total value among all the orders in the ORDER_ITEMS table.

    Which query would produce the desired result?
    Image for question 7
    1. ASELECT order_idFROM order_itemsGROUP BY order_idHAVING SUM(unit_price*quantity) = (SELECT MAX(SUM(unit_price*quantity))FROM order_items GROUP BY order_id);
    2. BSELECT order_idFROM order_itemsWHERE(unit_price*quantity) = (SELECT MAX(unit_price*quantity)FROM order_items)GROUP BY order_id;
    3. CSELECT order_idFROM order_itemsWHERE(unit_price*quantity) = MAX(unit_price*quantity)GROUP BY order_id;
    4. DSELECT order_idFROM order_itemsWHERE (unit_price*quantity) = (SELECT MAX(unit_price*quantity)FROM order_itemsGROUP BY order_id)
  8. 8SCOTT is a user in the database.
    Evaluate the commands issued by the DBA:

    Which statement is true regarding the execution of the above commands?
    Image for question 8
    1. AStatement 1 would not execute because the WITH GRANT option is missing.
    2. BStatement 2 would not execute because system privileges and object privileges cannot be granted together in a single GRANT command.
    3. CStatement 3 would not execute because role and system privileges cannot be granted together in a single GRANT statement.
    4. DStatement 1 would not execute because the IDENTIFIED BY <password> clause is missing.
  9. 9View the exhibit and examine the data in ORDERS_MASTER and MONTHLY_ORDERS tables

    Evaluate the following MERGE statement: MERGE_INTO orders_master o
    USING monthly_orders m ON (o.order_id = m.order_id) WHEN MATCHED THEN
    UPDATE SET o.order_total = m.order_total
    DELETE WHERE (m.order_total IS NULL)
    WHEN NOT MATCHED THEN
    INSERT VALUES (m.order_id, m.order_total);
    What would be the outcome of the above statement?
    Image for question 9
    1. AThe ORDERS_MASTER table would contain the ORDER_IDs 1, 2, 3 and 4.
    2. BThe ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 4.
    3. CThe ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 3.
    4. DThe ORDERS_MASTER table would contain the ORDER_IDs 1 and 2.
  10. 10View the Exhibit and examine the structure of the CUSTOMERS table.

    Which statement is true regarding the outcome of the above query?
    Image for question 10
    1. AIt returns an error because the BETWEEN operator cannot be used in the HAVING clause.
    2. BIt returns an error because WHERE and HAVING clauses cannot be used in the same SELECT statement.
    3. CIt returns an error because WHERE and HAVING clauses cannot be used to apply conditions on the same column.
    4. DIt executes successfully.

Information

Description
Quiz on barcos1-100, created by efraim vallejo on 19/01/2021.
Language
English
Views
3
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?