Saksham_ISM_Project
Saksham_ISM_Project
Saksham_ISM_Project
Of
Information System Management
Under the Guidance of: Ms. Rashi Aggarwal Submitted By: Saksham Sood
Designation: Assistant Professor Enrolment No.: 07661101722
To create a table, there are 4 requisites that has to be there. These are –
SOLUTION:
Q9: Display employee name and job where ename ends with S.
Q10: Select all records where employee name starts with S and salary is 800.
Q11: Select all employee whose salary is between 1300 and 1600.
Q15: Display names of employee whose first character is A and last character is S.
Q16: Display employee name and empno who is clerk and salary 1300
Q17: Select all employee that have ‘LL’ or ‘TT’ in any posi on.
Q18: Display employee name that have at least 5 characters in length.
Assignment 5
11. Display the name of faculty who are drawing a salary of more than 75000.
12. Display the name, specialization, couse id and salary of those faculty members
whose name starts with S and teaching in course id 101.
14. Display the faculty members whose name ends with letter A.
15. Display faculty who are teaching in course ID 101.
3. Display all columns in faculty table where salary is between 60000 and 80000.
4. Select EnrolNO, SNAME, and DOB for for each student whose class coordinator is Dr. Parul.
5. Select all columns in student table whose birthdate >=9th June, 2003.
6. Select enrolno, name and class coordinators of those students whose class coordinator is
either Dr. Sarita or Dr. Parul.
7. Select fname, course_id and specialization of those faculty whose salary>70000 and
specialization is IT.
8. Select fname from faculty table where fname doesn’t start with letter P.
15. Display the names of students whose name begins with ‘M’
16. Display the names of students whose name ends with ‘N”.
17. Display the names of students whose name starts with ‘A” or ends with ‘N’.
18. Display the names of students whose name contains ‘AA’ and Class coordinator is Dr.
Deepak.
19. Display the names of students whose name contains ‘I’ twice.
Assignment 8
Subquery
1. Get the number of the student whose name comes first among all students (i.e. first
in alphabetical order).
2. Retrieve all student names whose city is ‘Delhi’ and the last 4 digits of their tel. no.
are 4341. Retrieve the names in alphabetical order.
3. Find the highest salary of any instructor.
4. Find all instructors earning the highest salary (there may be more than one with the
same salary).
5. Display all faculty who are studying either in BBA or B.COM(H).
10. Add one column credits in course table with default value 24.
11. Display students name whose HOD is Dr. Vijay.
14. Write a query to display the first word from those student names which contains
Find the total no of students who are born after May 2002.
Find the total no of students from student table who are taught by Ms. Kamna.
Q4: Solve the following queries using Max and Min Function
Find the minimum fees value from course table.
Find the Maximum fees value from course table.
2. CURRENT_DATE
3. EXTRACT
4. LAST DAY
5. MONTHS BETWEEN
6. ADD MONTHS
Assignment 13
Q1: Create the following Student table as per shown Below
2. Display the student records in ascending order of name star ng from A-Z
3. Display the student records of all the female students in descending order ranging from Z-A
4. Display the Result of the students in Highest Total marks to the lowest Total Marks.
5. Display the Students records of all the male students ranging in Highest to lowest marks in PDCS.
6. Display the student records of all the female students ranging in lowest to highest in ME.
2. Add one more column in table department having datatype as varchar and not null constraint.
3. INSERT THE FOLLOWING DATA IN THE TABLE
5. a) Update the salary of all the employees to 25000 working in HR department as assistant .
b) Update the salary of all the employees to 35000 working in HR department as manager
c) Update the salary of all the employees to 100000 working in finance department as director.
d) Update the salary of all the employees to 28000 working in finance department as assistant.
e) Update the salary of all the employees to 26000 working in sales department as assistant.
f) Update the salary of all the employees to 200000 working in sales departmet as ceo.
g) Update the salary of all the employees to 40000 working in sales department as manager.
h) Update the salary of all the employees to 45000 working in admin department as manager.
FullName Varchar
Gender Varchar
BirthDate Date
DailySpent Number
6. Count the number of males and females that like a par cular food.
5. Write a query to get the average salary and number of employees working the department
90.
6. Write a query to get the highest, lowest, sum, and average salary of all employees.
7. Write a query to get the number of employees with the same job.
8. Write a query to get the difference between the highest and lowest salaries.
9. Write a query to find the manager ID and the salary of the lowest-paid employee for that
manager.
10. Write a query to get the department ID and the total salary payable in each department.
11. Write a query to get the average salary for each job ID excluding programmer.
12. Write a query to get the total salary, maximum, minimum, average salary of employees for
department ID 90 only.
13. Write a query to get the job ID and maximum salary of the employees where salary is greater
than or equal to $4000.
14. Write a query to get the average salary for all departments employing more than 10 employees.
Assignment 18
1. Create a table Faculty having columns:
Column Name Data type Example
F_Id Varchar
Name Varchar
Designation Varchar Asst, Associate, Professor
Office Varchar A101….
Yrs of Experience Number
Q4: For each student who has a GPA <2, Display their GPA, age, id, name and ID of their faculty.
Q5: For each student who is studying in B.COM(H), list their ID, name, age, “Expected age as a Senior”(their
age three years from now).
Q6: List all faculty (Id, and name) who reside in Building ‘B’ (office number starts with the letter
‘B’).
Q7: For each F_ID, list F_ID, average GPA and count of semester.
Q8: For each course, list the course, avg age, min age and max age for that major. column
headings should be ‘avg age’ ‘youngest’ ‘oldest’.
Q9: For each student who is in semester 4, list ID, name, GPA, Faculty Id, faculty name and
designation.
Q10: For each sem, list sem and the number of students under 25 years old, include the average
gpa of these students.
Q11: For each faculty, list id, name, designation, and list of their students (stID , stName and gpa)
who have gpa below 3.0.
Q12: List the Faculty number, of any faculty who has more than one student with a GPA above 3.
Include a count of these students.
Q13: For the faculty member named ‘Bharti’ (list name, number and designation) and all their
students (number and name and age) who are not seniors. (sort the result by student names).
Q14: List the ID, name and GPA, for all students who have a GPA higher than average GPA.
Q15: List the ID, name, and age, for all students who are in course with more than 5 members.
Q16: Retrieve the name of each faculty and number of students studying under each faculty which
has at least 2 students.
Assignment 19
Identify all tables, column names, primary key
Table 1 – Student
Column Name- Student ID, DOB, Age, Hobby, Student Name, Address, Course ID.
Table 2 – Course
Table 3 – Subjects
Table 4 – Lecturer
Q 1 E-R Diagram
Components:
1. En ty:
Student
2. A ributes:
Name
Sex
Q 2 Composite
The provided diagram is a Composite E-R Diagram for the Student en ty. Here's the breakdown:
1. En es:
Student:
o A ributes:
Name
Address
3. Composite A ributes:
Name and Address are composite a ributes because they consist of mul ple sub-parts that provide
addi onal detail about the main a ribute.
Name:
o First_Name
o Last_Name
Address:
o House_no
o Street
o City
Q 3 Mul _Valued
A Mul valued A ribute in an E-R diagram represents an a ribute that can have mul ple values for a
single en ty. It is visually represented by two concentric ovals around the a ribute name.
En ty: Student
o A ributes:
City
A student can have mul ple mobile numbers (e.g., personal and home), so Mobile_no is
presented as a mul valued a ribute.
Q 4 Rela onship
En ty: Employee
o A ributes:
Emp_Name
Salary
o Department
Dept_Name
Rela onship
Works in(between Employee and Department):
o A ributes:
Since
Assignment 21
1. En es
Student: A ributes are:
o Sid (Student ID)
o Name
o Program
Course Offerings: A ributes are:
o Courseno (Course Number)
o Secno (Sec on Number)
o Year
o Semester
o Room
o Time
Exam: A ributes are:
o Eid (Exam ID)
o Name
o Place
o Time
2. Rela onship
Takes (between Student and Course Offerings):
o A ributes:
Marks
Assignment 22
Draw ER diagram of Library and iden fy all tables, column names, primary key if any:
Table 1 – Books
Table 2 – Publisher
Table 3 – Member
Column Name – Member ID, Expiry date, Name, Address, Membership date, Member Type
Table 4 – Borrowed By
Q3. Return all rows from the customers table and only those rows from the orders table where the
joined fields are equal.
Q4. Return all rows from the orders table and only those rows from the customers table where the
joined fields are equal.
Q5. Return all rows from the orders table and all rows from the customers table.
Assignment 24
Joins
3. Find those orders where order amount exists between 500 and 2000. Return ord_no, purch_amt,
cust_name, city.
4. Find the salesperson(s) and the customer(s) he handles. Return Customer Name, city, Salesman,
commission.
5. Find those salespersons who received a commission from the company more than 12%. Return
Customer Name, customer city, Salesman, commission.
6. Find those salespersons do not live in the same city where their customers live and received a
commission from the company more than 12%.
7. Find the details of an order. Return ord_no, ord_date, purch_amt, Customer Name, grade,
Salesman, commission.
8. Find those customers whose grade less than 300. Return cust_name, customer city, grade,
Salesman, salesman city. The result should be ordered by ascending customer_id.