# 3.4 Assignment

course: Academy — 65-GENAI-for-Engineers
module: Academy/65-GENAI-for-Engineers
type: pdf
source_url: https://personal-learn.armco.dev/files/Academy/65-GENAI-for-Engineers/assignments/3.4_Assignment__ORDER_BY_Clause/3.4_Assignment.pdf
pages: 1

---
[page 1]
Assignment / Activity: Sorting Results with ORDER BY 
 Title: Top Performers and Ranked Listings 
 Instructions  : Use an online SQL editor like  https://sqliteonline.com  and complete the following: 
 Q1. Create a table  exam_results  with the following  columns: 
 ●  student_id  (INTEGER, Primary Key) 
 ●  student_name  (TEXT) 
 ●  subject  (TEXT) 
 ●  marks  (INTEGER) 
 Q2. Insert at least 5 records for subject = 'Math'. 
 Example: 
 INSERT INTO exam_results (student_id, student_name, subject, marks) 
 VALUES (1, 'Riya', 'Math', 88); 
 Q3. Write a query to display all Math students sorted by marks (highest first). 
 Q4. Write a query to display the top 3 students in 'English' based on marks. 
 Q5. Write a query to sort all students by subject alphabetically, and then by marks in 
 descending order.