SQL in Python

  1. DDL, INSERT, UPDATE, DELETE

    Question 1 of 3

    • Using DBeaver, create all tables shown in lecture slide using appropriate data types.
    • Insert record into respective tables as shown in lecture slide.
    • Update stock of Noodles in product table to have value as 300.
    • Increase salary of all employee by 10%.
    • Delete Record of Shyam from employee table.
    • Delete Record from product table with price more than 30.
  2. SELECT Queries

    Question 2 of 3

      Using DBeaver, load chinook.db and
      1. List FirstName, LastName and Email from Customers.
      2. List all fields from Customers table for customer living in Brazil.
      3. List InvoiceID, CustomerId and Total from Invoices tables with invoice over $10.
      4. Find record for 10 most expensive invoices from Invoices table.
      5. List customers from USA whose state is CA.
      6. Display the first 5 genres whose names start with the letter 'R', ordered alphabetically.
      7. List records from Invoices tables with invoice is between $10 and $20.
  3. Integrating SQL in Python

    Question 3 of 3

    • Read csv file employee_info.csv and store it in a table employee_info in database.
    • Run Query to fetch all records from albums tables and save it as file albums.csv.
    • Update mobile number of Ramesh Shrestha as 98172 in employee_info table.
    • Delete record of Rabindra Sapkota from employee_info table.