Concepts Flashcards

1
Q

SQL statement

A

A block of SQL code that is to be executed on a relational database is known as a SQL statement.
A SQL statement that results in a dataset is called a SQL query

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

table

A

A table is a database object made up of rows and columns; each row represents a different entity and each column represents a different attribute about that entity. In relational database terminology, row and record are often used interchangeably.

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

row

A

each row represents a different entity

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

column

A

each column represents a different attribute about that entity.

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

referring to a specific column NAME

A

When referring to a specific column “COLUMN_NAME” in a specific table “TABLE_NAME”, to avoid ambiguity it’s customary to refer to the pair by listing both separated by a period: “TABLE_NAME.COLUMN_NAME”.

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

primary key

A

Each table has a primary key: one or more columns whose value(s) uniquely identify a row in that table.

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

foreign keys

A

Tables may have one or more foreign keys. A foreign key is one or more columns whose value(s) uniquely identify a row in another table. In other words, foreign keys hold primary key values of another table.

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

relational database

A

Special columns hold values that indicate how the different entities relate to each other, hence the term relational database.

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

Character string

A

SQL Server Examples: NVARCHAR, VARCHAR

Oracle Examples: VARCHAR2

A combination of characters is often called a string. ‘Bob Thompson’, ‘V13.4’, and ‘-46’ are all valid strings. A string column has a defined maximum length.

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

Numeric

A

SQL Server Examples: NUMERIC, FLOAT, BIGINT, INT, TINYINT, BIT

Oracle Examples: NUMBER, FLOAT

Numeric columns contain real numbers. 42, -1, 3.141592653, and 6.022x10^23 are all examples. In general, number columns will have a defined precision and scale. The precision is the maximum number of digits, the scale is the number of digits to the right of the decimal point.

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

Date/time

A

SQL Server Examples: DATE, DATETIME, DATETIME2

Oracle Examples: DATE

Date/time columns hold dates and times. Values in these columns may also vary by levels of precision: from days down to fractions of seconds.

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

Nullable

A

The intersection of a row and column in a table is a specific value. In some cases, the value may be NULL. This means that the value is not populated. There is nothing there: not ‘’, not 0, not ‘NULL’; nothing. This may indicate that the value was never recorded or that the value isn’t applicable to the row.

A column is nullable if it allows NULL values. Primary keys are inherently non-nullable, but other columns may be non-nullable as well. Whether or not a column is nullable has implications on how the column should be used.

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

Views

A

Views are queries that are stored in the database. A view can be accessed as if it were a table. Unlike tables, however, views do not actually hold data. This means that using a view will not necessarily increase the efficiency of a query. However, views can reduce the amount of work that business intelligence developers must do by reducing the complexity of a query.

Examples: V_SCHED_APPT, V_ACCESS_LOG

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

Stored procedures

A

A SQL statement stored in your SQL Server so that it can be run as needed. These are often used to populate tables based off of other information already stored in the database.

Example: ESP_F_SCHED_APPT (the script that populates F_SCHED_APPT)

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

Materialized views

A

Materialized views are tables populated from queries that run against other tables. Materialized views are often populated by stored procedures. Using materialized views can reduce the amount of work that business intelligence developers must do: one materialized view might take the place of several tables. Materialized views can increase query efficiency; they are like pre-compiled and saved query results.

Examples: F_SCHED_APPT, D_MU_MEASURES

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

Functions

A

Functions can take in parameters and return results. In general, they do not make changes to the database. Functions can be used directly by SQL queries. Functions will be discussed in more detail in the Functions lesson of this training companion.

Example: CURRENT_TIMESTAMP

17
Q

SQL definition

A

SQL stands for Structured Query Language. It is generally pronounced “es-queue-el” or “see-kwell”. SQL is the industry standard for communicating with relational databases (covered in the next section). SQL has many implementations, including Microsoft SQL Server and Oracle. A block of SQL code that is to be executed on a relational database is known as a SQL statement. A SQL statement that results in a dataset is called a SQL query.

18
Q

Relational Database

A

In relational databases, each type of entity is represented by a different table. A table is a database object made up of rows and columns; each row represents a different entity and each column represents a different attribute about that entity. In relational database terminology, row and record are often used interchangeably.