Skip to content
Get App

Lecture 35 Chapter 05 Databases and Data center Security Section 5 3 Relational databases

Lecture on relational databases: tables, rows and columns, why single-table designs fail, primary keys, relationships, and relational query languages. Part of a databases and data center security chap

Key Takeaways

  • Relational databases organize data into linked tables of rows and columns, which avoids the null-heavy, costly design of a single large table.
  • A primary key uniquely identifies each record and is used to link tables together.
  • Relational query languages are declarative: users request the data they need without specifying the retrieval steps.
  • Views provide controlled, conditional access to data and support the confidentiality security principle.

What the video covers

  • Introduces the relational database as the most widely used database type, built from tables made of rows and columns.
  • Explains that each column holds one type of data (e.g., names, mobile numbers, addresses) and each row holds a complete record.
  • Illustrates why names are not unique identifiers: multiple people can share a name, so a unique key such as an ID or mobile number is needed.
  • Describes the problems of storing everything in one large table: many null values, costly structural changes, and wasted space.
  • Presents the solution of splitting data into multiple linked tables, so new information means creating new tables rather than altering existing ones.
  • Explains relational query languages as declarative: the user specifies what data is wanted, while the software or database determines how to retrieve it.
  • Defines the primary key as the column(s) whose values uniquely identify each record, and foreign keys as the links between tables.
  • Covers types of relationships between tables and the concept of a view, a virtual table built from one or several tables.
  • Discusses security: views allow conditional access, hiding data the user lacks permission to see and supporting confidentiality.
  • Notes that the relational query language is used to define, modify, and retrieve data.

Answers

Questions about this video

Why can't a name be used as the unique identifier in a table?

The lecture explains that names can repeat, so a name alone may match more than one row. A unique value such as an ID or mobile number is needed to identify a single record.

What problems does storing all data in one table cause?

It creates many null values for unused fields, requires new columns for every new entry, and forces structural changes that affect the software built on the database, which costs space and maintenance effort.

How does a view support database security?

A view shows users only selected rows or columns of underlying tables. Hidden data stays inaccessible to users without permission, which supports confidentiality.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
In the name of God, the Most Gracious, the Most Merciful. We continue with chapter six. Today, God willing, in this lecture we will talk about section 5.3.
00:10
Speaker A
Or relational databases. By its name, "relational database," it means I have data within this database that will have relationships between them okay?
00:24
Speaker A
So, the relational database is the most widely used type of database currently okay? And it is managed using The basic building block we have is the table, or sometimes we call it what?
00:45
Speaker A
The table contains a set of rows and columns. So, the relational database is the most famous type of database, the most used, and the most common, okay? Its basic building block is the table, and every table contains rows and columns.
01:02
Speaker A
Okay. It is organized in the form of rows, where each row contains complete data, and columns, where each column contains only one type of data, such as a name column that contains only names, or a column that contains what?
01:25
Speaker A
Only addresses. Alright. The table in front of us here is a table that contains three columns and three rows.
01:36
Speaker A
The first column, second column, third column—the mobile number column contains mobile numbers, and the mobile number is unique.
01:44
Speaker A
The name column contains names, and names can be repeated. And [the column] contains what? The address.
01:52
Speaker A
So, the [name] will not be [unique], and consequently, the [name] alone does not identify a row for me. For example, if I tell you Ahmed, who is Ahmed? Get me Ahmed. Can you bring me one or more? If
02:03
Speaker A
the word Ahmed doesn't give me more than one, what does that mean? If the word Ahmed brings me more than one, Ah, what does it mean for a value to identify only one? If we said the [ID] and the [ID]...
02:25
Speaker A
Let's look at the [ID]: one, two, three —there is no repetition. We have Ahmed repeated twice.
02:34
Speaker A
Which column is the one whose value identifies a single row or record for me ?
02:50
Speaker A
Alright. It tells me that previously, the [data] was stored in [or]... Everything was stored in one table.
03:02
Speaker A
So, suppose a mobile number...if I have three users who might use the same mobile number, I would create a first column called...
03:17
Speaker A
Okay, the first, second, and third, okay , and I would enter values for them.
03:23
Speaker A
This was in the past. Okay, it says here if the number only contains [one], I will put an empty value in the [other].
03:36
Speaker A
Okay. Okay, in this table, it says all data is put in one table of the type [ relational], and each [row] contains the [number] uniquely, but next to it are three or four names.
03:52
Speaker A
Well, if we need a fourth name, we will have to add a fourth column to what?
04:00
Speaker A
Okay, from the [problem]... We have several problems, we have two basic problems. The first problem is that I have...
04:11
Speaker A
Meaning, I have here, for example... The number 05990002 is unused, so I put it as empty, and therefore we have what ?
04:27
Speaker A
Or it happens that we have...and consequently, we will have many columns with [null] values.
04:33
Speaker A
The second thing is that it requires me to do what? Any new entry requires new columns, and the new columns I add will have an initial value, which is null, increasing null-related issues and complexity.
04:50
Speaker A
At the same time, if I change the table , it means I have to change the database structure; I have to do it for whom?
04:59
Speaker A
For the software built on this database . It consumes a lot of space and makes it very costly, forcing me to do it for every new value or every new entry I want to add, okay.
05:18
Speaker A
So, what is the solution? The solution, they said, is to use the I Instead of using one large table, what will I use?
05:31
Speaker A
Many tables that are linked to one another. It allows me to create Instead, there must be relationships between these, and these relationships are linked by whom?
05:49
Speaker A
That is the Adding new information does not require me to what? Rebuild whom? The main table okay.
06:01
Speaker A
Consequently, the maintenance cost for my database is low. Every table in the tables I have, which is and and every table Name and who is?
06:24
Speaker A
The city or address, okay? Thus, the link between them will be whom ? It says that adding a new service requires new data; the need for new data makes me create a new table, not a new column. Why?
06:43
Speaker A
Because we keep the old table as it is; the modification only happens in new tables so as not to affect the existing system.
06:54
Speaker A
How do we link them together? That is data languages or relational query languages. It uses declarative rather than procedural. Meaning it tells me, "I want this data." It does not specify how I obtain the data.
07:20
Speaker A
It allows the user to request data, to retrieve data that Meets specific conditions. Their data can come from one table, two , three, or four; however many they can link, they link.
07:46
Speaker A
They only specify what data they want. So who determines how the data is obtained? It is said that what determines it is the software built on the database or the database itself.
08:00
Speaker A
Okay. So what is the difference between It says you specify what data you want; user You specify the steps and procedures to obtain the data, step by step.
08:30
Speaker A
But is this the user, or not the user? In programming languages, the programmer determines the method of retrieving data okay?
08:41
Speaker A
The word, as we said, means what you want whereas How to get you what you want.
08:50
Speaker A
Okay, we have terms in They might also go along with them. That is the row or Or or they all come to what? To the meaning of a field or a cell value.
09:23
Speaker A
Okay? So every name among these is effectively the same, and we can use them in a way that is Interchangeable throughout the text.
09:34
Speaker A
Okay. Since I am talking about relational databases and since I am talking about having many tables, how do I identify the data? It said we must have in each table.
09:45
Speaker A
This uniquely identifies every in the table. If I tell it five, it will return one; if I tell it ten, it will say one; if I tell it a thousand, one, okay?
09:56
Speaker A
Thus, it identifies one field or achieves one unique record in the table , its definition.
10:08
Speaker A
Its definition is a part of the record I use to uniquely identify one item in the database, okay? What are the features of the...
10:23
Speaker A
It could be one column name or more than one column name, and its value must be unique in every...okay?
10:33
Speaker A
Its value is not allowed to be repeated within a column in the same table.
10:44
Speaker A
Okay, I will determine the...which will identify a single, clear unique item in the table. For example, in the phone directory...
10:58
Speaker A
The phone number is the... Okay. Okay, what is the...The...is the primary key in the table, and this key I want to link to any other field.
11:26
Speaker A
Okay, this key I want to link to, I want to link between the two tables, I will use the...to link the table, I will take the...of the primary table and store it in the second table, and thus I have...
11:44
Speaker A
I have two tables ready and linked to each other. Okay, what are the types of relationships we have? The types of relationships could be...
11:53
Speaker A
Or... So, the types of relationships... Or...okay, what is the...? The first thing we have is the...which is what?
12:04
Speaker A
Meaning, it is stored correctly and clearly on the... The larger one we have is the...or the second term we have is the...or the...
12:21
Speaker A
Which is who? Or the other terms we have ... If I want to create it based on information from two tables...
12:32
Speaker A
Okay. What does it do for us? So it is the result of executing this, which might return specific rows or specific columns from a table or a group of tables.
12:50
Speaker A
It might link information from more than one table, but emphasize that it is what ?
12:56
Speaker A
Meaning, it is fully stored. It specifies for me specific columns or specific rows to appear to the user.
13:10
Speaker A
It tells me, it displays who? Which is ... So we have the second idea.
13:28
Speaker A
I can build it from one table, or from several tables. So we have it on it...
13:37
Speaker A
If it is...Covered with a lid. This means it is not... Okay. If this data exists in more than one table, that means what do I want to do? I want to link them together. And return my data in one table. But...
13:55
Speaker A
I can build it as one table. Or I can build it on a set of tables.
14:01
Speaker A
Okay. What is the relationship of... It tells me? Simply put, I can achieve this by choosing a specific set of rows . And make them available for the user to search through. Or I choose a number of specific columns. I allow the user to
14:19
Speaker A
what? Search in them, or I choose a number of rows and a number of columns for my result, and thus my view becomes what?
14:29
Speaker A
Okay. Why is security important? Because the view always gives us the ability to have conditional access to the relational database.
14:46
Speaker A
The user and the application need to get access permission for specific rows or specific columns that are what?
14:55
Speaker A
Inside or not present inside the table. And if I created the view, I can give the user permissions on the view, for example, the...or grant, okay, it told me...
15:14
Speaker A
And I lost...found who? That the permission is withdrawn from me regarding the table, it told me what do I do?
15:21
Speaker A
I come and create the view. This view, I tell it, for example, show me in it the rows I am interested in or the columns I am interested in, I let him be pictured in...or the columns he is interested in, and I create in it who
15:33
Speaker A
? A new view, who am I creating in it? A new view, so why is it important for security?
15:40
Speaker A
As we said, it's important for security simply because I hide the rest of the data from you, thus achieving the confidentiality principle, where you have data you cannot access or see because you lack the permission for it, why?
15:53
Speaker A
Because, quite simply, when I created the view that I gave you access to, I hid the columns or the rows that I didn't want to appear in it, okay.
16:06
Speaker A
What are the concepts related to security linked to ours in whom? In a relational database, the first thing it tells me is To link tables and have data integrity, to build conditional or restricted access for whom?
16:24
Speaker A
To rows or columns themselves, it is the language used to define, modify, or retrieve data.
16:36
Speaker A
The book The book defines it as a technique used for what? To restrict access to whom?
16:55
Speaker A
With that, we are finished; we will talk in the next recording, God willing, about
Topics:relational databasetablesprimary keyforeign keySQLviewsnormalizationdatabase securitydata relationshipsconfidentiality

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →