SQL Flashcards
What is Data Manipulation Language (DML)?
Works with the values in the database
- Select, insert, update, delete
What is Data Definition Language (DDL)?
Work with the definition of the database
Create, delete, alter, drop, modify- tables and relationships
What is Data Control Language (DCL)?
Manipulate permission within the database
Grant, deny, revoke
What do these two Special statements do?
Use +
Go
Use- switch to a specific database for the following statement
Go- execute the statement since the last go
or the start of a session
What is a tuple?
a row of data
What is an attribute?
a column of data
What is a determinant?
an attribute whose value determines the value of another attribute
usually a primary key
SQL Language Element
What is are clauses?
Constituent components of statements and queries
SQL Language Element
What are Expressions?
can produce either scalar values or tables consisting of columns and rows of data
ex- set counter = counter + 1
SQL Language Element
What are predicates?
They specify conditions that have to be evaluated
ex- where Customer = ‘Bob’
where ‘column name’ (equals) ‘insert value’
SQL Language Element
What are queries?
They retrieve data based on specific criteria
ex- select * from ‘table name’ where ‘column name’ = ‘insert value’
SQL Language Element
What are statements?
They have a persistent effect on schemata and data,
or many control transactions, program flow, connections, session, or diagnostics
Syntax example for reference
Update clause {Update Country
Set clause { set population = population + 1 (expression)
Where clause {where name = USA (predicate)
-Full example is a statement
-All sytax are written in queries
Various operators to know
= (equals)
<> (not equal)
+,-./,% (arithmetics)
() (groupings)
+ (string concatinations ex ‘Thor’ + ‘Loki’
>,=, not, and, or, between, like, as, is null, is not null