Professional Documents
Culture Documents
DBMS Lab3
DBMS Lab3
Experiment Number
3
Name of student
Soham Patra
Roll Number
2230045
Section
ECSC-1
1. Problem Statement:
A) Display all employee names (last name and first name separated by
a comma and a space) and salary with appropriate column aliases.
B) Display all employees who do not get any commission.
C) Display unique building names from LOCATION table.
D) Display all course sections offered in Winter 2003.
E) Display names of faculty members who work in department 1 or 2.
Use IN operator in your query.Find all New York and New Jersey
students.
F) Give a 10% raise to employee number 111.
G) Delete department number 30 from the department table. If it is not
successful, write down your suggestion to make it work.
H) For each course ID, display the maximum count in descending order.
I) Insert a new term in the TERM table.
J) create a custom prompt for user to input any value betwwen 50 and
99 into DeptId column.
K) Find courses with no required prerequisite.
L) Display faculty names in descending order by their department, but in
alphabetical order by their name within each department.
M) Find faculty members whose name start with D.
N) Find students who started in year 2023. Use start term column and
wild card.
2. THEORY:
We learned the basics of SQL from the experiment, such as how to
get unique values, filter data with conditions like "WHERE," update
records, sort results, accept errors politely, and choose particular
columns with aliases for clarity.
Advanced techniques such as data inserting, custom prompt
creation, and pattern matching using wildcard characters are
necessary for proficient database management.
3. CODE:
A)
Output:
FROM employee
Output:
OUTPUT:
FROM Crssection cs
OUTPUT:
E) SELECT Name
FROM Faculty
OUTPUT:
F) UPDATE employee
SET Salary = Salary + (Salary*10/100)
OUTPUT:
OUTPUT:
GROUP BY CourseId
OUTPUT:
VALUES (202403,"Fall","2023-09-10","2023-12-20");
OUTPUT:
OUTPUT:
OUTPUT:
M) SELECT Name
FROM Faculty
Output:
N) SELECT*FROM Student
WHERE StartTerm LIKE '2023%';
OUTPUT:
Concluding Remarks:
We gained knowledge about how to add data, show a particular column,
sort data by name, date of admission, and perform various other tasks
using SQL queries.