Relational: Use a relationship to represent the connection between entity information and entities
Relationship: is a two-dimensional table with rows and columns of tables
Creating database: Create library name; fault level creation: CREATE database if not exists library name;
When creating a database with a system reserved word, wrap the method with the library name (enclose the system reserved word in inverted quotation marks)
Specifies the character set default CharSet =GBK;
Delete database drop DB if exists library name;
Creating table: Create Table name (field, attribute, keyword primary key);
Modify the structure of the table: ALTER TABLE name add field property;
Modify properties: ALTER TABLE name modify field property;
Add data to a table: INSERT into Table name (property) values (value), attribute to value one by one
If the table structure of the other table or the corresponding field type is exactly the same, then you can write the INSERT into table name Select*from other tables
If the other table fields are not consistent, you can insert some of the field contents, but the request type corresponds
Insert into Student2 (student_id,student_name) select Student_id,studentname from Student_info;
Query data select* or field list from table name where condition
Select + as number, GETDATE () as Date, NEWID () as number;
Querying and Grouping
Select F_money,count (*), GETDATE () as Shijian from Temployee Group by F_money have COUNT (*) >1; select F_money,count (*) From Temployee where f_age>22 Group by F_money;//group by in the back of the where, in front of the having statement, having is filtering the information after grouping, the columns that can be used are the same as in select
Conditional query
Select Top 3*from temployee ORDER by F_money ASC;
Modify data:Update table name set field name = new Value, ... Where Condition ...
Delete Data : Delete from table name where. ORDER BY ... Limit
SQL Server Basic Operations