9个回答
2009-11-26
展开全部
create dababase [dababasename]
on primary
(name=N'dataname1',filename=N'maindatabasename.mdf',size='small MB', maxsize='max MB', filegrowth='30%'),
(name=N'dataname2',filename=N'maindatabasename.ndf',size='small MB', maxsize='max MB', filegrowth='30%')
filegroup file-group
log on
(name=N'dataname3',filename=N'maindatabasename.ndf',size='small MB', maxsize='max MB', filegrowth='30%')
(name=N'data_log',filename=N'maindatabasename.ldf',size='small MB', maxsize='max MB', filegrowth='30%')
on primary
(name=N'dataname1',filename=N'maindatabasename.mdf',size='small MB', maxsize='max MB', filegrowth='30%'),
(name=N'dataname2',filename=N'maindatabasename.ndf',size='small MB', maxsize='max MB', filegrowth='30%')
filegroup file-group
log on
(name=N'dataname3',filename=N'maindatabasename.ndf',size='small MB', maxsize='max MB', filegrowth='30%')
(name=N'data_log',filename=N'maindatabasename.ldf',size='small MB', maxsize='max MB', filegrowth='30%')
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1.创建数据库study1:
show databases;
create database study1;
use study1;
show tables;
create table emp(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp;
create table emp2(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp2 values (001,'bai1','male','1999-01-02',10000),
(002,'bai2','male','1989-02-01',20000),
(003,'bai3','male','1999-03-01',30000),
(004,'bai4','male','1963-06-03',50000),
(005,'bai5','male','1998-12-13',40000),
(006,'bai6','male','1967-12-20',45000),
(007,'bai7','male','1999-02-06',60000),
(008,'bai8','male','1987-01-01',70000),
(009,'bai9','male','1986-03-11',80000),
(010,'bai10','male','1999-12-11',88888);
select * from emp2;
update emp set salary =99999 where id=010;
update emp set salary =88888 where id=009;
update emp set salary =77777 where id=008;
update emp set salary =66666 where id=007;
update emp set salary =55555 where id=006;
update emp set salary =44444 where id=005;
update emp set salary =33333 where id=004;
update emp set salary =22222 where id=003;
update emp set salary =11111 where id=002;
update emp set salary =10000 where id=001;
select * from emp2;
create table emp3(
id int,
name varchar(100),
sex char(6),
age int,
salary float(10,2));
insert into emp3 values (1,'bai1','male','10',10000),
(2,'bai2','male','11',20000),
(3,'bai3','male','12',30000),
(4,'bai4','male','13',50000),
(5,'bai5','male','14',40000),
(6,'bai6','male','15',45000),
(7,'bai7','male','16',60000),
(8,'bai8','male','17',70000),
(9,'bai9','male','18',80000),
(10,'bai10','male','19',88888);
select * from emp3;
update emp set salary =30 where id=10;
update emp set salary =31 where id=9;
update emp set salary =32 where id=8;
update emp set salary =34 where id=7;
update emp set salary =35 where id=6;
update emp set salary =36 where id=5;
update emp set salary =37 where id=4;
update emp set salary =38 where id=3;
update emp set salary =39 where id=2;
update emp set salary =40 where id=1;
select * from emp3;
create table emp4(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp4 values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp4;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp4;
create table emp5(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp5 values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp5;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp5;
2.创建数据库study2;
show databases;
create database study2;
use study2;
show tables;
create table aaa(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into aaa values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from aaa;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
create table bbb(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into bbb values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from bbb;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from bbb;
create table ccc(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into ccc values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from ccc;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from ccc;
create table ddd(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into ddd values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from ddd;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from ddd;
create table eee(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into eee values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from eee;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from eee;
show databases;
create database study1;
use study1;
show tables;
create table emp(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp;
create table emp2(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp2 values (001,'bai1','male','1999-01-02',10000),
(002,'bai2','male','1989-02-01',20000),
(003,'bai3','male','1999-03-01',30000),
(004,'bai4','male','1963-06-03',50000),
(005,'bai5','male','1998-12-13',40000),
(006,'bai6','male','1967-12-20',45000),
(007,'bai7','male','1999-02-06',60000),
(008,'bai8','male','1987-01-01',70000),
(009,'bai9','male','1986-03-11',80000),
(010,'bai10','male','1999-12-11',88888);
select * from emp2;
update emp set salary =99999 where id=010;
update emp set salary =88888 where id=009;
update emp set salary =77777 where id=008;
update emp set salary =66666 where id=007;
update emp set salary =55555 where id=006;
update emp set salary =44444 where id=005;
update emp set salary =33333 where id=004;
update emp set salary =22222 where id=003;
update emp set salary =11111 where id=002;
update emp set salary =10000 where id=001;
select * from emp2;
create table emp3(
id int,
name varchar(100),
sex char(6),
age int,
salary float(10,2));
insert into emp3 values (1,'bai1','male','10',10000),
(2,'bai2','male','11',20000),
(3,'bai3','male','12',30000),
(4,'bai4','male','13',50000),
(5,'bai5','male','14',40000),
(6,'bai6','male','15',45000),
(7,'bai7','male','16',60000),
(8,'bai8','male','17',70000),
(9,'bai9','male','18',80000),
(10,'bai10','male','19',88888);
select * from emp3;
update emp set salary =30 where id=10;
update emp set salary =31 where id=9;
update emp set salary =32 where id=8;
update emp set salary =34 where id=7;
update emp set salary =35 where id=6;
update emp set salary =36 where id=5;
update emp set salary =37 where id=4;
update emp set salary =38 where id=3;
update emp set salary =39 where id=2;
update emp set salary =40 where id=1;
select * from emp3;
create table emp4(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp4 values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp4;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp4;
create table emp5(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into emp5 values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from emp5;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from emp5;
2.创建数据库study2;
show databases;
create database study2;
use study2;
show tables;
create table aaa(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into aaa values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from aaa;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
create table bbb(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into bbb values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from bbb;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from bbb;
create table ccc(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into ccc values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from ccc;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from ccc;
create table ddd(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into ddd values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from ddd;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from ddd;
create table eee(
id int,
name varchar(100),
sex char(6),
birthday date,
salary float(10,2));
insert into eee values (1,'bai1','male','1999-01-02',10000),
(2,'bai2','male','1989-02-01',20000),
(3,'bai3','male','1999-03-01',30000),
(4,'bai4','male','1963-06-03',50000),
(5,'bai5','male','1998-12-13',40000),
(6,'bai6','male','1967-12-20',45000),
(7,'bai7','male','1999-02-06',60000),
(8,'bai8','male','1987-01-01',70000),
(9,'bai9','male','1986-03-11',80000),
(10,'bai10','male','1999-12-11',88888);
select * from eee;
update emp set salary =99999 where id=10;
update emp set salary =88888 where id=9;
update emp set salary =77777 where id=8;
update emp set salary =66666 where id=7;
update emp set salary =55555 where id=6;
update emp set salary =44444 where id=5;
update emp set salary =33333 where id=4;
update emp set salary =22222 where id=3;
update emp set salary =11111 where id=2;
update emp set salary =10000 where id=1;
select * from eee;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create database 数据库名称
on
(
name='aaa',
filename='aaa.dbf',
size=初始大小,
maxsize=存储上限,
filegrowth=增长增量
)
log on
(
name='b',
filename='b.ldf',
size=初始大小,
maxsize=存储上限,
filegrowth=增长增量
)
on
(
name='aaa',
filename='aaa.dbf',
size=初始大小,
maxsize=存储上限,
filegrowth=增长增量
)
log on
(
name='b',
filename='b.ldf',
size=初始大小,
maxsize=存储上限,
filegrowth=增长增量
)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
CREATE DATABASE aaa
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |