Section 2: SQL Theory Flashcards

1
Q

4 Different types of programming

A
  1. Procedural (Imperative)
  2. Object-Oriented
  3. Declarative (outcome)
  4. Functional
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

4 Main components of Data SQL Syntax and purpose

A
  1. Data Definition Language (DDL) Creation of Data
  2. Data Manipulation Language (DML) Manipulation of Data
  3. Data Control Language (DCL) Assignment and removal of permission to use data
  4. Transaction Control Language (TCL) Saving and restoring changes to a database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is DDL

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

DDL Purpose

A

Used for creating entire databases and database objects as tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Create Statement

A

Syntax used for creating entire databases and database objects as tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Alter Statement (3 uses)

A
Syntax used when altering existing objects
1. Add
2. Remove
3. Rename
one of the columns in the table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Drop Statement

A

Syntax used to delete entire table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Rename Statement

A

Syntax used to rename a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Truncate Statement

A

Syntax used to remove data in a table but keep the code/formula

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

DDL 5 Syntaxes

A

Data Definition Language

  1. Create
  2. Alter
  3. Drop
  4. Rename
  5. Truncate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Keyword

A
  • Reserved words
  • Keywords in SQL cannot be variable names.
  • Keywords that cannot be used when naming objects

Excel formula names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

DML

A

Data manipulation Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Select Statement

A

Syntax that will select information in a table.
- Useful in getting micro view of large data
u

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Insert Statement

A

Syntax used to insert data into the tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Update Statement

A

Syntax used to update information in a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Delete Statement

A

Syntax similar to truncate that allows you to specify precisely what you would like to be removed

17
Q

Truncate V. Delete

A
  1. Truncate removes all data

2. delete removes specific data in a table

18
Q

DML 4 main statements and syntax

A
  1. Select… From…
  2. Insert… Into… Values
  3. Update… Set… Where….
  4. Delete… from… Where
19
Q

DCL

A

Data control Language
which allows to manage the rights users have in a database
1. Grant
2. Revoke

20
Q

Grant Statement

A

Gives (grants) certain permissions to users.

21
Q

Database Administrators

A

People who have complete rights to a database, they can grant access to users or revoke it

22
Q

Revoke Statements

A

Used to revoke permissions and privileges of database users

23
Q

TCL

A

Transaction Control Language

24
Q

Commit Statement

A
  1. Save changes made
  2. Relates to Insert, Delete, Update
  3. Will let other users have access to the modified version of the database
25
Q

Rollback Clause

A

Allows to undo any changes made that do not wish to save permanently..
Rollback reverts to the last non-committed state