MySQL Flashcards
Advantages of DBMS
Elimination of data redundancy
Data consistency on all devices
Sharing of data
Improved data integrity
Privacy and security
Backup and recovery
Attribute
Column
Tuple
Each row
Cardinality
Down
Degree
Side
Primary key
Candidate key
Primary key- An attribute of a group of attributes that can uniquely identify tuples within the relation.
Candidate - capable of…
Alternate key
A candidate key that’s not primary
Foreign key
Non key attribute whole value is derived from primary key or something other table
Remove an existing database
Create a database
Open the database
Create a table
View table
View table structure
Drop table
Drop database E;
Create database N;
Use N;
Create table A (…..);
Show A;
Descrbe A; or desc A;
Drop table A;
Add column Aa
Modify the column desc
Rename column to Ab
Remove the column
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;
Add and remove primary key
Alter table N add PRIMARY KEY(Ab);
Alter table N drop PRIMARY KEY;
Insert into
INSERT INTO N(…) VALUES(…);
Add row
INSERT INTO XX VALUES(BLAH BLAH);
Change a data
Update a data
UPDATE N SET Ab=12;
Truncate
Delete
Removes all tuples and free the table
Delete deletes.
TRUNCATE TABLE N;