今天开始看SQL 打算半个月搞定这本书
第一天读书笔记
1
SQL Server 2005 comes with some default System databases--master, model, msdb, and tempdb
master is a database composed of system tables that keeps track of server installation as a whole and all other databases that are subsequently created. The SQL Server Management Studio query window defaults to the master database context. Any queries executed from the query window will execute in the master database unless you change the context.
model is a template database. Every time a new database is created, SQL Server makes a copy of the model database (and all of the objects in it) to form the basis of the new database. If you want all your new databases to inherit certain properties, you could include these properties and objects in your model database.
msdb is a database that contains the metadata and database objects used by the SQL Server agent that performs scheduled activities such as backups and replication tasks.
tempdb is a temporary database or workspace recreated every time SQL Server is restarted. tempdb is used for temporary tables created by users and to hold intermediate results created internally by SQL Server during query processing and sorting.
The most important thing you do in SQL Server 2005, or in any other database for that matter, is query the database. Queries in SQL Server 2005 are typed in the query editor. The query editor can be opened in two ways, both select New Query.
you also Open or Activat the Database Using USE(key word).
3
第一个查询语句
USE Student_course//Student_course是所用的数据库名字
SELECT *
FROM Student//Student是表的名字
4 1。17不懂以后在看