100分 菜鸟求助数据库问题 急 答好追加 非诚勿扰

来自:高校    更新日期:早些时候
菜鸟求教:如何附加数据库?~

在企业管理器里选择附加数据库,然后选择那个MDF文件就可以了

(1)既然要深入学习mysql,就不要对mysql客户端害怕.特别是命令行客户端.某些时候如在linux下操作mysql的时候,必须使用命令行客户端.
(2)你完全可以不使用phpmyadmin,可以使用专门为mysql开发的客户,如navicat,mysql-front等.这些都非常好用.
(3)sql语言及数据库的知识还是值得认真学习的.绝对多数的语言开发都要用到数据库,学会sql,基本上学任何数据库都很容易了.

--1.1
if db_id('xxx') is not null
drop database xxx
go
create database xxx
on primary
( name=xxx_dat,
filename='E:\xxx.mdf',
size=2,
maxsize=30,
filegrowth=2
)
log on
( name=xxx_log,
filename='E:\xxx_log.ldf',
size=3,
maxsize=unlimited,
filegrowth=20%
)
go

--1.2
alter database xxx
modify file
( name=xxx_dat,
maxsize=100
)
go
alter database xxx
add log file
( name=xxx_log2,
filename='E:\xxx_log2.ldf',
size=1,
maxsize=10,
filegrowth=2
)
go

--2.1
if object_id('yyy','U') is not null
drop table yyy
go
create table yyy
( yid char(8) primary key,
yname varchar(20) not null,
yex char(6) not null,
yhere char(20) null,
yinfo varchar(100) null
)
go

--2.2,表名重复了,应该是zzz吧
if object_id('zzz','U') is not null
drop table zzz
go
create table zzz
( id char(10) primary key,
yid char(10) not null,
[count] smallmoney default 0,
cdate smalldatetime null
)
go

--3.1,题目有误,根据插入的数据个数及类型,应该是插进第一个表吧
insert into yyy
select '111111','sdwaw','zzzw','qwqw','aaa'
go
--3.2,zzz表指的哪个表?这里假设为第一个表,因为只有第一个表中有yname字段;
update yyy set yname='Jack' where yid='sdsd'
go
--3.3,你说的yyy我理解为第二个表,因为只有第二个表中有count字段;
delete from zzz where [count]<13
go

--4
select id,yname,[count],cdate into QueryNew from yyy a,zzz b
where a.yid=b.yid
go
--5
if object_id('queryyyy','P') is not null
drop procedure queryyyy
go
create procedure queryyyy @yid char(10)
as
select * from yyy where yid=@yid
go

--6
declare @n int
declare @sum int
set @n=1
set @sum=0
while @sum<1000
begin
set @sum=@sum+@n
set @n=@n+2
end
select @sum 求和,@n n
go

使用的是什麽数据库 不同的数据库 创建table时栏位都有差别,更别说SP的语法了
另外 你第二题的第一张表应该是zzz吧
3 .
1)insert into zzz values('111111','sdwaw','zzzw','qwqw','aaa')
2)update zzz set yname='Jack' where yid='sdsd'
3)delete from yyy where count<13

4.第四题也没写清楚2个表之间的关系,是要求使用哪种连接方式

使用的是什麽数据库 不同的数据库 创建table时栏位都有差别,更别说SP的语法了
另外 你第二题的第一张表应该是zzz吧
3 .
1)insert into zzz values('111111','sdwaw','zzzw','qwqw','aaa')
2)update zzz set yname='Jack' where yid='sdsd'
3)delete from yyy where count<13

看视频教程吧。。。


100分 菜鸟求助数据库问题 急 答好追加 非诚勿扰视频

相关评论:

相关主题精彩

版权声明:本网站为非赢利性站点,内容来自于网络投稿和网络,若有相关事宜,请联系管理员

Copyright © 喜物网