SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
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
2
Q

Example of Create in SQL?

A

INSERT INTO TableName (ColName1, ColName2)
VALUES (value1, value2)

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

Example of Read in SQL?

A

SELECT column name
FROM table name
WHERE Condition is true
AND another Condition

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

Example of Update in SQL?

A

UPDATE table name
SET column name = new value 1
WHERE column name = some value

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

Example of Delete in SQL?

A

DELETE FROM table name
WHERE column name = some value

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

Example of INNER JOIN in SQL?

A

SELECT TableName1.ColName1 TableName2.ColName2
FROM TableName1 JOIN TableName2 ON TableName1.PK = TableName2.FK

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

What are the variations of the use of LIKE in SQL?

A

LIKE ‘Ber%’ (selects items with “ber” at the start).
LIKE ‘%co%’ (selects all customers with a city containing the pattern “co”)

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

What does an NESTED SELECT look like in SQL?

A

SELECT ColumnName1
FROM TableName1
WHERE ColumnName1 =/IN (SELECT ColumnName2
FROM TableName2
WHERE ColumnName2 = someValue)

IN is used when more than one result will return.

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

What are transactions?

A

BEGIN TRANSACTIONS;
They have to happen all at once as if there is a power cut, the data will be lost.

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

What is the ACID principle?

A

Atomicity - all or nothing.
Consistent - all of the database rules must be followed.
Isolation - order of execution doesn’t matter.
Durability - once committed, the transaction must stay committed.

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

What is record locking?

A

When a record is locked so it won’t get overwritten.

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