HW5 - 1. Display the current date by using the DUAL table....

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1. Display the current date by using the DUAL table. SQL> select sysdate from dual; SYSDATE --------- 03-MAR-10 2. Display the schools and their deans SQL> select SCH_NAME, SCH_DEAN from SCHOOL; SCH_NAME SCH_DEAN -------------------------------------------------- -------------- School of Business Ted Cummings School of Education Dennis Spuck School of Humanities and Human Sciences Bruce Palmer School of Science and Computer Engineering Sadegh Davari 3. Display the majors that belong to the School of Business SQL> 1 select MAJ_DESC from MAJOR 2 inner join school on MAJOR.SCH_CODE = SCHOOL.SCH_CODE 3* where SCH_NAME = 'School of Business' SQL> / MAJ_DESC ------------------------------ Finance Accounting Management Information Systems Human Resource Management Healthcare Administration 4. Display the majors that belong to the School of Science and Computer Engineering SQL> ed Wrote file afiedt.buf 1 select MAJ_DESC from MAJOR 2 inner join school on MAJOR.SCH_CODE = SCHOOL.SCH_CODE 3* where SCH_NAME = 'School of Science and Computer Engineering' SQL> / MAJ_DESC ------------------------------ Biology Computer Information Systems Computer Science 5. Display the names of students who have selected a major
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQL> select STD_LNAME ||','|| STD_FNAME from STUDENT where MAJ_CODE is not NULL; STD_LNAME||','||STD_FNAME ------------------------------- Nicholson,John Murphy,Edward Reagan,Ronald Torvalds,Linus Alba,Jessica Jolie,Angelina Dunst,Kirsten Fox,Megan Morrison,Marion Garriot,Richard Joplin,Janis STD_LNAME||','||STD_FNAME ------------------------------- Weaver,Susan Gates,Bill Stewart,Kristen Gubler,Matthew Hyde,Allan Woods,Simon Fox,Michael 18 rows selected. 6. Display the names of students who have not selected a major SQL> ed Wrote file afiedt.buf 1* select STD_LNAME ||','|| STD_FNAME from STUDENT where MAJ_CODE is NULL SQL> / STD_LNAME||','||STD_FNAME ------------------------------- DeVito,Daniel Lampaneli,Lisa 7. Display the names and majors of students who are Male SQL> ed Wrote file afiedt.buf 1 select STD_LNAME ||','|| STD_FNAME, MAJ_DESC from STUDENT 2 inner join MAJOR on STUDENT.MAJ_CODE = MAJOR.MAJ_CODE 3* where STD_GEND = 'M' SQL> / STD_LNAME||','||STD_FNAME MAJ_DESC
Background image of page 2
------------------------------- ------------------------------ Nicholson,John Accounting Woods,Simon Accounting Torvalds,Linus Computer Information Systems Garriot,Richard Computer Science Fox,Michael Computer Science Murphy,Edward Finance Gates,Bill Finance Morrison,Marion Finance Gubler,Matthew Management Information Systems Hyde,Allan Management Information Systems Reagan,Ronald Management Information Systems 11 rows selected. 8. Display the names and majors of students who are Female SQL> ed Wrote file afiedt.buf 1 select STD_LNAME ||','|| STD_FNAME, MAJ_DESC from STUDENT 2 inner join MAJOR on STUDENT.MAJ_CODE = MAJOR.MAJ_CODE 3* where STD_GEND = 'F' SQL> / STD_LNAME||','||STD_FNAME MAJ_DESC ------------------------------- ------------------------------ Fox,Megan Accounting
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

HW5 - 1. Display the current date by using the DUAL table....

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online