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)
You might also like to view...
The tables or queries that provide the underlying data for a form or report
a. Record source b. Source table c. Source data
If you need to sort the records contained in a report, you can do so from either the design view or the ________ of the report
A) Print preview B) Layout View C) Design View D) Report view