PTA 查询出出生日期最大(即年龄最小)的学生姓名及出生日期。分数 3

这是一个SQL编程题模板。本题目要求编写SQL语句,

查询Student表中出出生日期最大(即年龄最小)的学生姓名及出生日期。。

提示:请使用SELECT语句作答。

表结构:

Create table Student(
StudentID   char(12) primary key,
StudentName char(8) not null,
Sex  char(2) not null ,
Birth  datetime not null,
HomeAddr varchar(80),
EntranceTime datetime default getdate(),
ClassID char(8) 
);

表样例

请在这里给出上述表结构对应的表样例。例如

Student表:

输出样例:

代码长度限制16 KB

时间限制400 ms

数据库SQL Server

结果输出要求严格对比顺序与数据

select StudentName, Birth
from Student
where Birth =(
    select max(Birth)
    from Student
)

猜你喜欢

转载自blog.csdn.net/weixin_70206677/article/details/129360301