ITEC 3220 Lecture 1: Structured Query Language EXAMPLES

36 views3 pages
Ambassador badge icon
13 Dec 2021
Course
Professor

Document Summary

Query expression evaluation: evaluated from left to right, subexpression in brackets are evaluated first, nots before and and or, and before or. Patter match: like, whether string matches a specified pattern. Select procedure: compute cross-product, count in the qualification, delete column that are not in select-list. Use it for less than or greater than use theta join. Natural join: if you have common field, they could be connected only using equality condition. If there are more than one equality condition applied to all queries. Example: find all the students who were born in or before 1980. Select distinct t. sid from transcript t,course c where t. cid = c. cid and c. pcode = itec": find the names and ids of students who have been registered in itec program. Select distinct s. sid, s. name, from student s join transcript t on s. sid = t. sid join course c. We don"t do distinct here because one student might have more itec courses needs to be increased also.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers