c#基本语言和sql语句

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


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值