當前位置:首頁 » 成績查詢 » 創建一個查詢查找學生成績信息並顯示為

創建一個查詢查找學生成績信息並顯示為

發布時間: 2021-01-16 19:04:01

⑴ 創建一個查詢,查找並顯示選課成績均大於80的學生學號信息

SELECT 表1.學號, 表1.語文, 表1.數學, 表1.英語
FROM 表1
WHERE (((表1.語文)>80) AND ((表1.數學)>80) AND ((表1.英語)>80));

⑵ 創建一個選擇查詢,查找選課學生的「姓名」,「課程名」和「成績」三個欄位內容,所建查詢命名為「qT2」

可以創建存儲過程源,名字設為 qT2
create proc qT2
@stuId int
as
begin
select 姓名欄位 as '姓名', 課程名欄位 as '課程名', 成績欄位 as '成績' from 表
end
若連表查詢 則用內連接 或者 where 條件。

⑶ 關於C++ 編寫一個簡單的學生成績管理系統.通過本系統能實現對學生成績記錄的顯示,查詢,修改添加和刪除

#include <iostream>
#include<fstream>
using namespace std;
const int N=5
;
class student
{
char n_name[10];
char n_numble[5];
char n_sex[3];
float score[4];//score[0]英語成績,score[1]數學成績,score[2]語文成績,score[3]平均分
public:
student();
student(char name[],char numble[],char sex[],float a,float b,float c);
student(student &s);
void input();//輸入學生信息:姓名,學號,性別,英語,數學,語文
float pj();//獲取平均分

void stu_delete(student stu[]);//刪除
void stu_find(student stu[]);
void dispaly();//顯示學生信息:姓名,學號,性別,英語,數學,語文,平均分
};
student::student()
{
strcpy(n_numble,"000");
strcpy(n_name,"noname");
strcpy(n_sex,"male");
score[0]=88;
score[1]=99;
score[2]=95;
score[3]=94;
}
student::student(char name[],char numble[],char sex[],float a,float b,float c)
{
strcpy(n_name,name);
strcpy(n_numble,numble);
strcpy(n_sex,sex);
score[0]=a;
score[1]=b;
score[2]=c;
score[3]=(score[0]+score[1]+score[2])/3.0;
}
student::student(student &s)
{
strcpy(n_name,s.n_name);
strcpy(n_numble,s.n_numble);
strcpy(n_sex,s.n_sex);
score[0]=s.score[0];
score[1]=s.score[1];
score[2]=s.score[2];
score[3]=(score[0]+score[1]+score[2])/3.0;

}
void student::input()
{
cout<<"輸入學生信息:"<<endl;
cout<<"請依次輸入姓名,學號,性別,英語,數學,語文"<<endl;
cin>>n_name>>n_numble>>n_sex>>score[0]>>score[1]>>score[2];
score[3]=(score[0]+score[1]+score[2])/3.0;
}

float student::pj()
{
return score[3];
}

void student::stu_delete(student stu[])
{
student t;
int i,k,j;
char d_numble[5];
cout<<"請輸入要刪除的學生學號:";
cin>>d_numble;
for(i=0;i<N+1;i++)
{
j=i;
k=strcmp(stu[i].n_numble,d_numble);
if(k==0&&i!=N)
{
for(;j<N;j++)
stu[j]=stu[j+1];
}
if(k==0&&i==N)
{
strcpy(stu[N].n_numble,"0000");
strcpy(stu[N].n_name,"noname");
strcpy(stu[N].n_sex,"男");
stu[N].score[0]=0;
stu[N].score[1]=0;
stu[N].score[2]=0;
stu[N].score[3]=0;
}
}
}
void student::stu_find(student stu[])
{
int i,k;
char d_numble[5];
cout<<"請輸入要查詢學生的學號:";
cin>>d_numble;
for(i=0;i<N+1;i++)
{
k=strcmp(stu[i].n_numble,d_numble);
if(k==0)
{
stu[i].dispaly();

}
}
}
void student::dispaly()
{
cout<<"姓名:"<<n_name<<" "<<"學號:"<<n_numble<<" "<<"性別:"<<n_sex<<" "<<"英語:"<<score[0]<<" "<<"數學:"<<score[1]<<" "<<"語文:"<<score[2]<<" "<<"平均分:"<<score[3]<<endl;
}
class manage_stu
{
//private:
student stu[N+1];//定義N+1名學生空間
public:
void input_stu();//輸入N名學生信息

void delete_stu();//刪除指定學號的學生信息
void find_stu();//查找指定學號的學生並顯示
void total_stu();//分別求每個人的總分
void sort_stu();//按總分高低排序,排序後的結果顯示並生成文件sortstu.txt
void display_stu();//顯示N名學生信息
};
void manage_stu::input_stu()//輸入N名學生信息
{
int i;
for(i=0;i<N;i++)
stu[i].input();
}
void manage_stu::delete_stu()//刪除指定學號的學生信息
{
student r;
r.stu_delete(stu);
}
void manage_stu::find_stu()//查找指定學號的學生並顯示
{
student t;
t.stu_find(stu);
}
void manage_stu::total_stu()//分別求每個人的總分
{
int i;
for(i=0;i<N+1;i++)
stu[i].pj();
}
void manage_stu::sort_stu()
{
int i,j;
student a;
for(i=0;i<N-1;i++)
{
for(j=i;j<N;j++)
{
if(stu[i].pj()<stu[j].pj())
{
a=stu[i];
stu[i]=stu[j];
stu[j]=a;
}
}
}
}
void manage_stu::display_stu()//顯示N名學生信息
{
student t;
int i;
for(i=0;i<N;i++)
stu[i].dispaly();
}
void main()
{

int i=1,c;
manage_stu s;
while(i)
{
cout<<"學生管理系統:"<<endl;
cout<<"1、錄入學生信息"<<N<<"名學生信息"<<endl;
cout<<"2、查找"<<endl;
cout<<"3、排序"<<endl;
cout<<"4、刪除"<<endl;
cout<<"5、顯示幾名學生信息"<<endl;
cout<<"6、退出系統"<<endl;
cout<<"請選擇(1--6):";
cin>>c;
switch(c)
{
case 1:s.input_stu();break;
case 2:s.find_stu();break;
case 3:s.sort_stu();break;
case 4:s.delete_stu();break;
case 5:s.display_stu();break;
case 6:i=0;
}
}
}

⑷ 創建一個查詢,查找沒有攝影愛好的學生的姓名,學好,成績等內容

查詢語句:select *from table where "愛好" not like 『%攝影%』

語句成立的前提是數據都存在於創建的數據表中,「*專」指的是查屬詢所有列,table是你建立的表名,「愛好」是你創建的一個內容全是愛好的屬性列。

在資料庫操作中,使用頻率最多的是查詢操作。查詢數據時,根據不同的需求,條件對資料庫中的數據進行查詢 ,並返回結果。資料庫基本查詢語句規范為:select 區域 from 表名。

(4)創建一個查詢查找學生成績信息並顯示為擴展閱讀

模糊查詢:select * from 表名 where 列名like '%中文%';

組合查詢:select distinct 列名 from 表名 where 條件;

范圍查詢:select * from 表名 where 列名 between 'A' and 'B';

多條件查詢:select * from 表名 where 列名='A' or列名='B';

⑸ 【【題1】查詢XS表(學生表)中姓「王」的學生信息,輸出學號、姓名、性別。 【題2】資料庫中有兩張表XS(

1> select 學號來,姓自名,性別 from XS where 姓名 like '王%'
2> select top 5 學號,姓名,總成績 from XS,CJ where 學生表.學號=成績表.學號 and 學號 is not(select 學號 from 成績表 where 成績<75) group by 成績表.學號 having count(*)

二題的另一種寫法:
select top 5 學號,姓名,總成績 from XS inner join CJ on 學生表.學號=成績表.學號 where 學號 is not(select 學號 from 成績表 where 成績<75) group by 成績表.學號 having count(*)

⑹ 創建一個查詢,查找學生的成績信息,並顯示為"學號"、"姓名"和"平均成績"3列內容,其中"平均成績"一列數據

select 學號,姓名,avg(成績) 平均成績 from tStud,tScore where tStud.學號=tScore.學號
如果你給出的欄位名和表名都沒錯的話,專上面查詢肯定好使。結屬果將分為學號、姓名、平均成績三列欄位的一張表。
另外,記得查詢的時候里邊的符號如逗號、單引號、小圓點等都是英文符號,如果是中文符號肯定就出錯。
希望以上回答能夠幫助您。

⑺ 8.創建一個存儲過程,查詢某個學生某門課程的考試成績(學生名和課程名為輸入參數),要求顯示姓名,課名和

create proc 取一個過程名 @學生名 char(數值),@課程名 char(數值)
as
select @學生名 @課程名 成績名
from 該表名
where 該表學生名欄位=@學生名 and 該表課程名欄位=@課程名
go
exec 剛取得那個過程名 『隨便取一個學生名驗證』,『隨便取一個課程名驗證』

⑻ 創建一個查詢,查找沒有攝影愛好的學生的姓名,學好,成績等內容

查詢語句:select *抄from table where "愛好" not like 『%攝影%』

語句成立的前提是數據都存在於創建的數據表中,「*」指的是查詢所有列,table是你建立的表名,「愛好」是你創建的一個內容全是愛好的屬性列。

在資料庫操作中,使用頻率最多的是查詢操作。查詢數據時,根據不同的需求,條件對資料庫中的數據進行查詢 ,並返回結果。資料庫基本查詢語句規范為:select 區域 from 表名。

(8)創建一個查詢查找學生成績信息並顯示為擴展閱讀

模糊查詢:select * from 表名 where 列名like '%中文%';

組合查詢:select distinct 列名 from 表名 where 條件;

范圍查詢:select * from 表名 where 列名 between 'A' and 'B';

多條件查詢:select * from 表名 where 列名='A' or列名='B';

⑼ access里 創建一個選擇查詢,查詢並顯示學生的平均分數,所在班級名稱

缺個表吧?是不還有個成績表?

如果缺的話,大概這樣寫:

selecta.姓名,a.班級,avg(b.成績內)as平均成績
from學生表asa,成績表asbwherea.學號容=b.學號
groupbya.姓名,a.班級

如果還有跟這個不太一樣的話,請補充相關截圖和表名等信息

⑽ access,創建一個查詢 ,查找女學生姓名、課程名、成績三個欄位內容

1\創建表(如表1) 添加欄位 姓名、課程名、成績、性別
2\創建查詢,打開設計視版圖,拖入表1,把上權述欄位拖到 欄位中,在性別那個欄位的"條件"輸入「="女"」,保存。
3\如果不需要顯示 性別這個欄位,把顯示框中那個鉤鉤去掉。
4\執行即可查到結果。

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919