SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a primary key?

A

Unique identifier in each row of the table

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

What is an entity?

A

Any person or thing in the database

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

What is a foreign key?

A

A foreign key is a field which is a primary key in a linked table

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

What is data redundancy?

A

Waste of data

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

What is data inconsistency ?

A

When the same data exists in different formats in multiple tables

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

What is Structured Query Language (SQL) ?

A

A language used for enquiring and updating database tables in a relational database.

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

SELECT…FROM…WHERE meaning

A

SELECT list of fields to be displayed
FROM list the table or tables where the data will come from
WHERE list of search criteria
ORDER BY list the fields that the results are to be sorted on (default is Ascending)

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

What are the 4 types of SQL?

A

Search, Update, Insert and Delete

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

How does an Insert SQL work?

A

INSERT INTO tableName(column1, column 2)
VALUES (value1, value2)

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

How does an Update SQL work?

A

UPDATE tableName
SET column1 = value1, column2 = value2
WHERE column = value

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

How does delete SQL work?

A

DELETE FROM tableName
WHERE column = value

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

Which SQL statement is used to return only different values?

A

SELECT DISTINCT

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

With SQL, how can you insert “Olsen” as the “LastName” in the “Persons” table?

A

INSERT INTO Persons (LastName) VALUES (‘Olsen’)

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

Which operator is used to select values within a range?

A

BETWEEN

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

Which operator is used to search for a specified pattern in a column?

A

LIKE

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