一.c#最基本的格式:
[code]Using System;
Namespace U{
Class Stu{
Public void sum(int a,int b){
Int c;
C=a+b;
Console.writeLine(c );
}
Static void Main(string [] args){
Stu h=new Stu();
h.sum(5,5);
Console .readkey();
}
}
}[/code]
二.Sql语句:
1--建立数据库
create database bulls
2--引用数据库
Use bulls
3--建立表
Create table stu(
Id int identity (101,1) primary key,
Name varchar(50) not null
Password varchar(10)
)
4--查询表中所有信息
Select * from users
声明:此篇文档时来自于【狗刨学习网】社区-unity极致学院,是网友自行发布的Unity3D学习文章,如果有什么内容侵犯了你的相关权益,请与官方沟通,我们会即时处理。
5--插入一行数据
Insert into <表名> [(列名)] values(值列表)
6--更新数据
Update <表名> set <列名=‘更新值’>
Delete from <表名> [where<删除值>] 不释放空间,有定义;
7--删除数据
Delete from <表名> [where <删除值>]
8--删除库和删除表
Truncate table stu (删除内容,释放空间,还有定义)
9--添加一列
Alteer table 表名 add 列名 类型 (长度)null
10--更改列类型
alter table users alter column age varchar(3)
11--删除一列
After table users alter drop column age
12--内连接
Select students.sname,score.courseID,score.score
From students.score id,c.score
Where students.scode ID,c.score
13--左外连接select s.sname, c.course id, c.score
From studentts as s
Left join score as c
On c.studentid =s.scode
14--右外连接
Select titles.title_id, titles,publishers,pub_name
From titles
Right outer join publishers
On titles .pub_id =publlishers.pub_id