Which of the following can be used to remove data from a table? (Choose two.)
DELETE
UPDATE
What is one of the purposes of DDL? (Choose the best answer.)
Issue privileges to users
When transforming an ERD into a relational database, you often use an entity to build a database's:
Table
Which of the following topics are not included in the SQL Fundamentals I exam but are addressed on the SQL Associate exam? (Choose all that apply.)
FLASHBACK
MERGE
External tables
The 1Z0-071 exam (which is the subject of this book) has been officially validated by Oracle Corporation against which of the following versions of the Oracle database? (Choose all that apply.)
12c
11g
If you focus on trying to achieve the minimum passing grade requirement for the exam, you can study more efficiently.
False
Which of the following is not a capability of the SELECT statement?
It can remove data from a table.
The unique identifier of a row in a database table is a(n):
Primary key
Which of the following is true of SQL?
It is the most commonly used language for interacting with a database.
What can a SELECT statement be used to query? (Choose the best answer.)
One or more tables
The best exam guide you could possibly get for preparing to take and pass the 1Z0-071 certification exam, SQL Associate, is which of the following? (Choose all that apply.)
(Choose all that apply.)
What can you use to submit SQL statements for execution? (Choose all that apply.)
What is the displayed output of the SELECT statement?
3.142
no bookmarked, confident, or note marked
Question 5 :The difference between dropping a column from a table with DROP and setting a column to be UNUSED is:
The UNUSED column and its data are retained within the table's storage allocation and counts against the total limit on the number of columns the table is allowed to have.
no bookmarked, confident, or note marked
Question 6 :You are logged in to user FINANCE. It is currently the only schema in the entire database. The following exist in the database:
A VIEW named VENDORS
A CONSTRAINT named VENDORS
An INDEX named CUSTOMER#ADDRESS
You attempt to execute the following SQL statement:
Which of the following SQL statements will remove the word VALID from row 1, resulting in one row with a status of NULL and two rows with a status of PENDING?
In the SHIPS table, SHIP_NAME has a data type of VARCHAR2(20). All other columns are NUMBER. Now consider the following query (note that line numbers have been added for readability):
Assume that all table and column references exist within the database. What can be said of this SELECT statement?
The rows will sort in order by SHIP_ID in ascending order and then by CAPACITY in descending order.
Consider the following text:
DEFINE vRoomNumber
PROMPT"Enter a room number: "SELECTROOM_NUMBER,STYLE,WINDOWFROMSHIP_CABINSWHEREROOM_NUMBER=&RNBR;
What will happen when this script is executed?
The end user will be prompted to enter a number.
To list all the currently defined variables, use:
DEFINE
Which if the following is true of the ORDER BY clause? (Choose two.)
It can sort rows based on data that isn't displayed as part of the SELECT statement.
It is optional.
Assume you have a table ITEMS that includes a column STATUS. Which of the following statements is syntactically correct? (Choose all that apply.)
SELECT*FROMITEMSFETCHNEXT20%ROWSONLY;
Assume all table name and column name references in the SQL statement that follows are valid. That being said, what is wrong with the syntax of the following SQL statement?
You are tasked to create a SELECT statement to subtract five months from the hired date of each employee in the EMPLOYEES table. Which function will you use?
Operates independently of the ORDER BY in the SELECT statement
Lesson-6 Quiz
You are tasked to create a report that displays the hours and minutes of the current date in a report. Which of the following will satisfy this requirement?
TO_CHAR(SYSDATE, 'HH:MI')
Which of the following SQL statements will display the current time, in hours, minutes, and seconds, as determined by the operating system on which the database server resides?
SELECT TO_CHAR(SYSDATE, 'HH:MI:SS') FROM DUAL;
Which format mask returns the local currency symbol?
You are tasked to calculate the average number of alarm incidents per day in ALARM_HISTORY. You know the following query is syntactically correct:
SELECTAVG(INCIDENTS)FROMALARM_HISTORY;
However, you are aware that the value for INCIDENTS might be NULL, and you want the AVG returned to be calculated across every day in ALARM_HISTORY, not just the non-NULL days. Which of the following queries will achieve this goal?
SELECT AVG(NVL(INCIDENTS,0)) FROM ALARM_HISTORY;
You need to determine the day of the week for a particular date in the future. Which function will reveal this information?
It will fail to execute because it mixes scalar and aggregate data in the select list.
Which of the following is true about aggregate functions? (Choose two.)
Return one value for each group of rows specified in a SELECT statement.
Are also called group functions.
Which of the following aggregate functions ignores NULL values in its calculations? (Choose all that apply.)
Choose all that apply
Review the following illustration:
Figure A
Your assignment: create a SELECT statement that queries the PROJECTS table to show the average project cost for each PURPOSE. You know there are only two values for PURPOSE in the table: 'Upgrade' and 'Maintenance'. You want to restrict rows where DAYS is greater than 3. Which of the following SELECT statements will perform this task? SELECT PURPOSE, AVG(PROJECT_COST) FROM PROJECTS WHERE DAYS > 3 GROUP BY PURPOSE;
Which of the following aggregate functions can be used on character data? (Choose two.)
Recall that the 'Q' format model is for quarter, so TO_CHAR using a DATE data type with the 'Q' format mask is translating the date into the quarter in which it falls—1, 2, 3, or 4. Given that, which of the following statements is true of the SQL statement?
It will execute and show the number of orders in the CRUISE_ORDERS table for each quarter in the year 2009.
What will happen if you try to execute this query on the PROJECTS table?
It will succeed and display one row.
Which of the following statements is true about HAVING? (Choose two.)
It must occur after the WHERE clause.
It can be used only in the SELECT statement
Review the following illustration:
Figure A
Your task is to define a SELECT statement that groups rows according to their value for PURPOSE and, for each purpose, adds up the values stored in DAYS. Which one of the following queries will perform this task?
SELECT SUM(DAYS), PURPOSE FROM PROJECTS GROUP BY PURPOSE;
Review the following illustration:
Figure A
Which of the following SQL statements will execute correctly?
SELECT RANK(100000) WITHIN GROUP (ORDER BY PROJECT_COST) FROM PROJECTS;
Which of the following statements is true for this SQL statement?
It will include only those groups of rows for a given SHIP_ID with an average value of PROJECT_COST less than 500000.
Lesson-8 Quiz
Review the following illustration:
Figure A
Which of the following is a syntactically correct outer join query? (Choose two.)
SELECT VENDOR_NAME, INVOICE_DATE FROM VENDORS RIGHT OUTER JOIN INVOICES ON VENDORS.VENDOR_ID = INVOICES.VENDOR_ID;
SELECT VENDOR_NAME, INVOICE_DATE FROM VENDORS LEFT JOIN INVOICES ON VENDORS.VENDOR_ID = INVOICES.VENDOR_ID;
You have two tables. One table is called CUSTOMERS. Another is called PURCHASES, and it records a list of customer transactions. Your goal is to create a SELECT statement that will show all customers by last name in alphabetical order, along with any purchases they may have made in the past two weeks, as recorded in the PURCHASES table. It’s possible that many customers have made no purchases in the past two weeks, but you still want them included in the output. Both tables contain a column called CUSTOMER_ID. Which of the following will be true of the SELECT statement you’ll need to create? (Choose two.)
It will be an outer join.
It will be an equijoin.
Review the following illustration:
Figure A
Which of the following is a valid self-join statement? (Choose all that apply.)
SELECT P1.POSITION_ID, P1.MIN_SALARY, P1.MAX_SALARY FROM POSITIONS P1 SELF JOIN POSITIONS P2 ON P1.REPORTS_TO = P2.POSITION_ID;
Which of the following is true for the SQL statement? (Choose two.)
It will execute successfully
It connects three tables.
A table alias: (Choose two.)
Can be used to clear up ambiguity in the query.
Exists only for the SQL statement that declared it.
An inner join queries from two tables (looking at values in columns and optionally using expressions that reference columns) and compares the resulting values in one set of rows with the resulting values in another set of rows, looking for:
Values that match
Lesson-9 Quiz
Which of the following can a correlated subquery be used in? (Choose three.)
The FROM clause of a DELETE statement
Which of the following is a true statement?
A SELECT statement with a GROUP BY may use a subquery to return a value to the outermost WHERE clause.
Which of the following can a subquery be used in? (Choose all that apply.)
A GRANT statement
An inline view is a form of a subquery.
True
Which of the following forms of subquery never returns more than one row?
Scalar
Review the following illustration and the SQL code:
The code is attempting to delete any row in the PORTS table that is not a home port for any ship in the SHIPS table, as indicated by the HOME_PORT_ID column. In other words, only keep the PORTS rows that are currently the HOME_PORT_ID value for a ship in the SHIPS table; get rid of all other PORT rows. That’s the intent of the SQL statement. What will result from an attempt to execute the preceding SQL statement?
It will fail because of a syntax error on line 2.
Another name for an EXISTS query is:
Semijoin
Review the following illustration:
Figure A
Which of the following statements, when executed, will result in an error?
SELECT WITH SHIPPER_INFO AS (SELECT SHIP_ID FROM SHIPS) SELECT PORT_ID, SHIPPER_INFO.SHIP_ID FROM PORTS, SHIPPER_INFO;
WITH (SELECT SHIP_ID FROM SHIPS) SELECT PORT_ID FROM PORTS;
When is a query considered a multirow subquery? (Choose the best answer.)
If it returns multiple rows at the time of execution
Which of the following comparison operators can be used with a multiple-row subquery? (Choose two.)
IN
>= ALL
Which subquery includes references to the parent query and thus cannot execute as a standalone query? (Choose the best answer.)
A correlated subquery
The WITH clause can be used to name a subquery. Which of the following is also true? (Choose two.)
The name of the subquery can be used in the SELECT statement following the WITH clause.
The name of the subquery can be joined to other tables in the SELECT statement following the WITH clause.
Review this WORK_HISTORY table:
Figure A
Your task is to create a query that will list—for each ship—all of the EMPLOYEE_ID values for all the employees who have the shortest work history for their ship. In other words, if there are two ships, you want to list all the employees assigned to the first ship who have the shortest work history, all the employees assigned to the second ship who have the shortest work history, and so on. Which of the following queries will accomplish this task? (Choose two.)
SELECT EMPLOYEE_ID FROM WORK_HISTORY W1 WHERE ABS(START_DATE - END_DATE) <= ALL (SELECT ABS(START_DATE - END_DATE) FROM WORK_HISTORY WHERE SHIP_ID = W1.SHIP_ID);
SELECT EMPLOYEE_ID FROM WORK_HISTORY W1 WHERE ABS(START_DATE - END_DATE) = (SELECT MIN(ABS(START_DATE - END_DATE)) FROM WORK_HISTORY WHERE SHIP_ID = W1.SHIP_ID);
A correlated subquery:
Cannot be executed as a standalone query
Review the given PORTS and SHIPS tables:
Figure A
Your team is tasked with the job of creating a list of the ships with the least capacity in each port. In other words, each ship has a home port. For each port that is a home port to ships, which of each port’s ships has the least capacity? Your team produces the following query in answer to this task:
You know that there are five rows in the SHIPS table with a length greater than 900. What will result from an attempt to execute this SQL statement?
An execution error will result because the subquery will return more than one row and the parent query is expecting only one row from the subquery.
Which of the following problems can be solved with a subquery? (Choose the two best answers.)
You are tasked with determining which divisions in a corporation earned sales last year that were less than the average sales for all divisions in the prior year.
The PORTS table has 15 rows. The SHIPS table has 20 rows. Each row in PORTS has a unique value for PORT_ID. Each PORT_ID value is represented in the HOME_PORT_ID column of at least one row of the SHIPS table. What can be said of this UPDATE statement?
The value for CAPACITY will increase once for each of the 15 rows in the PORTS table.
The SELECT statement will fail because you cannot reference the CURRVAL pseudocolumn of a sequence until after you have referenced NEXTVAL for the sequence in a session.
Assuming there are no objects already in existence named SUPPLIES_01 or SUPPLIES_02 prior to the execution of the preceding statements, what database objects will result from these statements?
A table called SUPPLIES_02 and an index called IX_SU_02
The database object that stores lookup information to speed up querying in tables is:
INDEX
An invisible index is an index on one or more columns in a table:
And is updated for any DELETE statements performed on the table
Which of the following keywords cannot be used with the CREATE SEQUENCE statement?
JOIN
Choose the best answer from the choices below. An index:
May improve the performance of an UPDATE statement that uses a WHERE clause, if the WHERE clause performs an equality comparison on an indexed column in a table
What statement will recover the PO_BOXES table after these statements are executed?
None of these—the table cannot be recovered.
Review this code:
DROPTABLESHIPSCASCADECONSTRAINTS;DROPSEQUENCEPROJ_ID_SEQ#;CREATETABLESHIPS(SHIP_IDNUMBERPRIMARYKEY,LENGTHNUMBER);CREATESEQUENCEPROJ_ID_SEQ# STARTWITH1INCREMENTBY4;INSERTINTOSHIPS(SHIP_ID,LENGTH)VALUES(PROJ_ID_SEQ#.NEXTVAL,'NOT A NUMBER');INSERTINTOSHIPS(SHIP_ID,LENGTH)VALUES(PROJ_ID_SEQ#.NEXTVAL,750);COMMIT;
Note that the first INSERT statement is attempting to enter a string literal of 'NOT A NUMBER' into a column declared with a numeric data type. Given that, what will be the result of these SQL statements?
One row added to the SHIPS table, with a SHIP_ID value of 5.
Which of the following statements could be added as line 11 and recover the deleted rows from the PO_BOXES table?
FLASHBACK TABLE PO_BOXES TO TIMESTAMP SYSTIMESTAMP—INTERVAL '0 00:00:45' DAY TO SECOND;
Lesson-11 Quiz
Which of the following statements about set operators is true? Choose the best answer.
You can connect two SELECT statements with one set operator.
You are tasked with cleaning up a database application. There are two tables in the database: ORDERS contains completed ORDERS, and ORDER_RETURNS contains duplicate information for all ORDERS that were later returned. Your goal is to find out whether any rows in ORDER_RETURNS exist that were never in the ORDERS table to begin with. Which of the following set operators should you use?
MINUS
Review the following illustrations, as well as the ONLINE_SUBSCRIBERS table in Figure 11-3.
Which of the following are true about this SQL statement? (Choose two.)
The statement is syntactically correct and will execute successfully
The B.LAST_ORDER reference at the end of line 6 refers to data included in the ADDED column referred to in line 5.
When combining two SELECT statements, which of the following set operators will produce a different result, depending on which SELECT statement precedes or follows the operator?
MINUS
The ORDER BY clause can be included in a SELECT with set operators if:
What will happen when this SQL statement is executed?
It will execute successfully.
Lesson-12Quiz
You are tasked to work with a view. The view's underlying table has been altered. What information can the data dictionary provide at this point? (Choose all correct answers.)
Choose all correct
Which of the following actions will not cause the contents of the data dictionary to be changed in some way?
None of these
The USER_CONSTRAINTS view in the data dictionary lists FOREIGN KEY constraints in the CONSTRAINT_TYPE column with which of the following single-letter abbreviations?
R
The data dictionary is owned by:
SYS
Now you have changed the purpose of the PIER column in the MARINA table and want to remove the comment you just created in the previous question. Which of the following statements will remove the comment?
COMMENT ON COLUMN MARINA.PIER IS '';
When you're looking for a particular bit of data and you're not sure where in the data dictionary it might be, a good starting point is: (Choose the best answer.)
SELECT * FROM DICTIONARY;
Which of the following data dictionary views does not have an OWNER column?
USER_TABLES
One place to get a master list of all the views that form the data dictionary is:
DICTIONARY
You need to get information about columns in a table you do not own, nor do you have privileges to it. Which view can you query to get this information?
DBA_TAB_COLUMNS
You are tasked with querying the data dictionary view that lists only those sequences to which you currently have privileges but don't necessarily own. To do this, you log in to your own user account and query the data dictionary view called:
ALL_SEQUENCES
If an ALTER TABLE ... DROP COLUMN statement is executed against an underlying table upon which a view is based, the status of that view in the data dictionary changes to:
INVALID
The term metadata means:
Data about data
You can add your own comments to the data dictionary with the COMMENT statement using which of the following? (Choose two.)
TABLE
COLUMN
You are tasked with the job of adding a comment to the data dictionary to accompany the column PIER in the table MARINA. Which of the following will execute successfully?
COMMENT ON COLUMN MARINA.PIER IS 'Number of piers';
Which among the following is considered an acceptable query with V$DATAFILE?
A query that displays rows from the table with no joins
If one of the INTO clauses executed on a table and resulted in a constraint violation on that table, what would result?
The row would not be inserted, the INSERT statement would stop, and all rows affected by the INSERT statement would be rolled back, as if the INSERT statement had never been executed.
What can an INSERT statement do? (Choose two.)
Add data into more than one column in a table
Add rows into more than one table
Review the following diagrams:
Figure A
Figure B
You want to merge rows from the PORT_INVENTORY table into the SHIP_INVENTORY table. You start with the following SQL statement:
Which one of the following answers correctly identifies data that, if present in the SPARES table, will be inserted by this conditional INSERT statement into the table—or tables—identified by the answer?
PART_NO = 170; PART_NAME = 'TRA-OPS,' in STORE_INVENTORY
The MERGE statement includes a USING clause. Which of the following statements is not true of the USING clause?
The USING clause is optional.
Which of the following statements is false?
It is possible to merge into two or more tables.
Lesson-14Quiz
Assume a database with three valid users: NEIL, BUZZ, and MICHAEL. Assume all users have the appropriate privileges they require to perform the tasks shown here. Assume NEIL owns a table called PROVISIONS. Examine the following code (assume all password references are valid):
What object is identified in line 11 by the name PROVISIONS?
The synonym created in line 10
Your user account owns an updatable view, BACKLOG, which is based on the table PROJECTS. You are tasked to give SELECT and UPDATE capabilities to another user account named MARINO. Currently, MARINO has no privileges on either the table or the view. You want for MARINO to have the ability to grant SELECT on the view to other users as well. Examine the following SQL code:
The statements will execute successfully and perform as intended.
You are logged in to user account FRED and have been tasked with granting privileges to the user account ETHEL. You execute the following SQL statements:
Assuming both statements execute successfully, what is the result?
ETHEL does not have the system privilege CREATE ANY TABLE or the right to grant the CREATE ANY TABLE system privilege to any other user.
Which of the following is the system privilege that empowers the grantee to create an index in his or her own user account but not in the accounts of others?
CREATE TABLE
Which of the following is the system privilege that is required as a minimum to allow a user account to log in to the database?
CREATE SESSION
Which of the following SQL statements will authorize the user account JESSE to create tables in each and every user account in the database?
GRANT CREATE ANY TABLE TO JESSE;
Which of the following statements will grant the role OMBUDSMAN to user JOSHUA in such a way that JOSHUA may grant the role to another user?
GRANT OMBUDSMAN TO JOSHUA WITH ADMIN OPTION;
User account MUSKIE owns a table called CBAY. Which of the following statements can be executed by MUSKIE and enable user ONEILL to execute UPDATE statements on the CBAY table? (Choose two.)
GRANT INSERT, UPDATE ON CBAY TO ONEILL;
GRANT ALL ON CBAY TO ONEILL;
User HARDING owns a table TEAPOT. User HARDING then executes the following SQL statements to give access to the table to user ALBERT:
Which of the following statements can user ALBERT now execute on the TEAPOT table?
SELECT * FROM HARDING.TEAPOT;
What can be granted to a role? (Choose all that apply.)
None of these
Examine the following two claims about the DBA_TAB_PRIVS data dictionary view:
Lists system privileges granted to a current user
Describes all object grants in the database
Which of these claims is true?
Only 2
Your user account owns a table BACK_ORDERS, and you want to grant privileges on the table to a user account named CARUSO, which already has the system privileges CREATE SESSION and UNLIMITED TABLESPACE. Examine the following SQL statement:
GRANTSELECTONBACK_ORDERSTOCARUSO;
Once this statement has been executed, which of the following statements will be true for user CARUSO?
CARUSO will have SELECT privileges on BACK_ORDERS but not the ability to give other users SELECT privileges on BACK_ORDERS.
Which of the following data dictionary views contains information about grants on tables that have been made by other users to your user account, as well as grants on tables that have been made by your user account to other user accounts?
USER_TAB_PRIVS
A role:
Can be created by a user only if that user has the CREATE ROLE system privilege
You have a table FURNISHINGS and are told to grant DELETE privileges on the table to user HEARST. Examine the following SQL statements:
Now you are told to change the privileges given to HEARST so that HEARST can no longer execute DELETE statements on the FURNISHINGS table. Which of the following will accomplish the goal? (Choose the best answer.)
REVOKE DELETE ON FURNISHINGS FROM HEARST, MGR;
Final Test
Review the following exhibit:
Table: teachers
Class
teacher_name
student_count
1
Franks
20
2
SimMs
20
3
AddAms
30
4
frEEmaN
15
5
YouNG
30
Which of the following queries will correctly return the row for all teachers who's name starts with an f, regardless of case?
Select teacher_name from teachers where upper(teacher_name) like 'F%';
Review the structure/data contained in two tables. The first table is called people and the second table is called people_history. The structure of both tables is the same as seen here:
people_num
number
primary_key
Record_add_date
Date
Not null
People_history_date
Date
Which of the following queries will return all rows from both tables where the people_history_date is in the year 2017?
select * from people where to_char(people_history_date, 'yyyy')='2017' union select * from people_history where to_char(people_history_date, 'yyyy')='2017';
Which of the following statements are true of a correlated subquery?
It performs column-by-column analysis in cooperation with the parent query.
Which data dictionary view would you query if you wanted to find the column that are contained in a database view?
DBA_TAB_COLS
no bookmarked, confident, or note marked
Question 5 :Review the following exhibit:
Table Name: USER_PAGE_COUNTS
user_id
Action_Date
page_count
1
12/01/2016
5
2
12/01/2016
50
3
12/01/2016
100
4
12/01/2016
70
1
12/02/2016
12
2
12/02/2016
34
3
12/02/2016
65
2
12/03/2016
26
4
12/03/2016
43
3
12/04/2016
65
2
12/04/2016
26
4
12/04/2016
43
1
12/05/2016
175
Which SQL statement will provide the maximum page count for each user in the user_page_counts table?
select user_id,max(page_count) max_page_count
from user_page_counts
group by user_id;
When writing a SQL statement, which clause can be used to create a temporary result set?
with
Which of the following functions returns a number value?
INSTR
You run the following query from the SQL prompt:
SQL> select sysdate from dual;
and get the following results:
SYSDATE---------13-NOV-17
You want the output to look like the following:
SYSDATE-------------------11/13/201713:09:10
Which of the following SQL statements will create the output you desire?
select to_char(sysdate, 'mm/dd/yyyy hh24:mi:ss') "SYSDATE" from dual;
Which of the following SQL statements will successfully create a table?
Create table employees
( emp_num number primary key,
Emp_last_name varchar2(30),
Emp_first_name varchar2(30),
Stores_store_num number,
Dept_dept_num number,
Emp_supervisor number)
Tablespace user_data;
Which of the following statements are true with regards to a multitable insert? (Choose two.)
A multitable insert statement can conditionally insert data into multiple tables.
A multitable insert statement can replace and perform better than PL/SQL routines
no bookmarked, confident, or note marked
Question 11 :Review the following exhibit: create index ix_emp on scott.emp(job) invisible tablespace index; Which of the following statements is true regarding the create index statement above?
The DDL will successfully create an invisible index, which will be ignored by the optimizer by default.
When issuing a SQL statement, if you wish to sort the rows in a specific order which of the following clauses would you use?
Order by
Which of the following statements is true about DDL statements in Oracle (choose all that apply)
DDL statements can not be rolled back.
The create table statement is one type of DDL statement.
Which of the following are valid types of constraints that can be defined when creating a table? (select all that apply)
Unique
Primary key
Which of the following are types of subqueries? (select all that apply)
Single row
Multiple row
Correlated
no bookmarked, confident, or note marked
Question 16 :
Which of the following options does not describe the purpose of a set operation?
Each correct answer represents a complete solution. Choose all that apply.
Set operators can only include result sets with number and varchar2 datatypes.
Long data types are supported by all set operations
Which of the following is used to include or exclude rows from a query that involves a grouping function?
having
Which of the following SQL statements will display all records in the EMP table as they looked at noon on 11/3/2017?
select * from scott.emp as of timestamp to_timestamp('11/03/2017 12:00:00','mm/dd/yyyy hh24:mi:ss');
Which of the following statements will create an index that the Oracle optimizer will ignore, by default, when parsing a SQL statement?
create index ix_emp on employee(hiredate) tablespace users invisible;
Review the following exhibit:
SQL> desc scott.emp
Name Null? Type
--------------------------------------------------------------EMPLOYEE_IDNUMBEREMPLOYEE_NAMEVARCHAR2(61)DEPARTMENT_NAMEVARCHAR2(30)HIRE_DATEVARCHAR2(10)COMMISSIONNUMBERHIREDATENOTNULLDATE
Which of the following SQL statements will be successful?
insert into emp (employee_id, employee_name, hiredate) values (1,'Freeman', sysdate);
Which of the following statements is a DML statement? (select all that apply)
delete from emp where em_id=5;
insert into emp values (1,'Freeman');
Which of the following is not a type of function available in Oracle Database?
Regression functions
Which of the following update statements will result in an error?
Update employees Set date=01/01/2017;
Which of the following is a valid create table command?
Create table my_table(table_number number);
no bookmarked, confident, or note marked
Question 25 :Which of the following SQL statements will request input from the user?
select *from emp where empno=&1;
Examine the data in the SALES table below:
Sale_number
store_number
sales_date
employee_number
item_number
quantity_sold
1
1
01/02/2017
1234
102
1
1
1
01/02/2017
1234
115
2
2
1
01/02/2017
1500
122
1
2
1
01/02/2017
1500
101
3
3
2
01/02/2017
176
22
2
4
2
01/03/2017
199
43
4
5
1
01/03/2017
1234
108
6
5
1
01/03/2017
1234
102
2
6
4
01/03/2017
1500
300
1
1
1
01/02/2017
1235
114
1
1
1
01/02/2017
1235
118
1
Which query will sort the results first by store_number, sale_number, and sales_date, and then return the first six sorted rows?
select *from(select *
from sales
order by store_number, sale_number, sales_date
)
Where rownum <7;
Which of the following will insert rows in the employee table into the employee_history table with a term_date less than or equal to today's date minus 365 days?
Insert into employee_history select * from employee where term_date <=sysdate-365;
You have a new set of data to load from a staging table into a master table. Some of the new data contains new records to be added to the master table, some of the data contains records to be updated in the master table and there are also records to be removed from the master table.
Which of the following ways of is the most efficient way of updating the master table from the staging table?
You should load the new data into a staging table and then use the merge SQL command to load it into the master table.
Review the following exhibit:
SQL> desc scott.emp
Name Null? Type
------------------------------------------------------------------EMPNONOTNULLNUMBER(4)ENAMEVARCHAR2(10)JOBVARCHAR2(9)MGRNUMBER(4)HIREDATEDATESALNUMBER(7,2)COMMNUMBER(7,2)DEPTNONUMBER(2)SQL> desc scott.dept
Name Null? Type
---------------------------------------------------------------DEPTNONOTNULLNUMBER(2)DNAMEVARCHAR2(14)LOCVARCHAR2(13)
Assume that there is a row in DEPT that does not have an associated record in EMP. Which of the following it true related to such a query?
You will be able to see the department rows that don't have matching emp rows through the use of an outer join.
no bookmarked, confident, or note marked
Question 30 :Review the following figure:
DescribeListen
Figure A
Data in Employees table
Emp_num
emp_last_name
emp_first_name
stores_store_num
dept_dept_num
emp_supervisor
1
Freeman
Robert
1
1
NULL
2
Freeman
Carrie
1
2
NULL
3
Freeman
Amy
2
3
NULL
4
Freeman
Abbie
2
4
NULL
Data in Stores
Store_num
Store_description
1
Oklahoma City
2
Tulsa
3
Dallas
Which of the following SQL statements will fail?
delete from stores where store_num=2;
Which of the following is not an Oracle schema object type?
Transactions
Examine the data in the CLASS table below:
Class
teacher_number
student_count
1
1
20
2
2
20
3
3
30
4
4
15
5
1
30
6
2
35
7
3
22
8
4
14
9
1
30
10
1
22
11
2
30
Which of the following delete statements will remove all of the classes with teachers less than teacher number 4?
delete from class where teacher_number < 4;
Which of the following functions might be used along with a group by clause? (Select all that apply)
distinct
Review the following exhibit:
SQL> select sysdate from dual;SYSDATE---------13-NOV-17SQL> desc scott.emp
Name Null? Type
--------------------------------------------------------------EMPNONOTNULLNUMBER(4)ENAMEVARCHAR2(10)JOBVARCHAR2(9)MGRNUMBER(4)HIREDATEDATESALNUMBER(7,2)COMMNUMBER(7,2)DEPTNONUMBER(2)
and review the following SQL:
SQL> insert into scott.emp(empno, hiredate)values(100,'20-JAN-2017');
Which of the following statements is true about this SQL?
It might be successful if the database date format mask matched that of the date being inserted because of an implicit conversion.
no bookmarked, confident, or note marked
Question 35 :Assume you issue the following command:
delete from payroll where payroll_date>sysdate-1;
What command would reverse the results of this delete?
rollback;
Which of the following functions will take a character string as an argument and then return that character string in a modified form?
All of these
Which of the following statements is true about a self join? (choose all that apply)
option C
A self join will not return duplicate rows.
no bookmarked, confident, or note marked
Question 38 :Examine the data in the CLASS table below:
Class
teacher_number
student_count
1
1
20
2
2
20
3
3
30
4
4
15
5
1
30
6
2
35
7
3
22
8
4
14
9
1
30
10
1
22
11
2
30
Which SQL statement would increase the number of students for class number 3?
update classset student_count=student_count+1
where class=3;
no bookmarked, confident, or note marked
Question 39 :You have just created a user called bsmith. Which command would you execute to grant a privilege that will allow the bsmith account to connect to the database?
Grant create session to bsmith;
Which of the following will correctly format the output of the data column HIRE_DATE column to look like the following in the output: 01/01/2017 14:00:00?
select to_char(hire_date, 'mm/dd/yyyy hh24:mi:ss') from emp;
no bookmarked, confident, or note marked
Question 41 :In which of the following SQL statements might you find a subquery?
All of these
Which of the following DML operations are available when using a merge command (choose all that apply)?
Delete
Insert
option D
Update
Consider this exhibit:
select b.ename, b.sal, a.dname
from scott.dept a, scott.emp b
where a.deptno=b.deptno(+)
order by 1,2;
Which of the following statements is true concerning the SQL statement in the exhibit? (Choose two.)
If an employee is not assigned to a department, they will not appear in the output.
If a department is not assigned to an employee, it will appear in the output.
Which of the following is representative of an analytic function?
avg(sales_amount) over (partition by sales_date order by sales_date) average_sale_by_date
Review the following tables:
SQL> desc scott.emp
Name Null? Type
------------------------------------------------------------------EMPNONOTNULLNUMBER(4)ENAMEVARCHAR2(10)JOBVARCHAR2(9)MGRNUMBER(4)HIREDATEDATESALNUMBER(7,2)COMMNUMBER(7,2)DEPTNONUMBER(2)SQL> desc scott.dept
Name Null? Type
---------------------------------------------------------------DEPTNONOTNULLNUMBER(2)DNAMEVARCHAR2(14)LOCVARCHAR2(13)
Which of the following SQL statements will return the department name (contained in the DEPT.DNAME column) and the average salary (contained in the EMP.SAL column) for that department?
select a.dname, avg(b.sal) from scott.dept a, scott.emp b where a.deptno=b.deptno group by a.dname;
Which of the following would not be a case for the use of a group (or aggregate) function?
Finding all the first names of persons who's last name ended in SMITH and who lived on the west coast.
Examine the data in the SALES table below:
Sale_number
store_number
sales_date
employee_number
item_number
quantity_sold
1
1
01/02/2017
1234
102
1
1
2
01/02/2017
1234
115
2
2
3
01/02/2017
1500
122
1
2
4
01/02/2017
1500
115
3
3
5
01/02/2017
176
22
2
4
1
01/03/2017
199
43
4
5
2
01/03/2017
1234
43
6
5
3
01/03/2017
1234
102
2
6
4
01/03/2017
1500
300
1
Which of the following SQL statements will return the store number and sales date for records in the sales table with a sales_date of 1/2/2017 and for store 1 and store 2? The sales_date should be returned in the form of date and time in the 24 hour format.
Select store_number, to_char(sales_date, 'mm/dd/yyyy hh24:mi:ss') sales_date from sales where sales_date=to_date('01/02/2017','mm/dd/yyyy') and store_number in (1,2);
eview the following exhibit:
DescribeListen
Figure A Which of the following SQL statements will create the following output:
STORE_DESCRIPTIONEMP_LAST_NAMEEMP_FIRST_NAMEDEPT_DESC-----------------------------------------------------------------
Oklahoma City Freeman Robert MGT
Oklahoma City Freeman Carrie Asst. Mgr
Oklahoma City Freeman Amy Floor Supervisor
Oklahoma City Freeman Abbie Sales Assoc
select c.store_description, a.emp_last_name, a.emp_first_name, b.dept_desc
from employees a, stores c, dept b
where a.stores_store_num=c.store_num
and a.dept_dept_num=b.dept_num;
no bookmarked, confident, or note marked
Question 49 :
Review the following exhibit:
DescribeListen
Figure A What kind of join would be required if you want a list of all employees and the department they worked in, including employees that were not assigned to a department?
outer join
Which of the following SQL statements will correctly drop a column called id_2 in a table called id_table?
Alter table id_table drop column id_2;
Which if the following is a type of subquery (choose all that apply):
Scalar subquery
Nested subquery
Which of the following clauses or functions can limit the rows returned by a query? (Choose two.)
rownum
Fetch next rows
no bookmarked, confident, or note marked
Question 53 :Review the following exhibit:
SQL> select * from test;ID----------1234566 rows selected.
Which of the following SQL queries will successfully return 3 records from the test table, starting at the second record and return the result set in the correct order?
Select * from test order by id offset 1 rows fetch next 3 rows only;
Which statement would limit the rowset of a sql statement to no more than 5 rows?
where rownum < 6
Which of the following SQL statements will correctly create a sequence?
Create sequence my_sequence start with 1 increment by -1;
Which of the following statements completes a transaction?
commit
Which of the following is not an analytic function? (choose all that apply)
All of these are analytic functions.
Which of the following is true with respect to using the flashback database command?
The database must be in ARCHIVELOG mode to use the flashback database command.
Use the alter database flashback on command to enable flashback database mode.
Which of the following operators is indicitive of an equijoin?
=
no bookmarked, confident, or note marked
Question 60 :Examine the data in the USER_BIRTHDATE table below:
User_last_name
user_first_name
user_birthdate
Smith
John
09/30/1960
Masters
Elane
07/15/1970
Fredricks
George
08/16/1977
Houston
Sam
01/30/1992
Flur
Candance
02/28/1989
Which option will return all the rows and columns of the table, renaming the user_birthdate column to birthdate?
select user_last_name, user_first_name, user_birthdate birthdate from user_birthdate;
Which of the following is true about a truncate statement (choose all that are correct):
A truncate statement includes an implicit commit.
A truncate statement is considered a DDL statement.
Which of the following is not a valid column datatypes that can be used when creating a table?
LOB
Which of the following statements is true?
scalar subquery is used to return one value, which can be used in lieu of a literal value.
Which of the following statements defines the possible use cases of a subquery? Select all that apply.
A subquery is used to define a set of rows that should be inserted into a table.
A subquery is used to define conditions in a where clause to be applied to the results returned by a select statement.
Which of the following functions can take a character data type as an argument (choose all that apply)
None of these
Which of the following functions are not conversion functions?
Substr
Review the following query:
select a.lname, a.dept_id
from scott.emp a
where a.salary >(select avg(z.sal)
from employees z
where z.dept_id=a.dept_id);
What kind of query is represented in the SQL statement above?
Correlated
Which of the following function will return a date when passed a character argument?
to_date
Review the following exhibit:
select 'true' from dual
where exists(select null from dual);
Which of the following statements is true?
The query will return the value true.
no bookmarked, confident, or note marked
Question 70 :Review the exhibit for a description of the sales table.
Which if the following is a valid insert statement into the sales table?
insert into sales values (6,8,10);
Which statement is used to sort the rows returned by a SQL statement?
order by
Review the following output:
SQL> select * from scott.emp
EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO-------------------------------------------------------------------------------10001/20/20177369SMITHCLERK790212/17/1980800207499ALLENSALESMAN769802/20/19811600300307521WARDSALESMAN769802/22/19811250500307566JONESMANAGER783904/02/19812975207654MARTINSALESMAN769809/28/198112501400307698BLAKEMANAGER783905/01/19812850307782CLARKMANAGER783906/09/19812450107788SCOTTANALYST756604/19/19873000207839KINGPRESIDENT11/17/19815000107844TURNERSALESMAN769809/08/198115000307876ADAMSCLERK778805/23/19871100207900JAMESCLERK769812/03/1981950307902FORDANALYST756612/03/19813000207934MILLERCLERK778201/23/1982130010
Which SQL statement below will return the average salary for each job in the job column, and order it with the highest average salary at the top of the ouptut?
select job, avg(sal) salary from scott.emp group by job order by 2 desc;
Which of the following represent DDL commands?
Create table
What SQL statement will both remove all data from a table as well as reset the high water mark of that table?
truncate
Which clause is used at the end of a SQL statement to aggregate data across multiple records and then group the results?
group by clause
You have a need to insert data from one table, into two different tables. Which is the most efficient way to perform this operation?
Use the Oracle insert all SQL command to insert the data into both tables as the same time.
Which of the following SQL statements will create a view on a table called employee, where the hire_date column is invisible?
create view vw_employee(empid, hd invisible)as select employee_id, hire_date from scott.employee;
no bookmarked, confident, or note marked
Question 78 :
Review the following exhibit:
Table Name: USER_PAGE_COUNTS
user_id
Action_Date
page_count
1
12/01/2016
5
2
12/01/2016
50
3
12/01/2016
100
4
12/01/2016
70
1
12/02/2016
12
2
12/02/2016
34
3
12/02/2016
65
2
12/03/2016
26
4
12/03/2016
43
3
12/04/2016
65
2
12/04/2016
26
4
12/04/2016
43
1
12/05/2016
175
Which of the following SQL statements will produce a report for all users and page counts who had over 100 page_counts on 12/05/2016?
select user_id,sum(page_count)page_counts
from user_page_counts
where action_date=to_date('12/05/2016','mm/dd/yyyy')
Some of the advantages of using time boxes and cycles in project coordination efforts include creating urgency, measuring progress, and allowing for predictable measurements. A) True 2. Even though most project managers are not contract specialists, they need to understand the process well enough to coordinate with the team. For the current assignment, you are looking at a short-term and small effort with a contractor of just a few hours without significant clarity. Which of the following would be the most applicable contract to use in this situation? A) Time and materials 3. The project you are working on has had modifications to the plan from the start and even how the project is run. Project governance covers all of the 3 following except: A) Naming The project manager 4. Of the following, which is most likely a trigger condition defined early in t...
GE---5093-1D2-FA-2021 - Design Thinking Home My courses 2021-FA GE---5093-1D2-FA-2021 Week 1 Reading Quiz 1 Started on Sunday, October 31, 2021, 2:04 PM State Finished Completed on Sunday, October 31, 2021, 2:30 PM Time taken 25 mins 58 secs Grade 8.00 out of 10.00 ( 80 %) Top of Form Question 1 Correct 1.00 points out of 1.00 Flag question Question text A critical finding of Edward Lorenz related to Design Thinking was: Select one: a. An application of the caterpillar effect b. The idea of deterministic chaos or the "Butterfly Effect" c. Business leaders enjoy chaos d. Statistical modeling of weather was fairly accurate in the long term Feedback Your answer is correct. The correct answer is: The idea of deterministic chaos or the "Butterfly Effect" Question 2 Incorrect 0.00 point...
WEEK- 2 code install.packages("dplyr") library(dplyr) Rajeshdf = read.csv('c:\\Insurance.csv') str(Rajeshdf) str(Rajeshdf) summary(Rajeshdf) agg_tbl <- Rajeshdf %>% group_by(Rajeshdf$JOB) %>% summarise(total_count=n(), .groups = 'drop') agg_tbl a = aggregate( x=Rajeshdf$HOME_VAL, by=list( Rajeshdf$CAR_TYPE), FUN=median, na.rm=TRUE ) a QUIZ 2. What famous literary detective solved a crime because a dog did not bark at the criminal? A). Sherlock Holmes 1. In the Insurance data set, how many Lawyers are there? A). 1031 3. What two prefixes does the instructor use for variables when fixing the missing values? Select all that apply. A). IMP_ M_ 4. What is the median Home Value of a person who drives a Van? A). 204139 5. In the insurance data set, how many missing (NA) values does the variable AGE have? A) 7 1. What...
Comments
Post a Comment