Special note: In sqlserver2014, case insensitive, that is, SQL is case insensitive
Database Model 3 classes:
- Hierarchical model
- Mesh model
- Relational model
3 Types of relational database languages:
- DDL Data Definition Language
- Create (creates a library or database object), ALTER, DROP
- DML Data Manipulation language
- SELECT (retrieve table or view), UPDATE, INSERT, DELETE
- DCL Data Control Language
- Grant (grant permission), REVOKE (revoke permission), deny (Deny permission, and prohibit inherit permission from other roles)
System Database 4:
- master database
- Log all system information, such as login account, System configuration
- Model database
- All database templates, modifications to the model database will be applied to all future databases
- msdb database
- tempdb database
Template browser window
SSMS provides a large number of script templates that contain parameters that are supplied by the user, using this parameter to enter only one name at a time, and then automatically copy the changed name to all the necessary locations in the script.
Create a database using a template
To create database from the Template browser window, drag to the query window, automatically creating the code
Select query = = To specify the value of the template parameter,
Replace the original value in the open window and change to "Sales management 2" to determine
Then analyze it first, then click the Execute button to
View the online Help documentation
Here's the help document, the amount of data is very large
Select sqlserver2014 developer Reference, installation, Microsoft SQL Server Language Reference, click Update
Manipulate database files (add and revise)
Add a log file for sales Management 2
View database files First
modifying database files
Write Execute SQL, modify the file location of the database, size
ALTER DATABASE Sales Management 2MODIFY FILE (name= sales Management 2,filename= ' e:/data/sales Management 2.mdf ', SIZE=12MB) GO
Delete a database file
ALTER DATABASE Sales Management 2REMOVE FILE Sales Management 2_2
Note: The primary database file and the primary log file are not deleted
Additional data types supported by sqlserver2014
Data Integrity 4 Types:
Entity integrity (rows, data is not duplicated)
Domain integrity (columns, satisfying for specific constraints)
Referential integrity (foreign KEY constraints)
User-defined integrity (custom constraints, triggers)
To set the force Modification data table
SQLSERVER2014 installation, the default is not forced to modify the data table structure, if you want to modify, set the method as follows:
Tool = = "option = =" designer = = "Table Designer and Database Designer = =" Block save ... Check to remove, OK
SQL for creating views (can be created using SSMS)
A view of CREATE view
As SQL statements
GO
Like what:
Use Sales Management gocreate view Asselect buyer name from buyer table Go
SQL Serever Learning 15--Advanced