按学号查询成绩
1. SQL按学号查询每人的各科总成绩,感激不尽
CREATETABLESTU_INFO(
XHINT,
XMvarchar(6)
);
CREATETABLEXK(
XHINT,
KCHvarchar(6),
KSCJINT,
KKNYvarchar(6)
);
GO
INSERTINTOSTU_INFOVALUES(1,'张三');
INSERTINTOSTU_INFOVALUES(2,'李四');
INSERTINTOSTU_INFOVALUES(3,'王五');
INSERTINTOSTU_INFOVALUES(4,'赵六');
INSERTINTOXKVALUES(1,'大英',90,'20011');
INSERTINTOXKVALUES(2,'大英',80,'20011');
INSERTINTOXKVALUES(3,'大英',70,'20011');
INSERTINTOXKVALUES(4,'大英',60,'20011');
INSERTINTOXKVALUES(1,'高数',80,'20011');
INSERTINTOXKVALUES(2,'高数',70,'20011');
INSERTINTOXKVALUES(3,'高数',60,'20011');
INSERTINTOXKVALUES(1,'物理',70,'20011');
INSERTINTOXKVALUES(2,'物理',60,'20011');
go
SELECT
STU_INFO.XH,
STU_INFO.XM,
COUNT(XK.KCH)AS考试课程总数,
SUM(XK.KSCJ)AS考试总成绩,
AVG(XK.KSCJ)AS考试平均分
FROM
STU_INFOJOINXKON(STU_INFO.XH=XK.XH)
WHERE
KKNY='20011'
GROUPBY
STU_INFO.XH,
STU_INFO.XM;
go
XHXM考试课程总数考试总成绩考试平均分
--------------------------------------------------
1张三324080
2李四321070
3王五213065
4赵六16060
(4行受影响)
2. 在EXCEL中如何用学号查询各科目成绩
用VLOOKUP函数,打开EXCEL,按F1帮助,查找此函数,表面讲解很细。需要帮助可以HI,我。
3. 用EXCEL的VLOOKUP函数按学号查找各科成绩
=VLOOKUP(查找值,区域,对应列,0)
具体教程:
网络专经验图属文教程;
http://jingyan..com/user/nuc/interact?tab=comment
4. 1、学生信息的录入。如:学生编号、学生姓名、学生成绩。 2、学生信息的查询及显示。如:按学号查询、按成
#include<iostream>
#include<string>
using namespace std;
#define OVERFLOW -1
typedef struct
{
string name;
int study_num;
int score_num;
}message, * message_point;
typedef struct
{
message * a; //存储空间基址
int length; //当前长度
int lisesize; //当前分配的存储容量
}SqList;
void InitList(SqList & L) //建立线性表函数
{
L.lisesize=20; //表的空间容量是20
L.length=1; //空表的长度为
L.a=new message[L.lisesize];
if(!L.a) exit(OVERFLOW);
}
void Add(SqList & L) //增加函数
{
string b;
if(L.length==L.lisesize)
cout<<"该空间已满"<<endl;
else
{
if(L.length==0)
{
cout<<"姓名:";
cin>>L.a[0].name;
cout<<"学号:";
cin>>L.a[0].study_num;
cout<<"成绩:";
cin>>L.a[0].score_num;
L.length++;
}
else
{
cout<<"姓名:";
cin>>L.a[L.length].name;
cout<<"学号:";
cin>>L.a[L.length].study_num;
cout<<"成绩:";
cin>>L.a[L.length].score_num;
L.length++;
}
if(L.length==L.lisesize)
cout<<"空间已满"<<endl;
}
}
void Delete(SqList & L) //删除函数
{
bool c=false;
int i,j,b,k=L.length;
if(L.length==1)
cout<<"空间已空"<<endl;
else
{
cout<<"输入删除学生的学号"<<endl;
cin>>b;
for(i=1;i<L.length;i++)
{
if(L.a[i].study_num==b)
{
c=true;for(j=i+1;j<L.length;j++)
L.a[j-1]=L.a[j];
}
}
}
if(c==true)
L.length--;
else
cout<<"该学生不存在"<<endl;
}
void Modify(SqList & L) //修改函数
{
bool c=false;
int i,b;
cout<<"输入要修改的学生的学号"<<endl;
cin>>b;
for(i=1;i<L.length;i++)
{
if(L.a[i].study_num==b)
{
c=true;
cout<<"姓名:";cin>>L.a[i].name;
cout<<"学号:";cin>>L.a[i].study_num;
cout<<"成绩:";cin>>L.a[i].score_num;
}
}
if(c==false)
cout<<"该学生不存在"<<endl;
}
void Display(SqList L)//输出函数,显示学生信息
{
int i;
if(L.length==1)
cout<<"空间已空"<<endl;
for(i=1;i<L.length;i++)
{
cout<<"学生姓名:"<<L.a[i].name<<" "<<"学号:"<<L.a[i].study_num<<" "<<"成绩:"<<L.a[i].score_num<<endl;
}
}
void Select_name(SqList L) //查询学生姓名函数
{
int i=0;
int j=0;
string b;
cout<<"输入待查询的学生的姓名"<<endl;
cin>>b;
for(i=1;i<L.length;i++)
{
if(b==L.a[i].name)
{
cout<<"姓名: "<<L.a[i].name<<endl;
cout<<"学号: "<<L.a[i].study_num<<endl;
cout<<"成绩:"<<L.a[i].score_num<<endl;
break;
}
j++;
}
if(j==(L.length-1))
cout<<"该学生不存在"<<endl;
}
void Select_study_num(SqList L) //查询学生学号函数
{
int i,j=0;int b;
cout<<"输入待查询的学生的学号"<<endl;
cin>>b;for(i=1;i<L.length;i++)
{
if(b==L.a[i].study_num)
{
cout<<"姓名:"<<L.a[i].name<<endl;
cout<<"学号:"<<L.a[i].study_num<<endl;
cout<<"成绩:"<<L.a[i].score_num<<endl;
break;
}
j++;
}
if(j==(L.length-1))
cout<<"该学生不存在"<<endl;
}
void Select_score_num(SqList L) //查询学生成绩函数
{
int i,j=0;
int b;cout<<"输入待查询的学生的成绩"<<endl;
cin>>b;
for(i=1;i<L.length;i++)
{
if(b==L.a[i].score_num)
{
cout<<"姓名:"<<L.a[i].name<<endl;
cout<<"学号:"<<L.a[i].study_num<<endl;
cout<<"成绩:"<<L.a[i].score_num<<endl;
break;
}
j++;
}
if(j==(L.length-1))
cout<<"该学生不存在"<<endl;
}
void Menu()
{
char ch;
cout<<"增加学生信息请输入 a"<<endl;
cout<<"删除学生信息请输入 b"<<endl;
cout<<"修改学生信息请输入 c"<<endl;
cout<<"显示学生信息请输入 d"<<endl;
cout<<"按姓名查询请输入 e"<<endl;
cout<<"按学号查询请输入 f"<<endl;
cout<<"按成绩查询请输入 g"<<endl;
}
int main()
{
int s=1;
char ch;
SqList L;
InitList(L);
while(s==1)
{
Menu();
cin>>ch;
s=0;
while(s==0)
{
switch(ch)
{
case'a': Add(L); break;
case'b': Delete(L); break;
case'c': Modify(L); break;
case'd': Display(L); break;
case'e': Select_name(L);break;
case'f': Select_study_num(L);break;
case'g': Select_score_num(L);break;
}
cout<<"继续前一操作请输入"<<0<<endl;
cout<<"返回主菜单请输入"<<1<<endl;
cout<<"退出程序请输入"<<2<<endl;
cin>>s;
}
}
return 0;
}
看看符不符合 是否还需要添加别的功能
5. C语言,按学号查询学生成绩
#include "stdio.h"
#include "string.h"
struct student
{
char num[10];
int cscore;//yu wen
int iscore;//ying yu
char name[20]
};
void main()
{
struct student qq[3];
int i;
for(i = 0;i < 3;i++)
{
printf("请输入 语文成绩 英语成绩 学号 姓名:\n");
scanf("%d %d %s %s",&qq[i].cscore,&qq[i].iscore,qq[i].num,qq[i].name);
printf("语文成绩%d 英语成绩%d 学号%s 姓名%s\n",qq[i].cscore,qq[i].iscore,qq[i].num,qq[i].name);
printf("---%d ---%d --%s --%s\n",qq[i].cscore,qq[i].iscore,qq[i].num,qq[i].name);
}
//下面是查询
char nnm[10];
printf("请输入 学号:\n");
scanf("%s",nnm);
for(i = 0;i < 3;i++)
{
if(memcmp(nnm,qq[i].num,strlen(nnm)) == 0)
{
printf("语文成绩%d 英语成绩%d 学号%s 姓名%s\n",qq[i].cscore,qq[i].iscore,qq[i].num,qq[i].name);
break;
}
else
printf("未找到\n");
}
}
6. C语言,按学号查询学生成绩
#include <stdio.h>
#include <stdlib.h>
typedef struct node //定义结点//
{
long num;
char Name[10];
char sex;
int age;
struct node *next;
}NODE;
NODE *create(int n) //创建链表//
{
NODE *s,*head=NULL,*r=NULL;
int i;
for(i=0;i<n;i++)
{
s=(NODE *)malloc(sizeof(NODE));
printf("\n输入学号:");
scanf("%ld",&s->num);
getchar();
printf("\n输入姓名:");
scanf("%s",s->Name);
getchar();
printf("\n输入性别(M/W):");
scanf("%c",&s->sex);
getchar();
printf("\n输入年龄:");
scanf("%d",&s->age);
getchar();
s->next=NULL;
if(head==NULL)
{
head=s;
r=s;
}
else
{
r->next=s;
r=s;
}
}
return head;
}
void sch(NODE *head,int num)
{
NODE *p=head;
while(1)
{
if(p->num==num)
{
printf("学号:%ld 姓名:%s 性别: %c 年龄:%d",
p->num,
p->Name,
p->sex,
p->age);
break;
}
else
p=p->next;
}
if(p==0)
printf("not find!");
}
main()
{
int num,n;
NODE *head=NULL;
printf("\n请输入学生数:");
scanf("%d",&n);
getchar();
head=create(n);
printf("输入要查找的学号:");
scanf("%d",&num);
getchar();
sch(head,num);
return 0;
}
7. excel如何实现输入学号查询成绩
假设你A列是学号 ,B列是成绩
现在在C1输入学号,D1显示成绩
在D1输入公式=VLOOKUP(C1,A:B,2,0)
8. 急求c语言大神输入成绩学号姓名查询成绩
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedefstructstudent
{
charname[12];
charstudent_id[12];
unsignedshortChinese;
unsignedshortEnglish;
unsignedshortMath;
unsignedshortaverage;
}student_t;
unsignedshortnum;
unsignedshortpass_rate;
voidenter_message(student_t*p);
voidsort(student_t*p);
voidprint_message(student_t*p);
voidswit_student(student_t*p,student_t*q);
voidsearch_student(student_t*p);
intmain(intargc,charconst*argv[])
{
printf("Enterthenumberofstudents:");
scanf("%hu",&num);
student_t*p=NULL;
p=malloc(num*sizeof(student_t));
printf("Enterstudentsmessage,example:namestudent_idChineseEnglishMath ");
enter_message(p);
sort(p);
print_message(p);
printf("Thepass_rateis%f ",(pass_rate*1.0)/(num*1.0));
search_student(p);
free(p);
return0;
}
voidenter_message(student_t*p)
{
unsignedshorti=0;
student_t*temp=p;
while(i<num)
{
("Enterthe%humessage: ",i+1);
scanf("%s%s%hu%hu%hu",temp->name,temp->student_id,&temp->Chinese,&temp->English,&temp->Math);
temp->average=(temp->Chinese+temp->English+temp->Math)/3;
if(temp->average>60)
pass_rate++;
temp+=1;
i++;
}
}
voidsort(student_t*p)
{
student_t*temp;
for(inti=0;i<num;++i)
for(intj=i+1;j<num;++j)
if(p[i].average<p[j].average)
swit_student(&p[i],&p[j]);
temp=p;
printf("Thebaststudentis:name:%sstudent_id:%sChinese:%huEnglish:%huMath:%huaverage:%hu "
,temp->name,temp->student_id,temp->Chinese,temp->English,temp->Math,temp->average);
temp+=num-1;
printf("Theworststudentis:name:%sstudent_id:%sChinese:%huEnglish:%huMath:%huaverage:%hu "
,temp->name,temp->student_id,temp->Chinese,temp->English,temp->Math,temp->average);
}
voidprint_message(student_t*p)
{
unsignedshorti=0;
student_t*temp=p;
while(i<num)
{
printf("name:%sstudent_id:%sChinese:%huEnglish:%huMath:%huaverage:%hu "
,temp->name,temp->student_id,temp->Chinese,temp->English,temp->Math,temp->average);
temp+=1;
i++;
}
}
voidswit_student(student_t*p,student_t*q)
{
student_ttemp;
strcpy(temp.name,p->name);
strcpy(p->name,q->name);
strcpy(q->name,temp.name);
strcpy(temp.student_id,p->student_id);
strcpy(p->student_id,q->student_id);
strcpy(q->student_id,temp.student_id);
temp.Chinese=p->Chinese;
p->Chinese=q->Chinese;
q->Chinese=temp.Chinese;
temp.English=p->English;
p->English=q->English;
q->English=temp.English;
temp.Math=p->Math;
p->Math=q->Math;
q->Math=temp.Math;
temp.average=p->average;
p->average=q->average;
q->average=temp.average;
}
voidsearch_student(student_t*p)
{
charstudent_id[12]={0};
printf("Plsenterthestudent_id ");
scanf("%s",student_id);
for(inti=0;i<num;++i)
{
if(!strcmp(p[i].student_id,student_id))
printf("Thestudentis:name:%sstudent_id:%sChinese:%huEnglish:%huMath:%huaverage:%hu "
,p[i].name,p[i].student_id,p[i].Chinese,p[i].English,p[i].Math,p[i].average);
}
}
写的有点乱,时间有限,见谅。功能都给你实现了