0% found this document useful (0 votes)
22 views

Python Practical Assignment1 2022

The document outlines a practical assignment involving creating tables, writing queries, and dumping a database to and from CSV files. It includes instructions to create tables, write queries to retrieve and aggregate data, create a trigger, and use filtering elements like DISTINCT, WHERE, and GROUP BY.

Uploaded by

Hirpara Krush
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Python Practical Assignment1 2022

The document outlines a practical assignment involving creating tables, writing queries, and dumping a database to and from CSV files. It includes instructions to create tables, write queries to retrieve and aggregate data, create a trigger, and use filtering elements like DISTINCT, WHERE, and GROUP BY.

Uploaded by

Hirpara Krush
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Shri S. V.

Patel College of CS & BM


PRACTICAL ASSIGNMENT-1 (JOURNAL)
CLASS: S.Y.B.C.A. (3rd Semester)
SUBJECT: Practical (Database Handling using Python)-306
Date: 27/07/2022

Sr. Description
No.
1 Create the following tables and enter at least 10 records with appropriate
constraints:
Employees(employee_id, first_name, last_name, age, email, phone_number,
hire_date, job_id, salary, commission_pct, manager_id, department_id)
Departments( Department_Id, Department_Name, Manager_Id, Location_Id)
Locations( location_id, street_address, postal_code city, state_province,
country_id)
Countries(country_id, country_name, region_id)
A) Write a query to display the names (first_name, last_name) using alias
name "First Name", "Last Name"
B) Write a query to select first 10 records from a table
C) Write a query to display the last names of employees whose names
have exactly 6 characters
D) Write a query to get the department ID and the total salary payable in
each department
E) Write a query to find the names (first_name, last_name) of the
employees who have a manager who works for a department based in
the United States
F) Write a query to find the names (first_name, last_name), the salary of
the employees who earn more than the average salary and who works
in any of the IT departments
G) Write a query to find the employee id, name (last_name) along with
their manager_id, manager name (last_name).
H) Write a query to display the job title and average salary of employees.
I) Write a query to find the addresses (location_id, street_address, city,
state_province, country_name) of all the departments
2 Write a command to Dump entire database with proper file name and tables
structure into a file named as your rollno.
3 Write a trigger called AGECHECK on table employees that don’t allow the
insertion or update of any record that has an age less than 18.
4 Write a python program to read CSV file and upload data into table.
5 Write a python program to retrieve all rows from employee table and dump
into ‘employee_details.csv’ CSV file.
6 Give examples (Write query and output) for following Filtering elements :
Shri S. V. Patel College of CS & BM
PRACTICAL ASSIGNMENT-1 (JOURNAL)
CLASS: S.Y.B.C.A. (3rd Semester)
SUBJECT: Practical (Database Handling using Python)-306
Date: 27/07/2022
Distinct, where, between, in, like, union, intersect, except, limit, IS NULL, IS
NOT NULL,
Group by, order by, conditional logic (CASE)

You might also like