Examine the description PRODUCTS table:
Examine the description of the NEW_PRODUCTS table:
Which two queries execute successfully?
Examine the description PRODUCTS table:
Examine the description of the NEW_PRODUCTS table:
Which two queries execute successfully?
To determine which queries execute successfully, the structure and compatibility of the columns in each SELECT statement must be examined. Query A will fail because it attempts to SELECT different numbers of columns in the UNION ALL operation. Query B will execute successfully because it selects matching columns with compatible data types. Query C will fail due to an incorrect number of result columns. Query D will fail due to data type mismatch in the INTERSECT operation. Query E will execute successfully because it selects all columns from both tables, which are compatible in this context.
B,E create table products (prod_id char(2), prod_name char(4), exp_date timestamp(6)); create table new_products (prod_id char(4), prod_name varchar2(10), exp_date DATE); /*A NOOK 01789. 00000 - "query block has incorrect number of result columns"*/ SELECT prod_id FROM products UNION ALL SELECT prod_id, prod_name FROM new_products; /*B OK.*/ SELECT prod_id, exp_date FROM products UNION ALL SELECT prod_id, NULL FROM new_products; /*C NOOK 01789. 00000 - "query block has incorrect number of result columns"*/ SELECT * FROM products MINUS SELECT prod_id FROM new_products; /*D NOOK 01790. 00000 - "expression must have same datatype as corresponding expression"*/ SELECT prod_id, prod_name FROM products INTERSECT SELECT 100, prod_name FROM new_products; /*E OK*/ SELECT * FROM products UNION SELECT * FROM new_products;
BE Correct. Tested Thanks Santi.
BE correct. Please update these answers
BE tested
BE correct
BE correct
BE is correct D is not correct since the data types does not match
B, E is correct; but D also executes successfully!!