Part 1 connecting to SQL Server using SSMS
Note That,ssms is a client tool and not the server by Itself,it are a developer machines connects to SQL server.
Part 2 Creating altering and dropping a database
You cannot drop a database, if it was currently in use you'll get an error stating. So, if other users is connected, you need to put the database in a single user node and then drop the Database.system data Base cannot be dropped.
Part 3 Creating and working with tables
For Example:add a foreignkey relation.
Table:student:id,genderid;
Gender:id,studentid;
Alter Table ADD Constraint STUDENT_GENDERID_FK FOREIGN KEY References Gender (ID)
Syntax:
Alter table foreign key table name add constraint foreign KEY constraint name
FOREIGN key (foreign key name) references primary table name (primary key name)
Note:foreign Keys is used to enforce (mandatory) database integrity (complete). In layman ' s terms (generally), A foreign key in one table points to A primary key in another table. The foreign KEY constraint prevents invalid data form being inserted into the foreign key column. The values that you enter into the foreign key column, have to is one of the values contained in the table it points to.
Part 4 Adding a DEFAULT constraint
Altering an existing column to add a DEFAULT constraint:
ALTER Table Table Name
ADD CONSTRAINT Constraint name
Default value for column name
Adding a new column with the default value, to an existing table:
ALTER Table Table Name
Whether the ADD column name data type allows NULL
CONSTRAINT Constraint name default defaults
Dropping a constraint:
ALTER Table Table Name
DROP CONSTRAINT Constraint name
Part 5 cascading referential integrity constraint
Part 6 Adding a CHECK constraint
Part 7 Identity Column in SQL Server
Part 8 What do I get the last generated identity column value in SQL Server
Part 9 Unique Key constraint
Part of Select statement in SQL Server
Select specific or all columns
SELECT * FROM table name
Select column name, column name ... from table name
Distinct rows
Select DISTINCT column name from table name
Filtering with WHERE clause (clause)
Wild Cards in SQL Server
Joining multiple conditions using and AND and OR operators
Sorting rows using order by
Selecting top N or Top n percentage of rows
SSMS for beginner Part 1 to 10