Skip to content

Commit ec40679

Browse files
committed
Alias AS query
1 parent fb12279 commit ec40679

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sql-queries-11/as-alias/as-alias.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SELECT name, gpa AS grade_point_average
2+
FROM Student;
3+
4+
SELECT name, graduation_date - enrollment_date AS study_duration_in_days
5+
FROM Student;
6+
7+
SELECT s.name,e.course_id,e.grade
8+
FROM Student AS s
9+
JOIN Exam AS e ON s.id = e.student_id
10+
WHERE e.grade IS NOT NULL;
11+
12+
SELECT s.name,s.gpa
13+
FROM Student AS s, (SELECT AVG(gpa) AS overall_avg_gpa FROM Student) AS avg_gpa_subquery
14+
WHERE s.gpa > avg_gpa_subquery.overall_avg_gpa;

0 commit comments

Comments
 (0)