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

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 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 7. Show the structure of the EMP table. Create a query to display the name, job, hire date and employee number for each employee, with employee number appearing first. Save your SQL statement to a file name p1q7.sqlfirst....
View Full Document

This note was uploaded on 01/29/2012 for the course INTERNATIO 101 taught by Professor Mr.johnnash during the Spring '11 term at Symbiosis International University.

Page1 / 5

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

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

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