Here is a table of basic SQL commands that may be useful for a SQL Server DBA:
Command | Example | Description |
---|---|---|
SELECT | SELECT * FROM my_table; | Used to retrieve data from a database |
INSERT | INSERT INTO my_table (column1, column2) VALUES (value1, value2); | Used to add new data to a database |
UPDATE | UPDATE my_table SET column1 = value1 WHERE condition; | Used to modify existing data in a database |
DELETE | DELETE FROM my_table WHERE condition; | Used to delete data from a database |
CREATE | CREATE TABLE my_table (column1 datatype, column2 datatype); | Used to create new objects in a database, such as tables or indexes |
ALTER | ALTER TABLE my_table ADD column3 datatype; | Used to modify existing objects in a database, such as changing the structure of a table |
DROP | DROP TABLE my_table; | Used to delete objects in a database, such as tables or indexes |
TRUNCATE | TRUNCATE TABLE my_table; | Used to quickly delete all data from a table, without logging the individual row deletions |
BACKUP | BACKUP DATABASE my_database TO DISK='C:\my_backup.bak'; | Used to create a backup of a database or its individual components |
RESTORE | RESTORE DATABASE my_database FROM DISK='C:\my_backup.bak'; | Used to restore a database or its individual components from a backup |
Keep in mind that this is just a basic list of commands and there are many more advanced commands and features available in SQL Server.