Professor Week 4 Flashcards

1
Q

What are the two main types of data integrity checks?

A

atomic that looks at the proposed field value – not null, CHECK
relative checks that compare the proposed field value to other value – unique, check (if validation refers other attributes)

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

How to use Select

A

SELECT * | attributes to include
FROM tableName
WHERE condition(s);

Don’t have to use WHERE;

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

Logical Operators

A

Not – reverses the result
AND – both conditions must eval to true
OR – one or the other
BETWEEN – will include values that are greater or equal to min and less than or equal to the max

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

Relational Operators

A

Relational Operators
> Greater Than
>= Greater Than or Equal To
< Less Than
<= Less Than or Equal To
= Equal To
<> Not Equal To
!= Not Equal To
IN (list) Contained in comma-separated list
LIKE string Matches string pattern

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

LIKE

A

to specifiy our pattern we use characters and wildcards
characters must be present
wildcards are placeholders
_ means exactly one char
% means 0 or more char

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

Calculations

A

Calculations can be performed in the SELECT clause of a SELECT statement

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

DML: UPDATE

A

modifies existing user data

UPDATE tableName
SET field1 = value1, fieldN = valueN
WHERE condition;

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

DML: Delete

A

Removes record(s) from the table

DELETE
FROM tableName
WHERE condition(s);

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

ALTER TABLE

A

to change the structure, instead of dropping it and creating it again
Add/Drop a primary key constraint
Add/Modify/Drop a column
Add/Drop/Modify a default value

cannot modify a table level constraint

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

ADD | DROP Columns

A

Alter TABLE tablename
ADD | DROP COLUMN columnName;

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

Altering defaults

A

Only “property” that you can alter
ALTER TABLE tableName
ALTER description SET DEFAULT default;

ALTER TABLE tableName
ALTER description DROP DEFAULT;

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

ALTER TABLE Modify Column

A

Through the ALTER TABLE … MODIFY COLUMN statement, you can edit an existing
attribute’s specification, including changing the data type or adding/removing a
NOT NULL constraint or DEFAULT value
ALTER TABLE tableName
MODIFY COLUMN attribute DATATYPE [NOT NULL] [DEFAULT];

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