当前位置:首页 » 操作系统 » 数据库求码

数据库求码

发布时间: 2023-10-12 22:40:05

sql数据库图书馆管理系统求代码!急用!

use
数据库名称(db)
go
--读者表
create
table
zhe
(
id
int
identity(1,1),
numid
varchar(20)
primary
key,
--主键
dname
varchar(20),
post
varchar(20),
dept
varchar(20)
)
--图书表
create
table
books
(
id
int
identity(1,1)
primary
key,
bnum
varchar(20)
foreign
key
references
zhe(numid),
--外键
bname
varchar(20),
bauthor
varchar(20),
bpress
varchar(50),
bprice
decimal,
btype
varchar(10)
)
--借阅记录
create
table
lendrecord
(
id
int
identity(1,1),
lbnum
varchar(20)
foreign
key
references
zhe(numid),
--外键
ldate
datetime,
yhdate
datetime,
redate
datetime
)

Ⅱ VB6.0编程,想把ACCESS07数据库【ABC】中表1中的所有内容都复制到同一数据库的表2里面,求代码。

在工程里引用microsoft activex data objects 2.7 library

Dim cn As New ADODB.Connection, rs1 As New ADODB.Recordset, sql As String '在通用声明里定义,其中cn是连接对象,rs1是记录集,sql是查询语句
Private Sub Form_Load()
cn.Open "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\数据库名.mdb" + ""
sql = "select * from 表名"
rs1.Open sql, cn
rs1.MoveFirst
Do While Not rs1.EOF
Combo1.AddItem rs1("字段名")
rs1.MoveNext
Loop
rs1.Close
End Sub
如果你还有什么不懂的,可以网络搜下:编程回忆录,他们现在正在录制这方面的教程,都是零基础开始,由浅入深。

Ⅲ 数据库,求代码

1、 select student.sno,student.sname
from student,sc,course
where student.sno = sc.sno and
sc.cno = course.cno and
course.cname <> '信息系统'

2、 select c1.cno,c1.cname
from course c1,course c2
where c1.cno = c2.cpno and
c1.ccredit = c2.ccredit

3、 select student.sno,student.sname
from student
where not exists
(
select 1
from sc
where grade < 80 and
sc.sno = student.sno
)

4、 select c1.sno,c1.sname
from
(
select student.sno,student.sname
from student,sc,course
where student.sno = sc.sno and
sc.cno = course.cno and
course.cname = '数据库'
)c1,
(
select student.sno,student.sname
from student,sc,course
where student.sno = sc.sno and
sc.cno = course.cno and
course.cname <> '操作系统'
)c2
where c1.sno = c2.sno

5、 select c1.avg,c1.sno,c1.sname
from
(
select avg(sc.grade) avg,student.sno,student.sname
from student,sc,course
where student.sno = sc.sno and
sc.cno = course.cno
group by student.sno,student.sname
)c1
(
select avg(sc.grade) avg
from student,sc,course
where student.sno = sc.sno and
sc.cno = course.cno and
student.sname = '刘晨'
)c2
where c1.avg > c2.avg

热点内容
ios文件加密插件 发布:2025-05-17 17:05:48 浏览:795
androidbutton自定义 发布:2025-05-17 16:58:34 浏览:168
android应用生命周期 发布:2025-05-17 16:53:16 浏览:778
珠海四层交换机怎么配置 发布:2025-05-17 16:50:17 浏览:219
服务器怎么变成3个电脑 发布:2025-05-17 16:50:11 浏览:284
sql存储数据 发布:2025-05-17 16:43:28 浏览:701
外贴算法 发布:2025-05-17 16:13:34 浏览:389
多出口ip服务器 发布:2025-05-17 16:04:50 浏览:661
双指针算法 发布:2025-05-17 16:04:04 浏览:705
媒体采访问答 发布:2025-05-17 15:59:44 浏览:692