SQL Basic 1
SHOAIB SHAIK
?? Published author, AI and Deep learning; fascinated with technology with a deep passion to use technology to make the world a better place. Time, space, Quantum computing are traits I am happy to be involved.
Client/Server Architecture
After the era of mainframes, the shift was towards client/server systems where a main computer (server) is accessible from the network and PCs, allowing read access to be performed over the network.
SQL Basics
SQL involves relational databases divided into tables related by common key fields, allowing data to be broken down into manageable units for easier maintenance and optimization. Tables consist of fields (columns) and records (rows) containing specific information.
SQL Commands
SQL commands include Data Definition Language (DDL) for creating and restructuring database objects, Data Manipulation Language (DML) for inserting, updating, and deleting data, Data Query Language (DQL) for focusing on querying data, Data Control Language (DCL) for controlling database access, and Transaction Control Commands for managing transactions.
Entity-Relationship Diagrams
ERD relationships illustrate attributes within entities, which translate to tables and columns in a database. Attributes become columns when building tables using SQL.
Database Life Cycle
The database life cycle involves stages like development, testing, and production. Relationships in databases can be one-to-one, one-to-many, many-to-many, or recursive, each defining different record interactions.
Normalization
Normalization is a technique to eliminate redundant data and optimize relationships between data entities. It involves organizing data into logical entities and tables to reduce data redundancy and improve query speed, typically following the first, second, and third normal forms.
Understanding the SQL
A relational database is a database that is divided into logical unit called tables these tables are related to one and another with in the database a relational database allows the data to be broken down logics smaller manageble units easier maintaine and more option to the data optimiztion
the tables are adequtely related such that it can be retrived in a single query
whic are having a comman key fields
?
every table is divided into small entites called fields
a field is a column in a table that is designed to mauntian specific information
?
records are also called rows of data in a horizontal entity in table
?
Primary key
Foregin key
NULL is the term that is used to represent the missing value and a null value in a table is a value in a field that appers to be blank
there are logical elements which might include the elements like
entities
attribuites
relationships
information
?
Database schema
a schema is a group of related object in a database. a schema is owned by a single database user and objects
type of SQL Commands
data definatioan language
data manipulation language
data query language
data control language
data admin commands
transaction control commands
?
database structure.
DDL it is a part that a enables a database user to create and restructure database obj like
CREATE
DELETE
?
CREATE, ALTER, DROP
?
?
DML COMMAND ARE LIKED TO INSERT UPDATE DELETE A DATA
INSERT, UPDATE, DELETE
?
DQL THIS IS TO CONCENTRATE FOCUS OF SQL
SELECT
?
DCL are THE CONTROL COMMAND IN SQL WHICH ARE USED TO DATABASE
领英推荐
alter
grant
revoke
create synonym
?
transational control commands are
commit
rollback
savepoint
set transaction
?
?
Entity and relationships
ERD relationships illustrate with a database as the attibutes with each entity.
?
from a logical stand point s the entity and attributes in a diagrame will evetual;y become the table and columns in a database
?
attributes will become columns when you build the tables using the SQL
?
Database Life cycle
development
test
production
relationship
there are
one to one relationship
one to many relatiinship
many to many relationship
recursive relationship
?
One to one relationship
in a one to one relationship one record in a table is related to the only one record in another table
one to many
in a one to many relationship one record is related to one or many records in the anothe table
Many to many relation
we have two many to many relationship in another table
?
referencial integriti is defined as the pertain to parent an child relation in a realational database
it can be taken as primary key and foreign key
?
primary key
a primary key is simply a constaint placed on a column in a table that identifies each data value in that column or field as unique
?
forgine key = primary key of the secondary table
?
hour - 7
?
Normalization
it is technique that will eliminate the redundent data and optimuze the relationship between the data entities
the same data that is present in one or more table which can lead to high data space usage reduce speed of the query
there are three most common normal forms in the normalization
the first normal form
the second normal form
the third normal form
?
in the fnf
the objective is that divide the data into logical entities and ultimately table such that there is no repeted data groups of the table
inside one of the large table you have three small and more manageble tables