0% found this document useful (0 votes)
13 views5 pages

Tugas SQL

The document outlines a series of SQL queries for a database course, focusing on retrieving specific information such as course IDs, titles, and instructor salaries. It includes tasks to eliminate duplicates in results and to rewrite certain queries using joins. The queries cover various scenarios, including filtering by department, location, and enrollment statistics.

Uploaded by

eteniharefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

Tugas SQL

The document outlines a series of SQL queries for a database course, focusing on retrieving specific information such as course IDs, titles, and instructor salaries. It includes tasks to eliminate duplicates in results and to rewrite certain queries using joins. The queries cover various scenarios, including filtering by department, location, and enrollment statistics.

Uploaded by

eteniharefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Tugas SQL

Sumber: Silberschatz, Korth and Sudarshan, Database


System Concepts, 6th Ed.

Program Studi Teknik Informatika


Institut Teknologi Bandung

05/31/2025 SQL (©Silberschatz, Korth and Sudarshan, modified by TW) 1


Try Writing Some Queries in SQL
For the following queries, make sure there are no
duplicates in the result.
1. Find the IDs and titles of courses in the Comp.
Sci. department that have at least 3 credits.
2. Find the titles of courses that were taught at
Campus Center or Octagon building in Fall
2009.
3. Find the IDs of all students who were taught by
an instructor named Einstein.
schema
05/31/2025 SQL (©Silberschatz, Korth and Sudarshan, modified by TW) 2
Try Writing Some Queries in SQL
Rewrite queries 2 and 3 on the previous exercises
using join

schema
05/31/2025 SQL (©Silberschatz, Korth and Sudarshan, modified by TW) 3
Try Writing Some More Queries
For the following queries, make sure there are no
duplicates in the result.
4. Find the names of all instructors who have never
taught any courses at Campus Center building.
5. Find the names of all instructors with their new
salaries (named new_salary). New salary will be
1.5% higher than the old one for instructors of
Comp. Sci. department, and 1.25% for all other
instructors .
schema
05/31/2025 SQL (©Silberschatz, Korth and Sudarshan, modified by TW) 4
How About Some More Queries?
6. Find all instructors earning the highest salary
(there may be more than one with the same
salary)
7. Find the enrollment of each section that was
offered in Autumn 2009.
8. Find all departments with more than 1000
students enrollments, together with the
number of students for each of them. The list
should be ordered by dept_name
schema
05/31/2025 SQL (©Silberschatz, Korth and Sudarshan, modified by TW) 5

You might also like