This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10700|Reply: 5

The basic operations of the table on the basis of the database

[Copy link]
Posted on 2/28/2019 9:31:08 PM | | | |
preface
Last week was my first post, and I worked hard for a few hours to typeset, but when I published it, the style collapsed...... People really want to cry... In the end, I troubled the webmaster to help me rearrange it. Thank you, webmaster, Arrigado...

Following the database basics (database creation and deletion, log cleaning) in the previous article, today I will sort out the related operations of database tables.


tools

>SQL Server2017


Text

#Create a table


The results are as follows:




In this way we create two tables. So how to check how many tables are in this database:



#Query form

*Information about the inquiry form
The results are as follows:


Here we can see the information about the table we just created. (The data in the query table will be explained in detail in the next topic)


* Query all fields in the table

The results are as follows:




Here we can see that there are two fields in the Test table. Of course, we can also use "select * from Test".



#Modify the table

The above are some routine operations of table fields, you can familiarize yourself with them several times. At the beginning of writing a project, the database must be designed first. Some constraints of the database and indexing will greatly improve the development efficiency of the project and reduce many unnecessary judgments in the code. For example, add a unique constraint to a field in the database. When writing code, we insert and modify it, and there is no need to make uniqueness judgments. It can make the code more concise.



#Delete the table





These are the additions, deletions, and corrections to the table. In the next issue, we will start working on the table data. I've been too busy lately, and I have studied a lot of technical points, and I don't have time to write a post, so I will slowly make up for it in the future.




Previous:C# parses the second mvc uses Newtonsoft.Json deserialization
Next:Dependent on the use of injected Autofac
Posted on 3/1/2019 9:11:33 AM |
Not bad
I am on the first floor
Posted on 3/1/2019 9:12:18 AM |
Write well, I am Zhang San, and I want to write too
Posted on 3/1/2019 9:12:43 AM |
I learned and needed good information~~
Posted on 3/1/2019 9:14:47 AM |
I learned it~ It's very useful! Thank you for your hard work, young lady! Compare hearts
Posted on 3/1/2019 2:32:14 PM |
Write well, I am Zhang San, and I want to write too
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com