dgadiraju

Exercises – SQL Analytics or Windowing Functions using Postgresql

Analytics Functions¶ Let us take care of the exercises related to analytics functions. We will be using HR database for the same. Get all the employees who is making more than average salary with in each department. Get cumulative salary for one of the department along with department name. Get top 3 paid employees with …

Exercises – SQL Analytics or Windowing Functions using Postgresql Read More »

Solutions – SQL Analytics or Windowing Functions using Postgresql

Analytics Functions¶ Let us take care of the exercises related to analytics functions. We will be using HR database for the same. Get all the employees who is making more than average salary with in each department. Get cumulative salary for one of the department along with department name. Get top 3 paid employees with …

Solutions – SQL Analytics or Windowing Functions using Postgresql Read More »

Solutions – DML or CRUD Operations using Postgresql

DML or CRUD Operations using Postgresql¶ Let’s create a table and perform database operations using direct SQL. In [1]: %%HTML <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/pqtKUUI5cCo?rel=0&amp;controls=1&amp;showinfo=0″ frameborder=”0″ allowfullscreen></iframe> Exercise 1 – Create Table¶ Create table – courses course_id – sequence generated integer and primary key course_name – which holds alpha numeric or string values up to 60 characters …

Solutions – DML or CRUD Operations using Postgresql Read More »

Solutions – Loading Data into Postgres Tables

Getting Started¶ Here is the exercise related to getting started module. Exercise – Loading Data¶ As part of this exercise, you need to take care of loading data using COPY Command. You can connect to the database using following details in the environment provided by us. Host: localhost Port: 5342 Database Name: YOUR_OS_USER_hr_db User Name: …

Solutions – Loading Data into Postgres Tables Read More »

Solutions – Overview of Python Collections – dict and set

Exercises – Dicts and Tuples¶ Let us go through some exercises related to dict and tuple. Exercise 1 – Access all the values¶ Get the values from the below dict in the form of a list. In [1]: d = { ‘order_id’: 1, ‘order_date’: ‘2013-07-25’, ‘order_customer_id’: 100, ‘order_status’: ‘COMPLETE’ } In [2]: def get_values(d): l = d.values() …

Solutions – Overview of Python Collections – dict and set Read More »