Database Building Library building Tables Learning notes

Source: Internet
Author: User

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.

    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.