Introduction to SQL and Relational Databases 101
Hello, and welcome to SQL and Relational Database 101.
First, we will talk a little bit about what you'll learn in this course.
This course teaches you the basics of the SQL language and the relational database model.
This course is the first in a series of courses. There will be some lab exercises, and at the
end of each section, there are a few review questions, and at the end there is a final
exam.
By the end of this course, you will be able to discuss SQL basics and explain various
aspects of the relational database model.
In this video, we will learn about SQL and relational databases.
By the end of this video, you will be able to describe SQL, data, database, a relational
database, and list five basic SQL commands.
So let's get started on SQL and Relational Database 101.
But wait, what is SQL and what is a relational database?
What is SQL?
SQL is a language used for relational databases to query or get data out of a database.
"S Q L" is also referred to as "sequel", and is short for it's original name "Structured
English Query Language".
So SQL is a language used for a database to query data.
So what is data? And what is a database?
Data is a collection of facts in the form of words, numbers, or even pictures.
Data is one of the most critical assets of any business.
It is used and collected practically everywhere.
Your bank stores data about you, your name, address, phone number, account numbers, etc.
Your credit card company, and your Paypal accounts also store data about you.
Data is important. So it needs to be secure, and it needs to be stored and accessed quickly.
The answer is a database.
So, what is a database?
Databases are everywhere, and used every day, but they are largely taken for granted.
A database is a repository of data. It is a program that stores data.
A database also provides the functionality for adding, modifying and querying that data.
There are different kinds of databases of different requirements.
The data can be stored in various forms.
When data is stored in tabular form, the data is organized in tables, like in a spreadsheet
which is columns and rows. That's a relational database.
The columns contain properties about the item, such as Last Name, First Name, email, address,
City.
A table is a collection of related things, like a list of employees, or a list of book
authors.
In a relational database, you can form relationships between tables.
So, a database is a repository of data.
A set of software tools for the data in the database is called a database management system,
or DBMS for short.
The terms database, database server, database system, data server, and database management
systems are often used interchangeably.
For relational databases, it's called a relational database management system, or RDBMS.
RDBMS is a set of software tools that controls the data, such as access, organization, and
storage.
An RDBMS serves as the backbone of applications in many industries including banking, transportation,
health, and so on.
Examples of relational database management systems are: MySQL, Oracle Database, and DB2
Express-C.
For the majority of people using a database, there are 5 simple commands to:
* Create a table * Insert data to populate the table
* Select data from the table * Update data in the table, and
* Delete data from the table
So those are the building blocks for SQL and Relational Database 101.
Now you can describe what is SQL, what is data, what is a database, and, what is a relational
database.
You know that RDBMS stands for relational database management system.
And, you can list 5 basic SQL commands to create a table, insert data to populate the
table, select data from the table, update data in the table, and delete data from the
table.
Thank-you for watching this video.
Information and Data Models
Hello, and welcome to Information models and Data models. In this video, we will
learn about different types of models. At the end of this lesson, you will be able to
describe the difference between an information model and a data model, explain the advantage
of the relational model, and describe the difference between an entity and an attribute.
This figure illustrates the relationship between an Information Model and a Data Model.
An Information Model is an abstract, formal representation of entities that includes their
properties, relationships and the operations that can be performed on them. The entities
being modeled can be from the real world, such as a library. Information Models
and Data Models are different and serve different purposes. An Information Model is at the conceptual
level, and defines relationships between objects. Data Models are defined at a more
concrete level, are specific and include details. A data model is the blueprint of any database
system. There are several types of Information Models. The most popular is the Hierarchical,
typically used to show organization charts. As shown is in this figure, the hierarchical
model organizes its data using a tree structure. The root of the tree is the parent node followed
by child nodes. A child node cannot have more than one parent, however, a parent can have
many child nodes. The first hierarchical database management system was the Information Management
System released by IBM in 1968 and was originally built as the database for the Apollo space
program. The Relational Model is the most used data model for databases because
this model allows for data independence. Data is stored in a simple data structure, tables.
This provides logical data independence, physical data independence, and physical storage independence.
An Entity-Relationship Data Model, or ER Data Model, is an alternative to a relational
data model. Using a simplified library database as an example, this figure shows an Entity-Relationship
Diagram, or ERD, that represents entities (called tables) and their relationships.
We have authors who write books, borrowers who take books out on loan, various copies
of each book, etc. This is the final ER diagram. But how do we get there? An Entity-Relationship
Model proposes thinking of a database as a collection of entities. Rather than being
used as a model on its own, the ER Model is used as a tool to design relational databases.
In the ER Model, entities are objects that exist independently of any other entities
in the database. It is simple to convert an ER Diagram into a collection of tables.
The building blocks of an ER Diagram are entities and attributes. Entities have attributes,
which are the data elements that characterize the entity. Attributes tell us more about
the entity. In an ER Diagram, an entity is drawn as a rectangle, and attributes are drawn
as ovals. Entities can be a noun (person, place, or thing). Using a simplified library
as an example, a book is an example of an entity. Attributes are certain properties
or characteristics of an entity, and tell us more about the entity. The entity Book
has attributes such as book title, the edition of the book, the year the book was written,
etc. Attributes are connected to exactly one entity. The entity Book becomes a table
in the database, and the attributes become the columns in a table. Continuing the
simplified library example, books are written by authors. Book is an entity, and Author
is an entity . For the entity Author, the ER Diagram would look like this. The entity
Author has attributes such as the author's last name, first name, email, city, country
and an author ID (to uniquely identify the author). The entity Author becomes a table
in the database, and the attributes become the columns in the table. In the simplified
library database, we progress through the process of identifying entities, such as borrowers
who take books out on loan, various copies of each book, and copies of books out on loan.
This is the final ER Diagram. Each entity becomes a table in the database. You
can now describe the difference between an information model and a data model, explain
the advantage of the relational model, and describe the difference between an entity
and an attribute Thanks for watching this video.
0 Comments