List output from the following queries. (Uses tables created in the Chapter 4 Lab Activity)

1. SELECT INITCAP(First) || ‘ ’ || INITCAP(Last) “Student Name”
FROM student;
2. SELECT COUNT(DISTINCT (MajorId)) FROM student;
3. SELECT Building, SUM(Capacity) TOTCAP
FROM location
GROUP BY Building
ORDER BY TOTCAP DESC;
4. SELECT UPPER(Lname), UPPER(Fname), (SYSDATE – HIREDATE) DAYS
FROM employee
ORDER BY DAYS;
5. SELECT Building, AVG (Capacity)
FROM location
GROUP BY Building
HAVING AVG (Capacity) > 25;


1.
SQL> SELECT INITCAP(First) || ' ' || INITCAP(Last) "Student
Name"
2 FROM student;
Student Name
-------------------------------
Jose Diaz
Mickey Tyler
Rajesh Patel
Deborah Rickles
Brian Lee
Amir Khan
6 rows selected.
2.
SQL> SELECT COUNT(DISTINCT (MajorId)) FROM student;
COUNT(DISTINCT(MAJORID))
------------------------
5
3.
SQL> SELECT Building, SUM(Capacity) TOTCAP
2 FROM location
3 GROUP BY Building
4 ORDER BY TOTCAP DESC;
BUILDIN TOTCAP
------- ----------
Kennedy 155
Nehru 95
Gandhi 10
4.
SQL> SELECT UPPER(Lname), UPPER(Fname), (SYSDATE - HIREDATE) DAYS
2 FROM employee
3 ORDER BY DAYS;
UPPER(LNAME) UPPER(FNAME) DAYS
--------------- --------------- ----------
SHAW JINKU 1633.79684
CHEN SUNNY 1774.79684
MCCALL ALEX 2601.79684
GARNER STANLEY 3037.79684
DEV DEREK 3388.79684
ROBERTS SANDI 4587.79684
HOUSTON LARRY 13550.7968
SMITH JOHN 16140.7968
8 rows selected.
5.
SQL> SELECT Building, AVG (Capacity)
2 FROM location
3 GROUP BY Building
4 HAVING AVG (Capacity) > 25;
BUILDIN AVG(CAPACITY)
------- -------------
Kennedy 38.75
Nehru 47.5

Computer Science & Information Technology

You might also like to view...

If users rename tables that are in existing relationships, they will need to re-establish those relationships after the name change

Indicate whether the statement is true or false

Computer Science & Information Technology

A fluid layout is one in which the size of a web page and the size of the elements within it are set regardless of the screen resolution. ?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Case WD 5-1Cory is reviewing a friend's resume. He wants to use Word's comment features to make suggestions. Cory wants to delete one of his comments. What is the shortcut method for deleting a comment?

A. Click the Review tab, click the Delete list arrow, then click Delete B. Right-click the comment, then click Delete Comment on the shortcut menu C. Press [Ctrl][D] D. Press [F7]

Computer Science & Information Technology

Which of the following functions does information security perform for an organization?

A. Protecting the organization's ability to function. B. Enabling the safe operation of applications implemented on the organization's IT systems. C. Protecting the data the organization collects and uses. D. All of the above.

Computer Science & Information Technology