Which of the following queries/statements will result in an error message? Why? (Use tables created in the Chapter 4 Lab Activity)

1. SELECT LastName, FirstName FROM student;
2. SELECT DeptId, * FROM dept;
3. INSERT INTO dept VALUES (77, RESEARCH, NULL, NULL);
4. UPDATE employee
SET DeptId = 88
WHERE EmployeeId = 111;
5. DELETE FROM dept WHERE DeptId = 10;


1.
SQL> SELECT LastName, FirstName FROM student;
SELECT LastName, FirstName FROM student
*
ERROR at line 1:
ORA-00904: "FIRSTNAME": invalid identifier
(no such columns)
2.
SQL> SELECT DeptId, * FROM dept;
SELECT DeptId, * FROM dept
*
ERROR at line 1:
ORA-00936: missing expression
(cannot use column name and * together)
3.
SQL> INSERT INTO dept VALUES (77, RESEARCH, NULL, NULL);
INSERT INTO dept VALUES (77, RESEARCH, NULL, NULL)
*
ERROR at line 1:
ORA-00984: column not allowed here
(word RESEARCH must be enclosed within single quotes)
4.
SQL> UPDATE employee
2 SET DeptId = 88
3 WHERE EmployeeId = 111;
UPDATE employee
*
ERROR at line 1:
ORA-02291: integrity constraint (SYSTEM.EMPLOYEE_DEPTID_FK)
violated – parent key not found
(DeptId 88 does not exist in dept table)
5.
SQL> DELETE FROM dept WHERE DeptId = 10;
DELETE FROM dept WHERE DeptId = 10
*
ERROR at line 1:
ORA-02292: integrity constraint (SYSTEM.EMPLOYEE_DEPTID_FK)
violated – child record found
(department cannot be deleted, there are employees in department
10)

Computer Science & Information Technology

You might also like to view...

The try statement may have an optional __________ clause which must appear after all of the catch clauses.

a. try-again b. finally c. default d. abort

Computer Science & Information Technology

________ is NOT an option available in the Drop Cap dialog box

A) Number of lines to drop B) The letter for the drop cap initial C) The size of the drop cap initial D) How far from the text the drop cap displays

Computer Science & Information Technology

The ________ paradigm is most efficient for processing words and languages.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following statements is false?

a. The min function’s documentation states that min has two required parame-ters (named arg1 and arg2) and an optional third parameter of the form *args, indicating that the function can receive any number of additional argu-ments. b. The following is a valid call to function min min(88) c. The * before the parameter name *args in Part (a) tells Python to pack any remaining arguments into a tuple that’s passed to the args parameter. d. All of the above statements are true.

Computer Science & Information Technology