TOPIC-10-SQL-RELATIONAL-OPERATION
TOPIC-10-SQL-RELATIONAL-OPERATION
Tubigon, Bohol
2nd Semester, A.Y. 2024-2025
CC 105 – IM 101 (INFORMATION MANAGEMENT 1)
RELATIONAL OPERATION
A relational operation is an operation that extracts the desired data from a table. There are
three basic relational operations.
Project---- extract the specified item from the table
Select-----extract the specified record from the table
Join-----extract data that combines two or more tables by means of a certain item with the same value
Comparison
EXAMPLE
1. select * from employee_tbl where age >= 35;
2. Select name, department From employee_tbl Where age>= 35;
Pattern Matching
Use LIKE to retrieve rows based on partial information. Like is useful if you don’t know an exact value.
Like works with only characters strings, it uses pattern that values are matched against. A pattern is a quoted
string that contains the literals characters to match and any combination of wildcards. Wildcards are special
characters used to match parts of a value. You can negate like condition with not like, can combine like
conditions and other conditions with AND and OR.
Wildcards operators
% a percent sign matches any string of zero or more characters
_ an underscore matches any one character.
Ex. Select fname, lname from customer where fname like ‘%Ke’;
Select fname, lname from customer where fname not like ‘Ke%’;