2. Selecting, Updating and Deleting Data Flashcards

1
Q

To sort data, you must use which clause?

A

ORDER BY

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

The result set defaults to displaying data in what order?

A

Ascending order.

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

What statement is used to display a result set, to the opposite of ascending order?

A

DESC

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

What is a result set?

A

The result of a select statement which is stored in a result table.

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

Which character is used to close/complete a statement?

A

Semi colon or ;

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

What are some examples of Comparison Operators?

A

> Greater than= Greater than or equal to Not equal to

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

What is an AND operator used for?

A

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

What is an OR operator used for?

A

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

To search or retrieve data you must use which statement?

A

The SELECT statement.

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

Give an example of a statement which would allow you to search for ..

A

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

The data in a table can be removed using which statement?

A

The ‘DELETE’ statement.

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

Why should you be careful when not using a WHERE clause in a delete statement?

A

If you don’t specify which row or column you wish to delete, then the whole table can be deleted.

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

True or false, does a DELETE statement require a WHERE condition?

A

False.

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

What statement allows you to add new data to the table?

A

INSERT

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

Give an example of a query which will allow you to add new data to specific columns.

A

INSERT INTO table (column)VALUES (value1)

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

What statement allows you to change existing data in a table?

A

UPDATE

17
Q

Give an example of a query which will allow you to change data to specific columns.

A

UPDATE table
SET column = newvalue
Optional:WHERE id = value;