一.基本操作 1.将数据绑定到DataGridVirw控件上显示的数据列标题将会是数据库中的字段名称,可以在使用select语句时使用AS关键字将转化为列名的别名 select name AS 姓名 from tb_Student; 使用空格也行的 select name 姓名 from tb_Student; 2.在列上进行计算 select stu_id as 学号,stu_math as 数学,stu_english as 英语,stu_chinese as 语文,stu_math+stu…
1: 在Sql Server 中增加一列语句: alter table table_name add column_name [not null] [references ....] 例如在表Major中增加名为AcademicId的一列,设置为不为空,并且设置为外键引用表AcademicId: alter table Major add AcademicId not null referendes Academic(AcademicId); 2: 怎样删除从表中外键约束…
--1.create database CREATE DATABASE MyDB GO --2.use database USE MyDB GO --3.create table CREATE TABLE Teacher ( id INT IDENTITY PRIMARY KEY, tname VARCHAR(10) NOT NULL, tsex BIT NOT NULL, tage INT CHECK(tage>18 AND tage<80) ) GO --4.insert data I…