Section 6.2 > Database Operations Flashcards

1
Q

What does SQL stand for?

A

Structured Query Language

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

In a SQL query, what is the FROM keyword used for?

A

Specifies which table to select or delete data from

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

In a SQL query, what is the SELECT keyword used for?

A

Selects data from a database

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

In a SQL query, what is the UNION keyword used for?

A

Combines the result set of two or more SELCT statements (only distinct values, they cannot be mixed)

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

In a SQL query, what is the keyword WHERE used for?

A

Filters a result set to include only records that fulfill a specified condition

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

In a SQL query, what is the JOIN keyword used for?

A

Joins tables

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

What is product operation?

A

The product operation creates a result table that includes all of the attributes from the two tables; each row of the second table is added to each row of the first table.

SELECT Shifts.WingSegment, Shifts.Shift,
NurseName.LastName

FROM Shifts

CROSS JOIN NurseName;

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

What is join operation?

A

A join operation combines two tables, but records are only appended when a matching criterion is met. The result table includes a row with the attributes of both tables only when attributes from the first database table match related attributes from the second database table.

SELECT*
FROM Patient CROSS JOIN Nurse;

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

What are object-oriented (OO) databases?

A

Object-oriented (OO) databases store complex data and relationships between data directly without using inter-table relations.

An object database is a collection of objects, each with two components: data and instructions. The instructions, or software programs called methods, define what to do with the data in the object.

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

What are NoSQL?

A

Short for not only SQL, databases can accommodate a wide variety of data models, including key-value, document, columnar, and graph formats. NoSQL is an alternative to traditional relational databases in which data is placed in tables that are carefully designed before the database is built. NoSQL databases are especially useful for working with large sets of distributed data.

In key-value databases (also referred to as stores), each item in the database is stored as an attribute name (or key) together with its value.

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

What is Data Lake?

A

A data lake is a system of data stored in raw format. It is usually a single store of all enterprise data as well as information derived from data during reporting, transactions, or other activities. Data lakes can include both structured data, such as tables, and unstructured data, such as audio and video recordings.

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

Selection Operation

A

The selection operation takes rows from one table and creates a new table. The user specifies the table from which the rows are taken and tests the selection criterion. The selection criterion is tested against each row, and when a condition is met, that row is included in the result table. Tests use attribute names, constants, and relational operators, such as AND and OR, which define the criteria. In this example, the syntax is searching for the patient record with the patient ID ‘223344.’:

SELECT * FROM Patient
WHERE PatientID = ‘223344’;

The SELECT statement identifies the records that are being requested, and the asterisk (*) means everything from that table. The parameter after FROM identifies the table name (Patient). The next keyword, WHERE, is the condition the query is requesting.

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

Union Operation

A

The union operation combines distinct fields from multiple tables that have the same set of attributes and data types. For example, if one column accepts integers and another accepts variable characters, they would not be compatible for a union.

SELECT PatientID, LastName FROM Patient
UNION
SELECT NurseID, LastName FROM Nurse;

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

Product Operation

A

The product operation creates a result table that includes all of the attributes from the two tables; each row of the second table is added to each row of the first table.

SELECT Shifts.WingSegment, Shifts.Shift, NurseName.LastName
FROM Shifts
CROSS JOIN NurseName;

Notice when you are using more than one table as a source, the table name precedes the attribute name, separated by a period. Shifts.WingSegment refers to the field ‘WingSegment’ from the table ‘Shifts.’

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

Join Operation

A

A join operation combines two tables, but records are only appended when a matching criterion is met. The result table includes a row with the attributes of both tables only when attributes from the first database table match related attributes from the second database table.

SELECT*
FROM Patient, Nurse;
This syntax selects all the fields from both ‘Patient’ and ‘Nurse’ tables, and joins them into one large table. This is referred to as an implicit join. Alternatively, to get the same results, an explicit join can be used as shown below.

SELECT*
FROM Patient CROSS JOIN Nurse;

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