You are on page 1of 3

1. iSQL*Plus commands access the database. True/False.

 True, it use commands to use SQL queries to access the database. So,
technically, commands does access the database, albeit indirectly.
2. The following SELECT statement executes successfully:

SELECT last_name, job_id, salary AS


Sal
FROM
employees;
True/False
 True
3. The following SELECT statement executes successfully:

SELECT *FROM
job_grades;
True/False
 False ; table is not found
4. There are four coding errors in the following statement. Can you identify them?

SELECT employee_id, last_namesal x


12 ANNUAL SALARY
FROM
employees;
 last_namesal is wrong, it must be only “last_name”
 “x” must be “ * ”
 “ sal “ is incomplete, it must be “salary”
 ANNUAL SALARY must be enclosed in a quotation ( “ ” )
 Need divider between last_name and sal ( “ , “ )
II
1. Research the difference between SQL and iSQL plus including their statements and
commands
SQL SQL* Plus
A query language used for communication A command line tool with which you can
with Oracle server to access and modify the send SQL queries to the server.
data.
Language which is invented by IBM Tool to use use SQL language for a database
from Oracle corporation.
Keywords cannot be abbreviated Keywords can be abbreviated

2. Search for the following:


 WHERE Clause = It is a keyword used to extract only those records that fulfill a
specified condition

SELECT column1, column2, ...
FROM table_name
WHERE condition;

 Condition = statements that evaluates data and return appropriate outputs


according to the evaluation
 Comparison Condition = conditions that compares two expressions ( equal to,
less than, greater than etc.) and returns True or False.

SELECT * FROM Products

WHERE Price = 18;


 Between Condition = condition that selects value within a given range. (Between
value 1 and 100)

SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN va
lue1 AND value2;
 In Condition = Allows to specify multiple values in a WHERE clause.

SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT 
STATEMENT);
 Like Condition = Used in a WHERE clause to search for a specific pattern

SELECT column1,
column2, ...
FROM table_name
WHERE column LIKE pattern;
 Logical Condition = Conditions that can be combined in a WHERE clause
(AND, OR, NOT conditions).

AND = Displays records if both conditions are TRUE

SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND conditi
on2 AND condition3 ...;

OR = Displays records if one of the condition is TRUE

SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR conditio
n2 OR condition3 ...;

NOT = displays records if the condition is FALSE

SELECT column1, column2, .
..
FROM table_name
WHERE NOT condition;

 Describe = Displays the structure of the table

DESCRIBE table_name;

You might also like