資料庫技術
作業 學校
專業年級
學號姓名
年月日一、 資料庫的建立
1. 建庫說明
基本表的建立用sql語言。
資料庫名稱為:學生資訊管理系統。
2. 建立資料庫命令如下:
create database 學生資訊管理系統
二、 資料表的建立
1. 建表
(1)學生檔案資訊表:
命令:create table [dbo].[學生檔案資訊] (
[sno] [varchar] (50) not null ,
[sname] [char] (10) not null ,
[s***] [char] (10) not null ,
[sclass] [char] (10) not null ,
[birth] [int] (4) not null ,
[saddress] [char] (10) not null ,
[sdept] [varchar] (50) not null ,
[stime] [int] (4) not null ,
) on [primary]
go(2)班級設定資訊表:
命令:create table [dbo].[班級設定資訊] (
[sgrade] [char] (10) not null ,
[szclass] [int] (4) not null ,
[syear] [char] (5) not null ,
[scroom] [char] (5) not null ,
[steacher] [char] (10) not null ,
[stotal] [int] (4) not null ,
[ssub] [varchar] (8000) not null ,
) on [primary]
go(3) 院系資訊表:
命令:create table [dbo].[院系資訊] (
[syname] [varchar] (50) not null ,
[spro] [varchar] (1000) not null ,
[snum] [int] (4) not null ,
[syclass] [varchar] (50) not null ,
) on [primary]
go(4)寢室資訊表:
命令:create table [dbo].[寢室資訊] (
[shno] [char] (10) not null ,
[spno] [int] (4) not null ,
[sperno] [varchar] (1000) not null ,
[**oney] [int] (4) not null ,
) on [primary]
go(5)使用者資訊表:
命令:create table [dbo].[使用者資訊] (
[**ima] [char] (10) not null ,
[sown] [char] (10) not null ,
[sguanli] [char] (10) not null ,
) on [primary]
go2. 使用說明
例:查詢學生的所在院系名稱,姓名,學號,年級,公寓樓號需要用到學生檔案資訊表,班級設定資訊表,院系資訊表,寢室資訊表:
sql:select syname,sname,sno,sgrade,shno from 學生檔案資訊,班級設定資訊,院系資訊,寢室資訊
三.程式主要查詢實現:
1.從每個表中刪除1條資料
delete from students where sname=』張三』
delete from depts where dnam=』計算機系』
2.在每個表中修改1條資料
update students set sname=』李四』 where sname=』張三』
3.每乙個表中增加1條資料
insert into depts values(『d01』,』計算機系』)
4.查詢計算機系的全體學生姓名
select s.sname as 姓名 from students s,depts d where d.dname='計算機系' and s.dno=d.dno
5.查詢張三的所在的系名
select d.dname from students s,depts d where s.sname='張三' and s.dno=d.dno
6.查詢李四所選課程名稱
select from course c,students s,reports r where s.sname=』李四』 and and r.sno=s.sno
7.查詢所有年齡在18-22歲之間的學生姓名
select sname from students where sage between 18 and 22
8.查詢每個學生的學號、姓名、選修的課程名、成績
select s.sno,s.sname, from reports r,students s,course c where and r.sno=s.sno
四、主要報表、窗體
設計學生成績單報表、課程成績分布報表。
報表可以在設計檢視中、或在嚮導中建立。一共建立2個報表:報表要求帶表頭、分割線條。產品銷售分布報表要求圖形報表。
五、結論
學生資訊管理系統資料庫設計
資料庫技術 實驗 報告學校專業年級 學號姓名 年月日一 資料庫的建立 1.建庫說明 資料庫的建立用企業管理器,基本表的建立用sql語言。資料庫名稱為 學生資訊管理系統。2.建立資料庫命令如下 create database 學生資訊管理系統 二 資料表的建立 1.建表 1 學生檔案資訊表 命令 cr...
個人資訊管理系統資料庫設計
個人資訊管理系統 一 教學管理 1.基本需求 個人資訊管理系統。使用者表包括使用者登入名,使用者登入密碼,使用者真實姓名,使用者性別,出生日期,使用者民族,使用者學歷,使用者職稱,使用者 使用者位址,使用者郵箱。聯絡人要儲存使用者登入名,好友名稱,好友 好友郵箱,好友工作單位,好友住址,好友 號。日...
個人資訊管理系統資料庫設計
河海大學計算機及資訊工程學院 常州 資料庫課程設計 學年學期 2012第二學期 專案名稱個人資訊管理 專案組員曹清雲 陳天昊 指導教師景雪琴 組號 8 目錄一 課題背景及意義 3 二 需求分析 3 三 概要設計 7 四 資料庫實施階段 7 五 詳細設計 8 六 總結 20 七 參考文獻 20 近些年...