avatar
SQL question HELP# Database - 数据库
h*t
1
what is the averge of age among all students who participate in more than
2 activity
STUDENT (
StuID NUMBER,
LName VARCHAR2(12),
Fname VARCHAR2(12),
Age NUMBER,
Sex VARCHAR2(1),
Major NUMBER,
Advisor NUMBER,
city_code varchar2(3)
);
ACTIVITY (
actid number ,
activity_name varchar2(25))
PARTICIPATES_IN ;
create table PARTICIPATES_IN (
stuid number,
actid number )
thanks
avatar
s*i
2
select AVG(Age)
from STUDENT,PARTICIPATES_IN
where STUDENT.StuID=PARTICIPATES_IN.StuID
having (select count(*)
from PARTICIPATES_IN
group by StuID)
>=2;

【在 h******t 的大作中提到】
: what is the averge of age among all students who participate in more than
: 2 activity
: STUDENT (
: StuID NUMBER,
: LName VARCHAR2(12),
: Fname VARCHAR2(12),
: Age NUMBER,
: Sex VARCHAR2(1),
: Major NUMBER,
: Advisor NUMBER,

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。