SQL: standard language for accessing and manipulating databasesWhat is SQL?SQL: Structured Query Languagelets you access & manipulate databasesWhat ca
Database TablesDatabase contains 1 or more tableseach table is identified by a nametables contain records w/ dataKeywords are NOT case sensitive: sele
: to sort the result-set in ascending/descending orderascending order by defaultuse DESC keyword for descending order: to insert new records in a tabl
LIMIT Clause LIMIT: to specify the number of records to return useful on large tables w/ thousands of records returning a large number of records ca
SQL ServerLIKE operators used w/ ‘%’ and ‘\_’ wildcards:Using the % Wildcard:SELECT \* FROM CustomersWHERE City LIKE 'L_n_on';Example 2: selects all c
used to give a table or a column in a table a temporary nameused to make column names more readableonly exists for the duration of that queryis create
EXISTS operatorused to test for the existence of any record in a subqueryreturns TRUE if the subquery returns one or more recordsSyntax: returns TRUE/
SELECT INTO: copies data from one table into a new tablethe new table is created w/ the column names and types as defined in the old tableyou can crea
Comments: used to explain sections of SQL statements or prevent execution of SQL statementsSingle line commentsstarts with — (two hyphens)any text b/w
CREATE DATABASE: used to create a new SQL databaseSyntaxDROP DATABASE: to drop an existing SQL databaseSyntaxCREATE TABLE: to create a new table in a
: to specify rules for data in a tableCreate constraintsconstraints can be specified when:the table is created with the CREATE TABLE statementOR after
View: a virtual table based on the result-set of an SQL statementcan contain rows and columnsyou can add SQL statements & functions to a viewyou can p