{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Practice1 - Practice 1 SQL 1 Initiate a SQL*PLUS session...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Practice 1 - SQL 1. Initiate a SQL*PLUS session using the user ID and password provided by the instructor 2. SQL * Plus commands access the database False 3. Will the SELECT statement execute successfully? True Select ename, job, sal salary From emp; 4. Will the SELECT statement execute successfully? True Select * from salgrade; 5. There are three coding errors in this statement. Can you identify them? Select empno, ename Salary x 12 ANNUAL SALARY From emp; 1) The EMPLOYEES table does not contain a column called sal. The column is called SALARY. 2) The multiplication operator is *, not x, as shown in line 2. 3) The ANNUAL SALARY alias cannot include spaces. The alias should read ANNUAL_SALARY or be enclosed in double quotation marks. 4) A comma is missing after the column, LAST_NAME. 6. Show the structure of the DEPT table. Select all data from the DEPT table. SQL> desc dept; Name Null? Type ----------------------------------------- -------- ---------------------------- DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) SQL> select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON
Image of page 1

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

View Full Document Right Arrow Icon
7. Show the structure of the EMP table. Create a query to display the name, job, hire
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern