Terms To Remember Flashcards

1
Q

What is a row called in a database?

A

A Record

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

What is a column called in a database?

A

Field

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

Databases: what function do they provide?

A

They organize the information we receive so that we can use it

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

Tables

A

A collection of rows and columns. A database can contain more than one table.

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

The structure of tables in the database?

A

Schema. The database’s schema includes the information about the layout of tables and other information about the database itself.

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

Relational Database

A

Tables are made up of rows and columns. Columns are the relation.

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

What are common column data types?

A

Number, text, date, true/false value, binary data

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

Composite Key

A

Two or more fields taken together to act as a unique identifier

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

Foreign Key

A

Primary key from one table when referencing another table

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

What are the three types of Database Relationships?

A

One-to-many
Many-to-many
One-to-one

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

Transaction

A

A set of operations that all must be completed

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

What does ACID stand for in relation to transactions?

A

Atomic
Consistent
Isolated
Durable

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

What does Atomic mean?

A

Means that the transaction is indivisible, that pieces of it can’t be separated out.

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

What does consistent mean?

A

Whatever the transaction does, it needs to leave the database in a valid or consistent state. Can’t violate integrity.

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

What does Isolated mean?

A

While the activities in the transaction are being completed, nothing else can make changes to the data involved

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

What does Durable mean?

A

Information actually gets written to the database.

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

SQL

A

Structured Query Language

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

What does SQL do?

A

Allows statements to be written for DBMS to interpret how to interact with data (DML)

Offers feature to manage the database itself, such as creating or modifying tables and controlling access to tables. (DDL and DCL)

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

What does CRUD stand for?

A

Create
Read
Update
Delete

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

A relationship connects two pieces of data in different _____ in the same _____.

A

tables; database

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

Which is a good example of a candidate key?

A

an employee ID number. Any piece of data that uniquely represents a row is a candidate key, and if you have a value that occurs in the data naturally, that’s a natural key.

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

How many SQL clauses are in this query?

SELECT Width,Height FROM Shapes;

A

two. Each keyword, SELECT and FROM, defines a single clause.

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

In a database, what is a relation?

A

a set of attributes (columns) that describe information about specific instances (rows) of an entity
This was the correct answer

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

When is an associative table useful?

A

when records need to be related in a many-to-many relationship. An associative (or linking) table relates foreign keys from different tables to associate their records.

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

What does the term transaction mean?

A

A transaction is a collection of steps that must all be completed in order for a change to be made to the database.

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

If you reference a key from Table A in Table B, what is that value in Table B?

A

a foreign key. Because it refers to a key in another table, in this context, the value is called a foreign key.

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

In a database where you keep track of records for a school, what tables should you expect to find?

A

Each of these tables holds a different kind of information, and because the tables can store more than one record, the table names are pluralized.

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

When talking about data types, what do you call the group of types that represent text?

A

string types. There are various kinds of string types to accommodate text of different lengths.

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

To store the value 4:32PM, December 27, 2019, which data type would you use?

A

DATETIME. This is the correct type, because it includes both a date component and a time component. The other options here do not.

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

Which condition represents a NULL value?

A

a date cell containing no data. A cell, regardless of its data type, is NULL when it has no value.

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

If you don’t use a number type to store numeric data, _____.

A

you need to take additional steps to process the data as a number whenever you use it. Storing numeric data in numeric data types gives you the ability to work with numbers directly, as you might do when you use mathematical operations in queries.

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

When planning a database, what do you start with?

A

an Entity Relationship (ER) diagram. Using an ER diagram, you can plan out what fields will appear on which tables, and how they’re related.

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

Three Relationships?

A

one to one
one to many
many to many

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

Referential Integrity

A

Databases are aware of relationships and won’t allow a user to modify data in a way that violates those relationships.

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

Which is an example of referential integrity?

A

preventing the user from entering a record that refers to nonexistent data

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

Defining relationships helps you to do what?

A

reduce the repetition of data across tables

model real-world scenarios and requirements

understand how your data should be stored

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

What is it called if you delete a record and the database goes on and deletes other records associated with that record?

A

a cascading delete

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

In a one-to-many relationship, the value representing the ‘many’ side is what?

A

foreign key

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

When modeling a many-to-many relationship, how should you name the linking table?

A

with a combination of the names of the tables it’s linking

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

When you need to create a many-to-many relationship, what do you need to generate?

A

a linking table that has a one-to-many relationship with two or more tables

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

Which scenario represents a one-to-many relationship?

A

bank customers linked to their bank accounts. A certain customer can have multiple accounts, but a certain account can belong to only one customer.

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

A one-to-one relationship _____.

A

allows only one record to be connected to only one other record

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

First Normal Form (1NF) Normalization Rule?

A

Values in each cell should be atomic and tables should have no repeating groups.

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

Second Normal Form (2NF) Normalization Rule?

A

No value in a table should depend on only part of a key that can be used to unique identify a row

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

Third Normal Form (3NF) Normalization Rule?

A

Values should not be stored if they can be calculated from another non-key field

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

Denormalization

A

The process of intentionally duplicating information in a table, in violation of normalization rules

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

If you can figure out the value of one non-key field in a row by looking at another non-key field in that same row, what do you violate?

A

Third Normal Form

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

In order to put a database into Third Normal Form, _____.

A

it must also be in First and Second Normal Form

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

First Normal Form tells you to do what?

A

remove repeating groups

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

When might you choose to denormalize a table?

A

Retrieving the data upon request would be slow or burdensome, and you are able to pre-calculate or store a copy of the data somewhere it can be retrieved faster.

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

A table has two rows with the same values in all columns. Which step can you take to have this table meet the first normal form (1NF) requirements?

A

Add a primary key to the table. The primary key will add a unique value for each row, and thus eliminate the repeating duplicate rows issue.

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

What is the foreign key in the table created after this command?

CREATE TABLE Models (
ModelID INT(6) NOT NULL AUTO_INCREMENT,
Color INT(6) REFERENCES Colors(ColorID),
PRIMARY KEY(ModelID)
);

A

Color

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

Which SQL command will you use to create a new database called “mydb”?

A

CREATE DATABASE mydb;

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

Which of these is not an example of a time when you would use an aggregate function?

A

looking up customers with the name Rafael Montresso. Aggregate functions are used to tell you about certain characteristics of multiple records. Requesting a record by specific field values is not an aggregate operation.

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

Which WHERE condition can you use to find all records containing a first name starting with the letter “A”?

A

WHERE FirstName LIKE “A%”;

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

When using an aggregate function, how many results do you expect?

A

Aggregate functions return one value that describes a set of data.

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

What should come instead of the ??? placeholder for this query to return all fields and records in the table?

SELECT ??? FROM mytable;

A

*
The asterisk is used as a wildcard to retrieve everything from the given table.

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

True or False? In any given query, you can only join together a maximum of two tables.

A

FALSE. You can join together many tables as long as you tell the database which pairs of values on the tables are intended to match.

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

In order to use records from more than one table in a query, you need to _____ the tables based on some matching criteria.

A

join

Joining tables allows you to match rows from one table with rows on another table.

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

If a table is set to auto-increment the primary key, you’ll need to know the next value and set it manually when you enter a record. True or false?

A

FALSE.

When the database automatically increments a key field, you don’t need to worry about setting the value. The database will provide the next value in the sequence automatically.

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

When modifying a record, it’s a good idea to specify the record _____.

A

as precisely as possible, ideally using the primary key

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

True or false? In order to sort results based on a field, that field needs to appear in the final output.

A

FALSE

A field used for sorting doesn’t need to appear in the ‘SELECT’ clause of the query.

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

A SQL statement that returns requested records from the database is called:

A

a SQL query

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

Where can you write SQL?

A

in database management software

in an app’s source code

at a command-line console

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

You can narrow down the results that a query returns by only asking for results where a _____ matches a given value.

A

field

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

Which of these tasks can you accomplish using SQL as a DML?

A

inserting a record into a table

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

When first defining a table, what should you specify?

A

A. the table’s name

C. the fields and type of data they contain

E. the primary key and any referential constraints

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

Which sorting option shows dates from latest to earliest?

A

ORDER BY Date DESC

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

When you use SQL statements to create or modify the structure of a database, what is SQL being used as?

A

a Data Definition Language (DDL)

As a Data Definition Language, SQL can be used to create and modify the structure of database tables.

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

What is the correct SQL syntax to use when joining tables A and B on their “ID” field?

A

SELECT * FROM A
JOIN B ON A.ID=B.ID

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

When telling the database that a certain field must not contain an empty value, you say that it is:

A

not null

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

For a table that holds the purchase amounts in a grocery store over time, which query will likely return the highest value?

A

SELECT SUM(amount) FROM purchases;

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

What is the possible issue with this query?

UPDATE mytable SET price=5;

A

It may update undesired records.

Without a WHERE condition, this query will update all records including possibly undesired ones.

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

Which database is often used in a big data context?

A

Hadoop and Spark are often used for big data applications.

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

Microsoft Access is generally considered a(n) _____ database platform.

A

desktop

Desktop databases are typically hosted on a workstation rather than a dedicated server, and they’re designed to support a few to a few hundred users.

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

Relational databases can store all of these except what?

A

graph data

Some NoSQL databases are designed to store data arranged as graphs rather than in relations.

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

A stored procedure is _____.

A

a predefined query or statement

Stored procedures are queries that are stored on the server, and they can be called by developers or users in their queries.

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

An index _____.

A

helps to increase the speed of lookups using a particular column at the cost of speed while modifying records

As with denormalization, indexes offer a trade off.

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

What is it called when a malicious user tries to change the way a SQL statement works by entering their own SQL?

A

injection

This kind of attack involves someone injecting their own code into an application.

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

If you store certain kinds of information, your database may be subject to certain compliance regulations. True or false?

A

TRUE

If you store personally identifiable information (PII), health information, or some other kinds of information, your database may be subject to various regulations. Be sure to do your research and stay in compliance!

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

What is a database transaction?

A

a group of statements that runs or fails as a whole

Transactions combine multiple statements into a single logical block, where one failing statement rolls back the entire action.

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

What is a table?

A

A table stores and displays data in a structured format consisting of columns and rows that are similar to those seen in Excel spreadsheets.

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

What does SQL do?

A

SQL is used to access and manipulate a database.

It can be used to select & filter, add and remove data and tables, and much more.

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

The SELECT statement

A

used to select data from a table.

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

*

A

selects all columns of the table.

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

in order to select everything from the Customers table, we use the following:

A

SELECT * FROM Customers

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

Instead of *, we can specify a column that we want to select.

For example, let’s select only the City column:

A

SELECT City FROM Customers

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

We can specify multiple columns in the SELECT statement by separating them with commas.

For example:

A

SELECT firstname, lastname FROM Customers

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

You can run multiple SQL queries, by separating them with semicolons.

For example:

A

SELECT firstname, lastname
FROM Customers;

SELECT firstname, city, age
FROM Customers;

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

SQL is case insensitive.

The following statements are equivalent and will produce the same result:

A

select city from Customers;
SELECT City FROM Customers;
sElEct ciTY From Customers;

Common practice is all upper case

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

The ORDER BY command

A

used to sort the data in a SELECT statement.

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

By default, ORDER BY sorts the results in

A

ascending order. (A to Z)

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

We can specify the ordering using the

A

ASC and DESC keywords.

SELECT * FROM Customers
ORDER BY firstname DESC

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

lets sort our Customers data using the city column, followed by the lastname column:

A

SELECT * FROM Customers
ORDER BY city ASC, lastname DESC

95
Q

The SELECT statement returns all the rows in the table.

In case we only need a specific number of rows from the table, we can use

A

the LIMIT keyword.

96
Q

let’s select only the top 3 rows from our table:

A

SELECT * FROM Customers
LIMIT 3

97
Q

We can combine the LIMIT with ORDER BY.

For example:

A

SELECT * FROM Customers
ORDER BY city DESC
LIMIT 3

Remember, the LIMIT keyword has to come after the ORDER BY in the SELECT statement.

98
Q

We can also select rows starting from an offset.

For example, let’s select 3 rows starting from the 3rd:

A

SELECT * FROM Customers
ORDER BY city DESC
LIMIT 3 OFFSET 2

The first row has the offset 0, which is why OFFSET 2 will start from the 3rd row in the result.

99
Q

We can remove the duplicates using the

A

DISTINCT keyword.

100
Q

To select only specific rows that satisfy a condition

A

WHERE command can be used.

101
Q

For example, let’s select the rows that have the age column greater than 30:

A

SELECT * FROM Customers
WHERE age > 30

102
Q

The following comparison operators can be used in the WHERE condition:

A

> greater than
< less than
= greater or equal
<= less or equal

103
Q

o check for equality, the

A

equal to operator = can be used:

WHERE age = 42

104
Q

To compare with a text value, put the

A

text value in single quotes.

WHERE firstname = ‘James’

105
Q

The not equal operator is

A

<>

106
Q

The BETWEEN operator can be used to

A

Select rows that are in a range of values.

SELECT * FROM Customers
WHERE age
BETWEEN 30 AND 50

107
Q

The AND operator

A

combines two conditions and is satisfied if both conditions are satisfied.

SELECT * FROM Customers
WHERE age >= 42 AND age <= 60

108
Q

the OR operator

A

satisfied if any one of its conditions holds.

SELECT * FROM Customers
WHERE city = ‘New York’ OR city = ‘Chicago’

109
Q

the IN operator

A

Instead of multiple OR conditions for a single column, the IN operator can be used.

SELECT * FROM Customers
WHERE city IN (‘New York’, ‘Chicago’)

110
Q

The NOT IN operator

A

allows you to exclude a list of specific values from the result set.

SELECT * FROM Customers
WHERE city NOT IN (‘New York’, ‘Chicago’)

111
Q

When combining conditions, it is important to

A

use parentheses, so that the order to evaluate each condition is known.

112
Q

Any text values in SQL statements need to be enclosed in

A

single quotes.

113
Q

SQL supports filtering text based on a search condition.

This can be done using

A

the LIKE keyword, by specifying a pattern for the text.

SELECT * FROM Customers
WHERE lastname LIKE ‘%s’

For example, let’s select all Customers where the lastname column value ends with an ‘s’:

114
Q

To match only a single character

A

the _ underscore symbol can be used.

SELECT * FROM Customers
WHERE firstname LIKE ‘_ames’

This will match all the Customer firstnames that start with any letter, then end with ‘ames’.

115
Q

NULL is

A

the absence of value.

This means that any field in our table with no value with have the value NULL.

116
Q

To check for NULL values

A

the IS NULL operator can be used.

SELECT * FROM Customers
WHERE age IS NULL

117
Q

Similarly, we can check for non-null values using

A

IS NOT NULL

SELECT * FROM Customers
WHERE age IS NOT NULL

118
Q

the COUNT() function

A

is used to return the number of records of a select statement

SELECT COUNT(*)
FROM Customers

This will return the number of rows in the table.

119
Q

SUM()

A

It returns the sum of the values in a column.

SELECT SUM(salary)
FROM Customers

120
Q

The AVG() function

A

returns the average value of a numeric column.

SELECT AVG(salary)
FROM Customers

121
Q

MIN() and MAX() are used to

A

return the minimum and maximum value of a column

SELECT MIN(salary)
FROM Customers;

SELECT MAX(salary)
FROM Customers;

122
Q

the UPPER() function

A

can be used to convert text to uppercase.

SELECT UPPER(firstname)
FROM Customers

123
Q

We can provide a new name for the column with the

A

AS keyword

SELECT UPPER(firstname) AS Name
FROM Customers

124
Q

SQL allows to group records using the

A

GROUP BY clause

125
Q

SELECT city, COUNT(*)
FROM Customers
GROUP BY city

A

This query will return the number of customers in each city, as well as the city name.

126
Q

We can filter groups using the

A

HAVING clause

SELECT city, COUNT() AS c
FROM Customers
GROUP BY city
HAVING COUNT(
) > 1
ORDER BY c DESC

127
Q

Creating a basic table involves

A

naming the table and defining its columns and each column’s data type.

128
Q

INT

A

whole number

129
Q

FLOAT

A

floating point number

130
Q

DOUBLE

A

A double precision floating-point number

131
Q

DATE

A

A date in YYYY-MM-DD format

132
Q

DATETIME

A

A date and time combination in YYYY-MM-DD HH:MM:SS format

133
Q

TIMESTAMP

A

A timestamp, calculated from midnight, January 1, 1970

134
Q

TIME

A

Stores the time in HH:MM:SS format

135
Q

VARCHAR(M)

A

Variable-length character string. Max size is specified in parenthesis

136
Q

TEXT

A

Large amount of text data

137
Q

The CREATE TABLE command

A

defined the table name and the columns list in parentheses.

138
Q

A column can also have a default value, which is applied to the rows when no value is provided for it. It is defined using the

A

DEFAULT keyword

CREATE TABLE Customers (
id INT,
firstname VARCHAR(128),
lastname VARCHAR(128),
salary INT DEFAULT 0,
city VARCHAR(128)
);

139
Q

We can also specify if a column can or cannot have NULL values.

For example

A

CREATE TABLE Customers (
id INT,
firstname VARCHAR(128) NOT NULL,
lastname VARCHAR(128),
salary INT DEFAULT 0,
city VARCHAR(128)
);

Now, when inserting data into the table, the firstname column has to have a value.

140
Q

When the table is created, it is empty.

We can insert data using the

A

INSERT command

INSERT INTO Customers VALUES
(1, ‘John’, ‘Smith’, ‘New York’, 5000)

141
Q

The UPDATE statement allows you to

A

change values in a table.

UPDATE Customers
SET salary = 9900
WHERE id = 2

142
Q

It is also possible to UPDATE multiple columns at the same time by comma-separating them:

For example:

A

UPDATE Customers
SET salary = 9900,
city = ‘New York’
WHERE ID = 2

143
Q

Similar to UPDATE, the DELETE command is used to

A

delete rows from a table

DELETE FROM Customers
WHERE ID = 4

144
Q

The ALTER TABLE command is used to

A

add, delete, or modify columns in an existing table

For example, let’s add a new column to our Customers table:

ALTER TABLE Customers
ADD age INT

145
Q

we can delete an entire column with

A

DROP COLUMN

146
Q

The ALTER TABLE command can also be used to rename a column

A

ALTER TABLE Customers
RENAME city TO location

147
Q

We can rename an existing table using the following

A

ALTER TABLE Customers
RENAME TO People

148
Q

To delete an entire table, the following command is used

A

DROP TABLE Customers

149
Q

What is a Relational Database?

A

Stores data in tables

150
Q

Normalization

A

The process of building the best database design

151
Q

Keys

A

How to make everything unique in a table

152
Q

Record, Rows, Tuple

A

All talking about the rows in a table

153
Q

Columns, Field, Attributes

A

All talking about the columns in a table

154
Q

Frontend

A

What the user sees

155
Q

Backend

A

What’s going on behind the scenes

156
Q

Joins

A

Connects data from multiple tables

157
Q

Atomic Value

A

The value stores one thing

158
Q

Entity

A

This would be like a column header “name”

159
Q

Attributes

A

This is the stuff that is under the heading, like the actual names themselves; this is the actual information

160
Q

Foreign Key

A

The child in the parent to child relationship. It is a reference to a primary key.

161
Q

Explain the Child and Parent relationship concept in Database Design

A

Parent would be something like the user name

Child would be the comments that this user makes.

Children inherit the values from their parents

162
Q

What rules are followed with Keys?

A

Unique, never changing, never null

163
Q

Superkey

A

Any number of columns that create unique rows

164
Q

Candidate Key

A

The least number of columns needed to force every row to be unique

165
Q

Natural Key

A

Something that you naturally want to store (username and password, for example)

166
Q

Surrogate Key

A

Giving an ID to every row in every table

167
Q

Simple Key

A

Key consists of one column

168
Q

Composite Key

A

Key consists of two or more columns. Most common with natural keys.

169
Q

Compound Key

A

Key that has multiple columns, and they’re all keys.

170
Q

Entity Relationship Modeling

A

It’s when you draw out your database before you make it

171
Q

Cardinality

A

Relationship type between rows (ex: Cardholder and card)

172
Q

Modality

A

Whether or not the relationship is required. (ex: not null)

173
Q

Normalization

A

When we go through our database and start correcting things that may case problems (integrity, repeating, etc.)

174
Q

What are the three steps in normalization?

A

1st Normal Form, 2nd Normal Form, 3rd Normal Form. Can’t do the next one until you’ve done the one before it.

175
Q

What is second normal form?

A

Deals with a partial dependency. That’s when a column only depends on part of the primary key. In order for that to happen, you need to have a compound or composite key.

176
Q

What is third normal form?

A

Deals with what is called a transitive dependency. Which is when a column depends on a column that depends upon the primary key.

177
Q

What is an index?

A

It’s a list of where certain data points are.

178
Q

What is a nonclustered index?

A

Just a separate reference that points to the data

179
Q

What is a clustered index?

A

organizes the actual data. You can only have one of these. (like a phonebook)

180
Q

Three main categories of Data Types?

A

Date, Numeric, and String

181
Q

What is a string?

A

it is a combination of characters

182
Q

What is numeric in data types?

A

Numbers, no quotes

183
Q

What is date in data types?

A

stores a date. Think DATE, TIME, or DATETIME. Usually, colons separate.

184
Q

Join?

A

Taking something complex in a database and presenting it in a user friendly way.

185
Q

What is an inner join?

A

Going to take rows that are the same from one table and rows that are the same from another table and join them together to make a new table

186
Q

What is an outer join?

A

Returning all values; left outer join, right outer join and full outer join

187
Q

What is an alias?

A

It’s when you rename something to make it easier to understand using the “AS” command

188
Q

What are the four components of a database system?

A

Users

Database Applications

Database Management System (DBMS)

Database

189
Q

What is a database?

A

A self-describing collection of related records

190
Q

What is metadata?

A

Data describing the structure of the data in a database

191
Q

What is a DBMS?

A

Serves as an intermediary between database applications and the database

192
Q

What is normalization?

A

It’s a process where we go through our table and try to eliminate the null values

193
Q

What is a functional dependency?

A

ex: box price and cookie price; they are dependent upon one another

194
Q

What is first normal form?

A

each cell within the table has one value (atomic)

195
Q

What is second normal form?

A

Beyond all requirements of the first normal form, it must be fully functionally dependent on the entire primary key. No partial dependencies.

196
Q

What is the most important concept to remember when it comes to normalization?

A

All your tables should have to do with one business concept.

197
Q

Who originally developed SQL?

A

IBM

198
Q

SQL is comprised of three components. What are they?

A

data definition language (DDL), data manipulation language (DML), and data control language (DCL)

199
Q

What is DDL?

A

used to define and manage database structures

200
Q

What is DML?

A

data definition and updating, and data retrieval (queries)

201
Q

What is DCL?

A

used for creating user accounts, managing permissions, etc.

202
Q

what do you end all SQL statements with?

A

semicolon

203
Q

What does the INSERT INTO statement do?

A

Will add a new row to a table

204
Q

What does the UPDATE statement do?

A

Will update the rows in a table which match the specified criteria

205
Q

What does the DELETE FROM statement do?

A

Will delete the rows in a table which match the specified criteria

206
Q

What does the SELECT statement do?

A

Extracts information you specify from the database.

207
Q

The DISTINCT keyword may be added to the SELECT statement to

A

Suppress the display of duplicate rows

208
Q

The WHERE clause

A

specifies the matching or filtering criteria for the records (rows) that are to be displayed

209
Q

The multiple character wildcard character is a

A

percent sign

210
Q

The single character wildcard character is

A

an underscore

211
Q

Queried data can be categorized by what clause?

A

GROUP BY

212
Q

HAVING

A

filters the categorized results that you get from the select statement

213
Q

OUTER JOIN

A

Can be used to obtain data that exists in one table without matching data in the other table

214
Q

What are the three stages of database development?

A

Requirements analysis stage, component design stage, implementation stage

215
Q

Entity Class

A

this is like the recipe that someone follows for a cake, while the entity instance is actual cake that comes about as a result

216
Q

What is an attribute?

A

they describe a specific entity. example are projectName, startDate, projectType, projectDescription

217
Q

What is an identifier or key?

A

It identifies a specific instance in the entity class, for example, socialSecurityNumver, studentID, employeeID, emailAddress, departmentId

218
Q

Unary Relationship

A

an entity is related to itself (Marriage)

219
Q

Binary Relationship

A

one entity is related to another entity (most common) (employee and parking space)

220
Q

ternary relationship

A

three entities involved in the relationship (doctor, patient, drug; intersection of those would be a prescription)

221
Q

Relationships are named and classified by their cardinalities, which is a word that means

A

Count (as in the number of items in a set)

222
Q

Minimum cardinality

A

minimum number of entities that need to participate in a relationship

223
Q

What is concurrency?

A

People or applications may try to update the same information at the same time

224
Q

What is interdependency?

A

Changes requested by one user may impact others

225
Q

Atomic Transaction

A

all of the database actions occur or none of them does. Each step must be successful for the transaction to be saved

226
Q

Dynamic Cursor

A

All changes made to the rows in the result set are visible when scrolling through the cursor

227
Q

What do processing rights define?

A

Who is permitted to perform certain actions

When certain actions are allowed to be performed

228
Q

Index

A

a data structure that contains a copy of some of the data from one or more existing data tables

229
Q

Indexes are created on one or more ______ in a table

A

columns

230
Q

B-Tree Index

A

Use pointers and several layers of nodes in order to quickly locate desired data

231
Q

Bitmap Index

A

A table is created with the values of one attribute along the horizontal axis and the values of another attribute along the vertical axis. Can be really fast.

232
Q

Hashed Index

A

a hashing algorithm is used in order to convert an input value into a location within an index (such as a B-tree index), which in turn contains or points to the actual data row.

233
Q

What are the two categories of Business Intelligence systems?

A

Reporting systems

data mining applications