List output/message from the following queries/statements. (Use tables created in the Chapter 4 Lab Activity)
1. SELECT First || ‘ ‘ || Last “Name”, BirthDate FROM student;
2. SELECT DISTINCT (MajorId) FROM student;
3. SELECT * FROM location ORDER BY Building, Capacity DESC;
4. SELECT Lname, Fname, (Salary / 12) MONTHLYSALARY FROM employee
ORDER BY MONTHLYSALARY;
5. DELETE FROM faculty WHERE DeptId=2;
1.
SELECT First ||' ' || Last "Name", BirthDate FROM student;
Name BIRTHDATE
------------------------------- ---------
Jose Diaz 12-FEB-83
Mickey Tyler 18-MAR-84
Rajesh Patel 12-DEC-85
Deborah Rickles 20-OCT-70
Brian Lee 28-NOV-85
Amir Khan 07-JUL-84
6 rows selected.
2.
SQL> SELECT DISTINCT (MajorId) FROM student;
MAJORID
----------
100
200
400
500
3.
SQL> SELECT * FROM location ORDER BY Building, Capacity DESC;
ROOMID BUILDIN ROO CAPACITY R
---------- ------- --- ---------- -
11 Gandhi 101 2 O
12 Gandhi 103 2 O
17 Gandhi 105 2 O
21 Gandhi 109 2 O
20 Gandhi 107 2 O
14 Kennedy 204 50 L
18 Kennedy 206 40 L
13 Kennedy 202 35 L
19 Kennedy 210 30 L
15 Nehru 301 50 C
16 Nehru 309 45 C
11 rows selected.
4.
SQL> SELECT Lname, Fname, (Salary / 12) MONTHLYSALARY FROM
2 employee ORDER BY MONTHLYSALARY;
LNAME FNAME MONTHLYSALARY
------------------------------ --------------- -------------
Shaw Jinku 2041.66667
Chen Sunny 2916.66667
Garner Stanley 3750
McCall Alex 5541.66667
Roberts Sandi 6250
Dev Derek 6666.66667
Houston Larry 12500
Smith John 22083.3333
8 rows selected.
5.
SQL> DELETE FROM faculty WHERE DeptId=2;
DELETE FROM faculty WHERE DeptId=2
*
ERROR at line 1:
ORA-02292: integrity constraint (SYSTEM.STUDENT_FACULTYID_FK)
violated – child record found
You might also like to view...
Bluetooth-enabled mice, keyboards and printers are not available
Indicate whether the statement is true or false
If the shape hints are not visible, click View on the Menu bar, and then click Show Shape Hints.
Answer the following statement true (T) or false (F)