Section 2: SQL Theory Flashcards
4 Different types of programming
- Procedural (Imperative)
- Object-Oriented
- Declarative (outcome)
- Functional
4 Main components of Data SQL Syntax and purpose
- Data Definition Language (DDL) Creation of Data
- Data Manipulation Language (DML) Manipulation of Data
- Data Control Language (DCL) Assignment and removal of permission to use data
- Transaction Control Language (TCL) Saving and restoring changes to a database
What is DDL
- Data Definition Language
- A syntax not a language
- A set of statements that allow the user to define or modify data structures and objects, such as tables.
DDL Purpose
Used for creating entire databases and database objects as tables
Create Statement
Syntax used for creating entire databases and database objects as tables
Alter Statement (3 uses)
Syntax used when altering existing objects 1. Add 2. Remove 3. Rename one of the columns in the table
Drop Statement
Syntax used to delete entire table
Rename Statement
Syntax used to rename a table
Truncate Statement
Syntax used to remove data in a table but keep the code/formula
DDL 5 Syntaxes
Data Definition Language
- Create
- Alter
- Drop
- Rename
- Truncate
Keyword
- Reserved words
- Keywords in SQL cannot be variable names.
- Keywords that cannot be used when naming objects
Excel formula names
DML
Data manipulation Language
Select Statement
Syntax that will select information in a table.
- Useful in getting micro view of large data
u
Insert Statement
Syntax used to insert data into the tables
Update Statement
Syntax used to update information in a table