Lab Assignment
Lab Assignment
Excel
Question 1: Color Scale Apply a color scale to the marks cells to visualize the
differences in their values?
Question 3: Creating a Pie Chart Create a pie chart to show the proportion
of different categories in your data?
MYSQL
1. Create the students table with the specified columns and constraints.
2. Create the courses table with the specified columns and constraints.
3. Alter the students table to add a new column GPA of type DECIMAL (3,
2).
4. Populate the table student with atleast 10 enteries in the format:
Course_
Course_name Credits Instructor
id
CS301 Database Systems 3 Ayesha Khan
Marketing
MGT201 3 Tariq Mehmood
Management
HUM10
Ethics and Civics 2 Sana Ahmed
1
CS102 Software Engineering 2 Bilal Qureshi
CS107 Data Analytics 3 Farah Saeed
7. Select the names and GPAs of all students whose GPA is between 3.0 and
4.0, and whose major is either 'Computer Science' or 'Data Analytics'.
8. Update the students table to set the major to 'Software Engineering' for
the student with student_id = SP22-BIM-007.
9. Select all columns from students where the GPA is greater than 3.2,
ordered by name in ascending order.
10. Suppose you have a table named student_courses to store the
courses taken by each student. The student_courses table has the
following columns:
student_id: Foreign key referencing the student_id column in the
students table.
course_id: Foreign key referencing the course_id column in the courses
table.
Write SQL INSERT INTO statements to assign the following courses to each
student:
Student_id Course_id
SP21- BCS-027 MGT110
FA22- BDA-068 MGT201
SP23- BEE-003 HUM101
FA21-BME-004 CS102
FA21-BME-004 CS107
FA23-BCE-006 CS301
SP22-BIM-007 MGT201
FA22-BIP-008 HUM101
SP21-BIC-009 CS102
FA22-BDA-010 CS107
SP21- BCS-027 CS301
FA22- BDA-068 MGT201
SP23- BEE-003 MGT110
11. Write an SQL query to find the total number of courses taken by
each student. Include the student's name and the total number of
courses. Ensure that students who haven't taken any courses are also
included in the result.(left join).