Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

DATE: 12/09/2023

EXPERIMENT – 10

AIM : Performing operations on the given SQL Schema.

LANGUAGE USED : MYSQL

SCHEMA :

EMPLOYEE (EMP_NAME, STREET, CITY)

WORKS (EMP_NAME, COMPANY_NAME, SALARY)

COMPANY (COMPANY_NAME, CITY)

MANAGES (EMP_NAME, MANAGER_NAME)

QUERY:
[i] Find the company with smallest payroll:
[ii] Find those companies whose employees earn a higher salary as compared to the average
salary of company ABC Inc:

[iii] Find the name of all employees who work for ABC Inc:

[iv] Find the name of employees who live in the same city as their managers:

[v] Find the name and city of the employees who work for XYZ Corp:
[vi] Find all employees who work for company ABC Inc and earn more than 50,000
per month:

RESULT : Commands executed successfully.

KAMAKSHI OJHA
A2305221235
DATE: 12/09/2023

EXPERIMENT – 11

AIM : Performing operations on the given SQL Schema.

LANGUAGE USED : MYSQL

SCHEMA :

BRANCH ( BRANCH_NAME, BRANCH_CITY, ASSETS)


CUSTOMER (CUSTOMER_NAME, C_STREET, C_CITY)
ACCOUNT (ACC_NUMBER, BRANCH_NAME, BALANCE)
LOAN (LOAN_NUMBER, BRANCH_NAME, AMOUNT)
DEPOSITION (CUSTOMER_NAME, ACC_NUMBER)
BORROWER (CUSTOMER_NAME, LOAN_NUMBER)

QUERY:
[i] Find the Loan_number, Branch_number & the Amount for loan over 5 Lakhs:

[ii] Find the Loan_number for each loan of an Amount > 5 Lakhs:

[iii] Find the name of all customers having a Loan, an Account or both at the bank:
[iv] Find the name of all customers who have a Loan & an Account at the Bank:

[v] Find the name of all customers having a Loan at Noida Branch:

[vi] Find the name of all customers who have a loan at Noida Branch but no Account at
any branch of the bank:

RESULT : Commands executed successfully.

KAMAKSHI OJHA
A2305221235
DATE: 12/09/2023

EXPERIMENT – 12

AIM : Performing operations on the given SQL Schema.

LANGUAGE USED : MYSQL

SCHEMA :

LIVES ( PERSON_NAME, STREET, CITY )

WORKS (PERSON_NAME, COMPANY_NAME, SALARY)

LOCATED_IN (COMPANY_NAME, CITY)

MANAGES (PERSON_NAME, MANAGER_NAME)

QUERY:
[i] Find the name of all employees who work for HDFC Bank:

[ii] Find the name & city of all employees who work for HDFC Bank:
[iii] Find the name, street & city of all employees who work for HDFC Bank & earn more
than 1 Lakh:

[iv] Find all employees who live in the same city as the company they work for:

[v] Find all employees who don’t work for HDFC

[vi] Find all employees who live in the same city as their managers

RESULT : Commands executed successfully.

KAMAKSHI OJHA
A2305221235

You might also like