Section 1

Preview this deck

What is SQL?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (97)

Section 1

(50 cards)

What is SQL?

Front

A way to communicate with a relational database.

Back

Give and example of a many to many relationship.

Front

Students to classes.

Back

How are Tables structured?

Front

Into rows and columns.

Back

Third Normal Form

Front

The table is in it's second normal form. All columns are not transitionally dependent on the primary key.

Back

Second Normal Form

Front

The table is in it's first normal form. All columns are dependent on the primary key.

Back

What does the Update command do?

Front

Data modification. Updates or modifies a row of data.

Back

What are columns in a SQL Table?

Front

The types and identifiers. Make up the structure of what a row should have.

Back

What is SQL and acronym for?

Front

Structured Query Language

Back

What does the Insert command do?

Front

Data entry. Inserts a row of data.

Back

What commands are a part of Data Control Language?

Front

Grant and Revoke.

Back

Surrogate Key

Front

A value generated solely for being a primary key (a counter or random number or string)

Back

What is the syntax of the Insert command?

Front

INSERT into TABLE(Type1,Type2) VALUES (t1,t2);

Back

Give and example of a one to one relationship.

Front

Customer to ID.

Back

Dialects

Front

Oracle, Mysql, Microsoft SQL, Postgres.

Back

Multiplicity

Front

Description of the relationships between fields and tables.

Back

What is the syntax of the Update command?

Front

Update TABLE set FIELD = VALUE where FIELD = VALUE;

Back

Distributed Architectures

Front

A distributed system is a model in which components located on networked computers communicate and coordinate their actions by passing messages. The components interact with each other in order to achieve a common goal. Three significant characteristics of distributed systems are: concurrency of components, lack of a global clock, and independent failure of components Data is removed from the code itself allowing for changes to be made to the codebase without harming the data.

Back

Lookup Tables

Front

A way to show the relationship between two entities. Two columns and with at least one being a primary key.

Back

Database normalization in plain english.

Front

A table should be about a specific topic and contain columns that support the topic.

Back

What does Normalization lead to?

Front

Breaking a larger table into smaller tables.

Back

Why are lookup tables useful?

Front

They reduce the amount of information used in a table. Essentially join two tables.

Back

What is the syntax of the Delete command?

Front

DELETE from TABLE where FIELD = VALUE

Back

What is Data Query Language

Front

Commands for making queries.

Back

What commands are a part of Data Query Language?

Front

Select

Back

What are rows in a SQL Table?

Front

The entities.

Back

Referential Integrity

Front

The consistency of relationships between tables when changes are made.

Back

What does Grant do?

Front

allows specified users to perform specified tasks.

Back

What does Revoke do?

Front

cancels previously granted or denied permissions.

Back

Can you have a null primary key?

Front

Nope.

Back

Natural Key

Front

A unique value that already exists in a table that would function as a primary key.

Back

What are foreign keys?

Front

References to an another table. Must match a correct value (the row that the foreign key belongs to must exist).

Back

Should primary keys be changed?

Front

Nope.

Back

First Normal Form

Front

The information stored in columns is atomic, or the smallest amount of data possible. Columns are not repeating.

Back

What is TCL?

Front

Transaction Control Language commands are used to manage transactions in the database. These are used to manage the changes made to the data in a table by DML statements. It also allows statements to be grouped together into logical transactions.

Back

Primary Key

Front

Unique identifier for each row.

Back

What are the sublanguages of SQL?

Front

DDL (Data Definition Language), DML (Data Manipulation Language), DQL (Data Query Language), and DCL (Data Control Language), and TCL (Transaction Control Language).

Back

What is Data Control Language?

Front

Commands that grant or revoke access to data.

Back

What does the Delete command do?

Front

Data deletion. Deletes a row.

Back

What commands are a part of DML?

Front

Insert, Update, and Delete

Back

What is the Select command?

Front

Select returns a result set of records from one or more tables

Back

Give an example of a one to many relationship.

Front

Grandma to cats.

Back

What is DDL?

Front

Data Definition Language. Commands to manipulate and change data tables.

Back

Cardinality

Front

The maximum amount of relationships a field of data can be involved in.

Back

What is the syntax for the Select command?

Front

Select FIELD from TABLE; * is all.

Back

3 Reasons for Normalization

Front

1) Minimize duplicate data 2) Minimize data modification. 3) Simplify queries.

Back

Composite Key

Front

A key made of multiple columns. Not very good.

Back

Database

Front

A structured collection of data.

Back

Relational Data

Front

A relationship exists between A and B. Databases do not have to be relational.

Back

Normalization

Front

The process of organizing data in a database. Helps to keep all data related. prevents data-modification-related errors and inconsitencies (referential integrity) Removing what we don't need and keeping what we do need. Simplifiy queries. Reducing redundancy and enforcing referential integrity.

Back

Foreign Key

Front

A reference to another table. DOES NOT HAVE TO BE A PRIMARY KEY but should be.

Back

Section 2

(47 cards)

What is a View?

Front

A virtual table, stored in memory where normalization does not apply. A saved Select statement. Used to restrict sensitive info.

Back

What are the set operations?

Front

Union All, Union, Intersect, Minus.

Back

What is a non-repeatable read?

Front

A non-repeatable read occurs, when during the course of a transaction, a row is retrieved twice and the values within the row differ between reads.

Back

What is a Constraint?

Front

An optional condition on a Create Table or Alter Table command. Table level and Column level.

Back

What is a scalar function?

Front

A function that returns a row for every queried table or row.

Back

What is a dirty read?

Front

Returns data that has not yet been committed.

Back

What isolation levels can Phantom Read occur?

Front

Read Uncommitted

Back

What isolation levels can Non-Repeatable Reads occur?

Front

Read Uncommitted and Read Committed

Back

What is Isolation?

Front

Isolation is the concept of having each transaction isolated from the other. Transactions must be complete before another can execute.

Back

What does Rollback do?

Front

Goes back to a previous savepoint in uncommitted set of changes.

Back

What is a right join?

Front

Whatever is on the right table, including the matching rows between tables.

Back

What is Atomicity?

Front

Atomicity is the concept of keeping each transaction to the smallest possible unit of data.

Back

What is Consistency?

Front

Consistency is when a database is in a valid state according to it's exisiting structure and constraints after a commit.

Back

What is a union set operation?

Front

Returns a new table of distinct values from both sets.

Back

What is the intersect set operation?

Front

Returns rows that only exist by both queries that created the set.

Back

What is Serializable?

Front

The highest level isolation level. Requires read, write and range locks.

Back

What is read uncommitted?

Front

No locks, allows uncommitted data to be read.

Back

What is a result set?

Front

A set of table rows that are the result of a query.

Back

What is an aggregate function?

Front

A function that returns a single result or set on a table.

Back

What is a join?

Front

A operation that combines two or more tables.

Back

What is a Query?

Front

Operation that retrieves data from one or more tables or view.

Back

What is an outer join?

Front

Returns only unique rows to each table.

Back

What is a subquery?

Front

A query inside of a query. Used for narrowing down a rule set. They do not have to be correlated.

Back

What is a left join?

Front

Whatever is on the left table, including the matching rows between tables.

Back

What is a cross join?

Front

A join that returns all the possible combination of rows between tables.

Back

Primary keys.

Front

Unique values that identify each row of a table.

Back

What is Repeatable Read?

Front

The next level of isolation level. Requires read and write locks.

Back

What are read and write locks?

Front

Read and write permissions that are setup on the database to deal with concurrent transactions.

Back

What is the union all set operations?

Front

Adds two result sets together to make another result set. Allows for duplicates.

Back

What is an inner join?

Front

Returns only rows that two tables share.

Back

What is ACID?

Front

Atomicity, Consistency, Isolation, Durability

Back

Transaction Phenomenon

Front

Issues that occur with concurrent transactions. Dirty read, non repeatable read, phantom read.

Back

What isolation levels can Phantom Reads occur?

Front

Read uncommitted, read committed, and repeatable read.

Back

What commands are a part of TCL

Front

Commit, Savepoint, and Rollback.

Back

What is Durability?

Front

Durability is the concept of maintaining committed data and transactions. Results and data are stored permanently.

Back

What does Savepoint do?

Front

Creates a point where uncommitted changes can be Rollbacked to.

Back

What is a phantom read?

Front

A phantom read occurs when, in the course of a transaction, two identical queries are executed, and the collection of rows returned by the second query is different from the first.

Back

What is a self join?

Front

A table joined with itself?

Back

What is read committed?

Front

Allows only committed data to be read eliminating dirty reads.

Back

What does Commit do?

Front

Permanently saves changes.

Back

What are database functions?

Front

Operations that can operate on data and return a result.

Back

What are sequences?

Front

Sequences use stored variables that can be incremented or decremented. Useful for storing primary keys.

Back

What is a transaction?

Front

Unit of work done on a database that includes many operations.

Back

What are the two different types of functions?

Front

Scalar and aggregate.

Back

What is the minus set operation?

Front

Returns only the unique rows by the first query that are not returned by the second query.

Back

What are Isolation?

Front

A series of locks that help maintain the isolation of concurrent transactions.

Back

What is a full join?

Front

Result contains entries from both tables and includes matches.

Back