當前位置:首頁 » 操作系統 » 資料庫求碼

資料庫求碼

發布時間: 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

熱點內容
android手機裝linux 發布:2024-12-01 00:35:14 瀏覽:1
php模塊配置 發布:2024-12-01 00:30:00 瀏覽:95
九成腳本 發布:2024-12-01 00:23:33 瀏覽:815
存儲內存和運行內存的區別 發布:2024-12-01 00:03:39 瀏覽:253
編譯狀態圖原理 發布:2024-11-30 23:54:22 瀏覽:738
谷歌搜索緩存伺服器地址 發布:2024-11-30 23:38:59 瀏覽:503
箍筋加密原因 發布:2024-11-30 23:33:38 瀏覽:416
千兆路由器有哪些配置 發布:2024-11-30 23:33:36 瀏覽:411
產品配置具體指哪些 發布:2024-11-30 23:28:21 瀏覽:16
apt編譯環境 發布:2024-11-30 23:28:12 瀏覽:382