SQL with Jupyter Notebook Tutorial

1 / 61

Introduction to DataBases

We have a lot of records to maintain in this data-oriented world. In the olden days where computers were not very oftenly used by people, they used to notedown the information in tabular froms on papers/record-books.

enter image description here

But this system of maintaining data has some costly loopholes:

  1. It is difficult to make changes.
  2. Delete/Insert cannot be clean and easy. We may have to strike off the records to delete or we may alsways have to add new information at the ending. This makes searching for a particular information very difficult.
  3. There may be repetitive data: meaning some records may be written again because there is no way to check if that data already exists.
  4. There may be inconsistency: If the data is duplicate(such as details of a same student recorded more than once), then there may be different values for one or more attributes(such as the phone number or address may be written differently).
  5. More scope for manual errors, and unclear handwriting.
  6. Querying based on certain conditions, retriving only cetain data is very costly as there may be many pages to scrutinize and summarize.
  7. Security issues: anyone can manipulate the data which may incur huge losses.
  8. We may have to use multiple recordbooks to store data as a whole; for example, we may have to use a book for student biodata, another one for their courses, another one for their marks, etc. In this case, if a change is made to one of these books, the change should also be appropriately done in all the other books which involves a lot of time to search for the data to change. This could also incur lot of human erros and inconsistencies and thus this method is unreliable.

With growing data everywhere, there is a dire need for softwares which could help us in:

  1. inserting/deleting/updating the data.
  2. maintaining consistency and avoid duplication of data.
  3. reducing manual errors
  4. making the process of searching/querying/retriving the data more simpler.
  5. securing the data; authorizing restricted users to manipulate/query the data.

Here comes the role of Database Management Systems(DBMS).

Databases:

Recordbooks come under physical way of recording/maintaining data, whereas database is an electronic way of maintaining the data.

DBMS:

DBMS is a software used to created, manipulate, maitain data. Thers is something called RDBMS whic is an extension for DBMS. In RDBMS, we can store data in tabular forms.

Examples of RDBMS softwars are MySQL, Oracle, Microsoft SQL Server database, etc.

There are also non-relational databses(known as No-SQL databses) such as HBase, MongoDB, etc., but we shall main focus on learning RDBMS using the MySQL software throughout the topic.

Tables:

A database is a collection of tables. Each table contains data related to a desired set of records. For example, a college database may be designed to have various tables:

  • student_biodata which may contain the student roll number age, address, gender, parents, etc.
  • student_courses which may contain the name of the courses each student has taken.
  • course_table which may contain name of the courses, course ids etc.

and other tables needed as per the needs of our scenario.

enter image description here

The above image represents a schematic view of a relational database system for students.

A database is a collection of tables and a table is a collection of rows/records.

The above database contains 3 tables: student_biodata table, student_courses table and courses_table table. The table student_biodata contains rows related to Alex, Snow White etc.

SQL(Structured Query Language) is a language used to wite queries to create/manipulate the data in the RDBMS.

Throughout this course, we will learn how to use the MySQL RDBMS software.


No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...