import{_ as t}from"./chunks/PageInfo.vue_vue_type_script_setup_true_lang.250b3e56.js";import{_ as a,o as l,c as s,H as c,k as e,a as i,Q as n}from"./chunks/framework.b7580407.js";import"./chunks/commonjsHelpers.725317a4.js";const S=JSON.parse('{"title":"CIS105: Computer Applications & Information Systems Lect. 14","description":"","frontmatter":{},"headers":[],"relativePath":"academic/cis105/cis105-l14-lecture-note.md","filePath":"academic/cis105/cis105-l14-lecture-note.md","lastUpdated":1726414997000}'),r={name:"academic/cis105/cis105-l14-lecture-note.md"},d=e("h1",{id:"cis105-computer-applications-information-systems-lect-14",tabindex:"-1"},[i("CIS105: Computer Applications & Information Systems Lect. 14 "),e("a",{class:"header-anchor",href:"#cis105-computer-applications-information-systems-lect-14","aria-label":'Permalink to "CIS105: Computer Applications & Information Systems Lect. 14"'},"")],-1),p=n('
SELECT: What fields (column) you want fieldname: If the name is used in only one tableFROM: What table or tables contain the fieldsORDER BY: SortingDISTINCT: Use after SELECT when you only want to show each vale of the selected field(s) onceLIMIT: Use when you want to limit the number of records producedWHERE: Applies conditions, filters
WHERE clause conditions follow a pattern: field + comparison operator + value
WHERE crime.iucr_no = 420WHERE crime.iucr_no = 420Comparison Operators:
> : Returns all records larger than the specified value>=: Returns all records that are at least as large as the specified value (including the value)< : Returns all records smaller than the specified value<=: Returns all records that are at least as small as the specified value (including the value)= : Returns all records that are exactly equal to the specified value<>: Returns all records that are not equal to the specified valueNULL: An empty value
NOT: Can be used to create a condition that reverses the logic of any condition
NOT function in ExcelAND: Both conditions must be met for row to be included in query
OR: Used to combine criteria when we want our results to mach any criteria
BETWEEN: Shorthand way to include values in a range
IN: Shorthand way to include values in a range
LIKE: Use this statement when you aren't sure of the values in a record
%: any combination of characters
%Keyword: ends with keyword\uFEFF\uFEFF%Keyword%: looks for %keyword% anywhere in the recordKeyword%: starts with keyword- substitutes for any single character
't_p' would return 'tip', 'tap', or 'top''; but not 'stop'
'p_st" would return 'past"', but not 'paste'
'h__s_n' would return 'hanson', 'hensen', or 'hansen'; but not 'harrison' (note that 'h%s_n' would return 'harrison')
AND and OR statements, you must follow the order of operations (AND 1st, OR 2nd) OR must be first, use ()('_'), ("_")/#s is left as-is