Study Notes
this week is the seventh week and our group has Modeling SQL Server , building tables, inserting data. Now the attention and problems, the solution is organized as follows.
the first is modeling. The first step in modeling is to create a folder in the appropriate location, for example: set up a folder called the outpatient information system on the F-disk. Start SQL, Create a database within the SQL environment, and put the data files and log files into the folder, the process reference figure 1-1.
Figure 1-1
then, start building the table. Similarly, we started using CREATE table ~ to build tables, and the various columns of the value range, completeness, constraints, etc. are implemented in the table, the specific process can refer to Figure 1-2.
Figure 1-2
Last Insert data, insert data with insert+ the table name, list the individual attributes (columns) in the table, and then insert the data into the code in a certain format, referring to the process reference figure 1-3.
Figure 1-3
The results of the implementation are as follows:
In the process of data table establishment, there are problems of establishing primary key and foreign key. Note:1. The primary key matches the foreign key's data type, or a warning of execution errors occurs. In the establishment of the foreign key, be aware that it is an external key, connected to the table. 2. when inserting data, to match the data type and how many columns the attribute has, insert a few columns of data to avoid data insertion problems. 3. when you execute a table, you can select it to execute before you can avoid duplicating other tables and libraries. 4. If you encounter this table already exists, you can use the drop+ Table name / the library name deletes the table and re-establishes it in the selected table.
- when inserting data incorrectly, you can use the the delete+ table name deletes the data in the table.
This is the week's problem and homework.
2017.10.21
701 Group
Database Building Library building Tables Learning notes