Prepare the Insert SQL Data Management Statements

Assignment Help Database Management System
Reference no: EM132408789

Project: Tools rental store

Section A – Setup Python for database connection

Project overview

The project includes three phases:

Phase #1: Database conceptual design

Submission: ERD diagram with entities and relationships between them. ERD diagram can be prepared in draw.io, for example.

Entity: entity name, attributes and their types, constraints such as primary and foreign keys should be indicated with PK and FK.

Relationships: each relationship should indicate cardinality and optionality in crow foot notation.

o Phase #2: Database creation, which includes

o Database creation

o Table creation

o Table population

o Data management: Queries (select), Insert, Delete

Submission: Text files with extension *.sql with SQL statements

o Phase #3: Python program to manage database

Submission: Python script, test plan, demo

Phase #1 - Database conceptual design

Data requirements

The following data has to be managed for the tool rental store: customer information, tools information, rental information. This will require 5 tables

2. List of relations, including attributes and data type, constraints (such as FK, PK), relationships – cardinality and optionality in Crow foot notation.

Phase #2 - Setting up database

Database creation

Database

Database name: You can select a name for your tool rental store or call it “tool_store_MN”.

Tables

Setup all required tables using SQL statements written to one or more text file(s). Use .sql extension to save files. Use the psql input feature (\i file) to setup the database in PostgreSQL.

Set up all tables.

Populate all tables with a minimum of 8 tuples per table.

Prepare the following SQL queries to:

o Display all customer information.

o Display all tools information, including jobs (sorted by tool_name and jobs).

o Display all tools for a given job.

o Display all rentals, including: customer first and last name, tool_name, rental date, rental return date.

o Display all rentals for a given customer.

o Display a rental for a given customer and given tool.

o Display all overdue rentals.

Prepare the following SQL data management statements: insert, delete:

o Insert a tool rental based on: tool ID, customer ID, rental date (use SQL current_date function) and return date (based on rental days added to current date:

current_date + rental_days).

o Delete a tool rental based on tool ID and customer ID.

Phase #3 – Create Python script

New concepts: Database connection

You will need to install a driver to connect from Python program to the database

In Python script

o Import the driver

Import the driver into your python program with: import psycopg2

o Create the database connection

Program requirements

#1. Menu-driven

The program displays a main menu with the following menu options:

1. Queries (sub-menu)

2. Insert tool rental

3. Delete tool rental

x.Exit

If the first option is selected a submenu is displayed with the following query options:

1. Display all customers

2. Display all tools (optionally by job)

3. Display all rentals (optionally by customer)

4. Display all overdue rentals

The program runs until the user selects the exit option ‘x’.

Attachment:- Project Details.rar

Reference no: EM132408789

Questions Cloud

Fixed rate loan and an adjustable rate mortgage : Ron and Linda are shopping for a mortgage. They are considering between a fixed rate loan and an adjustable rate mortgage (ARM).
Compute the cost of capital of the stock to firm : The dividend rate is 12%, and the par value of the stock is $100. Compute the cost of capital of the stock to your firm. Show all work.
Impact of convergence of public-private sector security : Assess the impact of the convergence of public and private sector security in the post-9/11 world. How is it being accomplished?
What is the value of holdings : What is the value of your holdings after a 17% stock dividend if the stock price per share remains unchanged?
Prepare the Insert SQL Data Management Statements : List of relations, including attributes and data type, constraints (such as FK, PK), relationships – cardinality and optionality in Crow foot notation.
PPT on Internet of Things Solution for Air quality manager : Northeastern University College of Professional Studies, US-Create a powerpoint presentation with audio on Internet of Things Solution for Air quality manager.
Analyze the connection between businesses and society : Illustrate the concept and application of social responsibility. Analyze the connection between businesses and society.
What is the maximum cash price per share : XYZ has 5 million shares outstanding at a current market price of $65 per share. What is the maximum cash price per share that could be paid for XYZ?
Focus your paper on texas : Pick an issue and write a Pro-Con-My Opinion Paper on topic-focus your paper on Texas. A section on why Texas should legalize marijuana backed up with research.

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd