Today's notes are mainly about the common sense of the database, and the creation of the database. The method to create the database is similar, so master this, create a database is ok (normal use enough). Of course, it is relatively rare to create a database in real work. The database is designed using the Build Library tool (Eg:powerdesign).
---2014.07.29
Commonly used databases:
Ms:sqlserver2008->.net
IBM:DB2 tobacco.
Oracle: Oracle Bank, securities ...
Non-commercial:mysql->ibm,oracle-> small site
Access,sysbase
SQL: Structured Query Language ! T-SQL Sql-plus
Classification of SQL languages:
1.DDL: Data definition language, Create,drop, delete ....
2.DQL: Data Query Language Select
3.DCL: Data Control Language Rights management ....
4.DML: Data Manipulation language Insert,delete, update
The history of database development:
1. Ropes Notes
2. Mind
3. disk files
4. Relational database->sql Server
5. Relational-Object Database->oracle
Database db: not just a table! + Management, views, stored procedures, triggers .....
DBMS: database management system:
DBA: database administrator
DBO: database owner
Redundancy : more data out!
inconsistency: redundancy results in inconsistent data!
Classification of database files:
1. Physical File Partitioning
1.1 Data files (primarily for data information)
1.1.1 Main data files: *. MDF =1
1.1.2 times to data file: *. NDF >=0
1.2 Log file LDF >=1
2. Logical structure to divide
2.1 System Database
2.1.1 Master: Core components->sql normal operation
2.1.2 Model: Template->19 File
2.1.3 msdb: Alert warning
2.1.4 Tempdb: Staging Database-"intermediate data"
2.2 User-defined database
Ms->northwind (the database used for learning, can be downloaded on the internet to see)
Filegroup: = "Data file
1. Main filegroups:->mdf
2. User-defined filegroup:->NDF
Recite the code (a person who has no foundation, just recite it or understand it.) Personal recommendation Understanding Good)
--Jump Core Library UseMasterGo--Batch processing--Create directory d:\11.30execxp_cmdshell'MD d:\11.30'--to use this, to configure SQL configuration, configure the method belowGo--determine if the database exists and delete it if it exists! if db_id('db_1130') is not NULLDrop Databasedb_1130GoCreate Databasedb_1130 on Primary(Name='YL',--Logical NameFileName='D:\11.30\yl.mdf', size=3, MaxSize=5, FileGrowth= -%)Log on(Name='Yllog',--Logical NameFileName='D:\11.30\yl.ldf', size=3, MaxSize=5, FileGrowth= -%)Go
Configuration:
Login sql2008--"Right-click Server--" Select - -"Open dropdown box-" SELECT "Peripheral Application Configuration"-Xpcmdshellenable select true; Ok
PS: Picture upload is too troublesome, forgive me. Do not understand can m me.