MySQL Flashcards

1
Q

Advantages of DBMS

A

Elimination of data redundancy

Data consistency on all devices

Sharing of data

Improved data integrity

Privacy and security

Backup and recovery

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

Attribute

A

Column

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

Tuple

A

Each row

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

Cardinality

A

Down

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

Degree

A

Side

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

Primary key

Candidate key

A

Primary key- An attribute of a group of attributes that can uniquely identify tuples within the relation.

Candidate - capable of…

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

Alternate key

A

A candidate key that’s not primary

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

Foreign key

A

Non key attribute whole value is derived from primary key or something other table

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

Remove an existing database
Create a database
Open the database
Create a table
View table
View table structure
Drop table

A

Drop database E;
Create database N;
Use N;
Create table A (…..);
Show A;
Descrbe A; or desc A;
Drop table A;

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

Add column Aa
Modify the column desc
Rename column to Ab
Remove the column

A

Alter table N add (Aa int primary key);
Alter table N modify (Aa varchar(20));
Alter table N change Aa Ab varchar(5);
Alter table N drop Ab;

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

Add and remove primary key

A

Alter table N add PRIMARY KEY(Ab);
Alter table N drop PRIMARY KEY;

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

Insert into

A

INSERT INTO N(…) VALUES(…);

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

Add row

A

INSERT INTO XX VALUES(BLAH BLAH);

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

Change a data
Update a data

A

UPDATE N SET Ab=12;

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

Truncate
Delete

A

Removes all tuples and free the table
Delete deletes.

TRUNCATE TABLE N;

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