当前位置:网站首页>SQL statement
SQL statement
2022-07-18 14:19:00 【ssh04223】
Basics
Create database
CREATE DATABASE database-name
Delete database
drop database dbname
Backup sql server
establish Backup data device
USE master EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'Start Backup
BACKUP DATABASE pubs TO testBack
Create new table
create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
Create a new table from an existing table :
A:create table tab_new like tab_old ( Create a new table using the old table )
B:create table tab_new as select col1,col2… from tab_old definition only
Delete new table
drop table tabname
Add a column
Alter table tabname add column col type
notes : Columns cannot be deleted after they are added .DB2 The data type cannot be changed after the middle column is added , The only thing that can change is to increase varchar The length of the type .
Add primary key
Alter table tabname add primary key(col)
Delete primary key
Alter table tabname drop primary key(col)
Create index
create [unique] index idxname on tabname(col….)
Delete index
drop index idxname
notes : The index is immutable , If you want to change it, you must delete and rebuild .
Create view
create view viewname as select statement
Delete view
drop view viewname边栏推荐
- Summary and induction: data fusion methods in deep neural networks
- 高项 成本分析
- 11. Container with the most water
- MySQL query data
- Docker installs redis cluster
- [AI chip Caisa]
- 认识多银行资金系统(二)---------今日首页
- $attrs is readonly $listeners is readonly error reporting solution
- QT uses multithreading
- [pytorch quantitative practice (1)]
猜你喜欢

Force buckle (977 and 189)

认识多银行资金系统(三)-------直联设置、信息权限和系统参数设置

Basic use of Anaconda
![[AI chip Caisa]](/img/01/b216532a7b2d5cc1af4b98991fefac.png)
[AI chip Caisa]

SSH based online mall

General paging 2.0

Arm64 Galaxy Kirin desktop system V10 (SP1) markdown editor retext replaces typora

Interface test practice - student information management system

谈谈你对反射机制的理解

DOM operation of JS -- operation document tree
随机推荐
Simulation volume leetcode [general] 1894 Find the student number who needs to add chalk
College personnel management system based on jsp+servlet
Tomato Learning Notes - vscode configuration makefile (Using task.jason and launch.jason)
ES2022 Array. at( )
kettle版本8.2的中文乱码问题
【最全最详细】七种分布式全局 ID 生成策略
[deep reinforcement learning - note 02]
Can ping command still play like this?
Summary of ES interview questions - > Chapter 6
Understanding multi bank fund system (III) -- direct connection setting, information authority and system parameter setting
Opencv growth
[the most complete and detailed] seven distributed global ID generation strategies
setTimeout的第三个参数你可能不知道的作用
160_ Skills_ Power Bi new function - calculate working days
Signal函数大全:
【边缘部署 AI】
[download vscode quickly]
Interview reply 2 (summarize the bad answers in the interview)
高项 成本分析
libevent库学习(2)