0% found this document useful (0 votes)
25 views

Assessment Task 3

The document discusses SQL SELECT statements and WHERE clause conditions. It provides examples of SELECT statements and describes different types of conditions that can be used in a WHERE clause like comparison, BETWEEN, IN, LIKE, and logical conditions.

Uploaded by

Jommel Pastrana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Assessment Task 3

The document discusses SQL SELECT statements and WHERE clause conditions. It provides examples of SELECT statements and describes different types of conditions that can be used in a WHERE clause like comparison, BETWEEN, IN, LIKE, and logical conditions.

Uploaded by

Jommel Pastrana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

I.

Test your knowledge:

1.The following SELECT statement executes successfully:

SELECT last_name, job_id, salary AS Sal FROM employees;

 TRUE

2. The following SELECT statement executes successfully:

SELECT *FROM job_grades;

 FALSE

3. There are four coding errors in the following statement. Can you identify them?

SELECT employee_id, last_namesal x 12 ANNUAL SALARY FROM employees;

 SELECT employee_id, last_name, (salary * 12) "ANNUAL SALARY"


FROM hr.employees;

4. Create a select statement that will display the last_name, First_name of employees under
department IT_Prog.

 SELECT last_name, First_name “ IT_Prog” FROM hr.employees;


II. Research Work.

WHERE clause

 The WHERE clause is used to filter records. It is used to extract only those records that
fulfill a specified condition.

Condition

 A condition specifies a combination of one or more expressions and logical (Boolean)


operators and returns a value of TRUE , FALSE , or unknown.

Comparison Conditions

 A comparison (or relational) operator is a mathematical symbol which is used to compare


two values. Comparison operators are used in conditions that compares one expression
with another.

Between Condition

 The BETWEEN operator selects values within a given range. The values can be numbers,
text, or dates. The BETWEEN operator is inclusive: begin and end values are included.

In Condition

 IN condition is an alternative to multiple OR conditions in SELECT, INSERT, UPDATE,


or DELETE statement. The IN operator allows multiple values to be tested against the
expression and thus reduces the use of multiple OR conditions with each test value.

Like Condition

 The SQL LIKE condition allows you to use wildcards to perform pattern matching in a
query. The LIKE condition is used in the WHERE clause of a SELECT, INSERT,
UPDATE, or DELETE statement.
Logical Condition

 A logical condition combines the results of two component conditions to produce a single
result based on them or to invert the result of a single condition.

Describe

 DESCRIBE means to show the information in detail. Since we have several tables in our
SQL Server database, we will need a command to show a table's structure, such as
column names, data types, constraints on column names, etc.

You might also like