Oracle 1z0-051 Exam Practice Questions (P. 4)
- Full Access (290 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #16
Examine the structure of the STUDENTS table:

You need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.
Which SQL statement accomplishes this task?

You need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.
Which SQL statement accomplishes this task?
- ASELECT student_ id, marks, ROWNUM "Rank"FROM studentsWHERE ROWNUM <= 10AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99AND course_id = 'INT_SQL'ORDER BY marks DESC;
- BSELECT student_id, marks, ROWID "Rank"FROM studentsWHERE ROWID <= 10AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99'AND course_id = 'INT_SQL'ORDER BY marks;
- CSELECT student_id, marks, ROWNUM "Rank"FROM (SELECT student_id, marksFROM studentsWHERE ROWNUM <= 10AND finish_date BETWEEN '01- JAN-99' AND '31-DEC-99'AND course_id = 'INT_SQL'ORDER BY marks DESC);
- DSELECT student_id, marks, ROWNUM "Rank"FROM (SELECT student_id, marksFROM studentsWHERE (finish_date BETWEEN ’01-JAN-99 AND ’31-DEC- 99AND course_id = INT_SQLORDER BY marks DESC)WHERE ROWNUM <= 10 ;
- ESELECTstudent id, marks, ROWNUM "Rank"FROM(SELECT student_id, marksFROM studentsORDER BY marks)WHEREROWNUM <= 10ANDfinish date BETWEEN 01-JAN-99 AND 31-DEC-99ANDcourse_id = INT_SQL;
Correct Answer:
D
D
send
light_mode
delete
Question #17
Evaluate the following SQL statements:
Exhibit:

Exhibit:

The above command fails when executed. What could be the reason?
Exhibit:

Exhibit:

The above command fails when executed. What could be the reason?
- AThe BETWEEN clause cannot be used for the CHECK constraint
- BSYSDATE cannot be used with the CHECK constraint
- CORD_NO and ITEM_NO cannot be used as a composite primary key because ORD_NO is also the FOREIGN KEY
- DThe CHECK constraint cannot be placed on columns having the DATE data type
Correct Answer:
B
CHECK Constraint -
The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions:
References to the CURRVAL, NEXTVAL, LEVEL, and ROWNUM pseudocolumns
Calls to SYSDATE, UID, USER, and USERENV functions
Queries that refer to other values in other rows
A single column can have multiple CHECK constraints that refer to the column in its definition.
There is no limit to the number of CHECK constraints that you can define on a column.
CHECK constraints can be defined at the column level or table level.
CREATE TABLE employees -
(...
salary NUMBER(8,2) CONSTRAINT emp_salary_min
CHECK (salary > 0),
B
CHECK Constraint -
The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions:
References to the CURRVAL, NEXTVAL, LEVEL, and ROWNUM pseudocolumns
Calls to SYSDATE, UID, USER, and USERENV functions
Queries that refer to other values in other rows
A single column can have multiple CHECK constraints that refer to the column in its definition.
There is no limit to the number of CHECK constraints that you can define on a column.
CHECK constraints can be defined at the column level or table level.
CREATE TABLE employees -
(...
salary NUMBER(8,2) CONSTRAINT emp_salary_min
CHECK (salary > 0),
send
light_mode
delete
Question #18
Evaluate the following SQL statements:
DELETE FROM sales;
There are no other uncommitted transactions on the SALES table.
Which statement is true about the DELETE statement?
DELETE FROM sales;
There are no other uncommitted transactions on the SALES table.
Which statement is true about the DELETE statement?
- AIt removes all the rows as well as the structure of the table
- BIt removes all the rows in the table and deleted rows cannot be rolled back
- CIt removes all the rows in the table and deleted rows can be rolled back
- DIt would not remove the rows if the table has a primary key
Correct Answer:
C
C
send
light_mode
delete
Question #19
Examine the structure of the EMPLOYEES table:

You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below:

Which INSERT statement meets the above requirements?

You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below:

Which INSERT statement meets the above requirements?
- AINSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
- BINSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50));
- CINSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
- DINSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION)VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
- EINSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
Correct Answer:
D
D
send
light_mode
delete
Question #20
Which two statements are true regarding constraints? (Choose two.)
- AA constraint can be disabled even if the constraint column contains data
- BA constraint is enforced only for the INSERT operation on a table
- CA foreign key cannot contain NULL values
- DAll constraints can be defined at the column level as well as the table level
- EA column with the UNIQUE constraint can contain NULL values
Correct Answer:
AE
Including Constraints -
Constraints enforce rules at the table level.
Constraints prevent the deletion of a table if there are dependencies.
The following constraint types are valid:
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
CHECK
AE
Including Constraints -
Constraints enforce rules at the table level.
Constraints prevent the deletion of a table if there are dependencies.
The following constraint types are valid:
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
CHECK
send
light_mode
delete
All Pages