SQL-Commands DDL Flashcards
1
Q
DDL - Data Definition Language
A
statements are defining database schema
2
Q
Create
A
Create objects in the database
CREATE TABLE table_name
(column_name data_type,
column_name data_type)
CREATE TABLE table 1
( ID int,
Last_name varchar(25)
)
3
Q
Alter
A
Alter columns in an existing table
Add
ALTER TABLE table_name
ADD column_name data_type
Delete
ALTER TABLE table_name
DROP COLUMN column_name
Modify
ALTER TABLE table_name
MODIFY column_name data_type
ALTER TABLE table_name
RENAME COLUMN column_name 1 to column name 2
4
Q
Drop
A
Delete a table
DROP TABLE table_name
5
Q
Truncate
A
Delete data in the table, but not table itself (架空table)
TRUNCATE TABLE table_name
6
Q
Rename
A
Rename an object