第16课-数据库开发及ado.net 数据库SQl,创建数据库和表,增删改语句,约束,top和Distinct,聚合函数介绍 SQL语句入门(脚本.命令) SQL全名是结构化查询语言(Structured Query Language) SOL语句是和DBMS“交谈”专用的语言,不同的DBMS都认SQL语法. Sql中字符串使用单引号:通过写俩个单引号来转义一个单引号. Sql中的注释“——” 单行注释比较好 判断俩个数据是否相等使用=(单等号) 在sql语句中sql代码不区分大小写 SQL主要…
一.查询 查询用户所属 表空间 select username,default_tablespace from dba_users where username='xxx' 查询表空间情况 SELECT UPPER(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)", TO_CHAR(ROUND((D…
1.添加字段: alter table  表名  add (字段  字段类型)  [ default  '输入默认值']  [null/not null]  ; 2.添加备注: comment on column  库名.表名.字段名 is  '输入的备注';  如: 我要在ers_data库中  test表 document_type字段添加备注  comment on column ers_data.test.document_type is '文件类型'; 3.修改字段类型: alter…
--如果存在数据库PRogrammerPay  就删除 if exists (select * from sysdatabases where name='programmerPay') drop database programmerPay go --创建数据库programmerPay create database programmerPay on primary ( name ='programmerPay_data', filename='D:\programmerPay\progra…
--创建数据库(create database 数据库名)create database hq20161114go --使用选择数据库(use 数据库名)use hq20161114go --创建学生表(create table 表名( 列名 列类型,列名 列类型……)  )create table xuesheng( code int, name varchar(10), sex char(10), chengji decimal(18,2)) --添加学生信息(insert into 表名…
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Xml;using System.Collections; namespace CommandXML{    public class cmdXML    { /// <summary>        /// 创建XML文件        /// &…
sql 语句: ALTER TABLE oversea_liveauctioneers_detail_info_2018 ADD `result` LONGTEXT, ADD `buyer_premium` LONGTEXT, ADD `item_imgurl` VARCHAR (255) DEFAULT NULL, ADD `item_desc` LONGTEXT…
CREATE TABLE [dbo].[Student] ( [ID] [int] NOT NULL, [Name] [nchar](10) NOT NULL, [Age] [int] NOT NULL, CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED ( [ID] ASC ) );…
下面是Sql Server 和 Access 操作数据库结构的常用Sql,希望对你有所帮助. 新建表:create table [表名]([自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,[字段1] nVarChar(50) default \'默认值\' null ,[字段2] ntext null ,[字段3] datetime,[字段4] money null ,[字段5] int default 0,[字段6] Decimal (12,4) default…
前言 Mark在SqlServer 2012 的数据库使用sql语句增加(或删除)一张表的一个字段. 使用Sql语句增加表的一个字段 [1]语法: alter table table_name add table_column column_type column_isNull; [2]参数说明: table_name 表名 table_column 需要往表添加的字段 column_type 字段类型 column_isNull 字段是否为空 使用Sql语句删除表的一个字段 [1]语法 alt…