exam 3 - Basic SQL Queries Flashcards
SQL Sub-Structures
DML: Data Manipulation Language
DDL: Data Definition Language
DCL: Data Control Language
DML: Data Manipulation Language
◦Select Data
◦Modify Data
DML: Data Manipulation Language
◦Select Data
◦Modify Data
DDL: Data Definition Language
◦Create Artifacts
◦Drop Artifacts
◦Modify Artifacts
DDL: Data Definition Language
◦Create Artifacts
◦Drop Artifacts
◦Modify Artifacts
DCL: Data Control Language
◦Securing Artifacts
DCL: Data Control Language
◦Securing Artifacts
Define Database Objects
Define Database Objects
- create
- alter
- drop
null [important]
unknown
Data Control Language [3 important words]
Manage security and Permissions
[3]
manage security and permission
- grant - set it
- revoke - remove
- deny - trump card [you can deny it to a certain user]
Data manipulation language [4 key words, important for the exam]
select and modify data
[4]
Select and modify Data - select - read the data - insert - update - delete Most SQL that you will write will fall into this category
Database queries return _____
Database queries return information
A SQL Query is structured in sections
- select :
SELECT: Column list to return
A SQL Query is structured in sections
- from:
FROM: Table list which will be the source
A SQL Query is structured in sections
- where:
WHERE: Row filter criteria
A SQL Query is structured in sections
order by:
ORDER BY: Sort Rules
A SQL Query is structured in sections
- group by:
GROUP BY: Organize columns into groups
A SQL Query is structured in sections
having:
HAVING: Group filter criteria
Simplest form requires only
[2]
Simplest form requires only
- select
- from
Select all columns by using a *
[2]
Select all columns by using a *
- careful not to ask for more than you need
- take extra time to resolve SELECT list
Providing a list of columns is better
[2]
Providing a list of columns is better
- reduce data
- explicit Resolution
Returning Calculated Values
- A SELECT list can also contain
A SELECT list can also contain calculated data
Returning Calculated Values
- Encourages the return of
Encourages the return of relevant data
Returning Calculated Values
- Reassembles
Reassembles normalized data
SELECT AuthorID, FirstName + ‘ ‘ + LastName as NameFROM Authors
select the column first +
adding a space + Last Name as Name (make a new column named Name, Name isn’t in the Data”)
FROM Authors
(getting it from the Authors files)