SlideShare a Scribd company logo
Data Manipulation
April 16, 2024
Instr. John Oliver Lacap
Introduction to
Database
Data Manipulation ppt. for BSIT students
What is a database?
• A structured collection of data that is organized in a way that
allows for efficient storage, retrieval, and management of
information.
• It is a computerized system that enables users to store,
manage, and access data according to specific requirements.
• A database can contain various types of information, including
text, images, videos, and numerical data.
Importance of Database
• Data Organization - Databases provide a structured and
organized way to store, manage and retrieve data. This allows
for efficient access and retrieval of the required data, while
minimizing data redundancy and inconsistency.
• Data Integrity - Databases use various techniques, such as
validation rules, constraints, and referential integrity, to ensure
that the data stored in them is accurate and consistent. This
reduces the risk of data errors and inconsistencies, which can
lead to incorrect decisions and wasted time and resources.
Importance of Database
• Scalability - Databases can handle large amounts of data and
can scale to support increasing amounts of data over time. This
is especially important for businesses that need to store and
manage large volumes of data, such as customer information,
sales data, and financial transactions.
• Security - Databases provide various security features, such as
user authentication, access control, and data encryption, to
protect sensitive data from unauthorized access and ensure
data privacy and confidentiality.
Importance of Database
• Efficiency - Databases provide optimized mechanisms for data
retrieval and manipulation, which helps improve the efficiency of
data processing and analysis. This can result in faster and more
accurate decision-making and can improve overall business
performance.
Relational Database
• A relational database is a type of database that organizes data
into one or more tables with a predefined structure of columns
and rows
• The relationships between the tables are defined through keys,
such as primary keys and foreign keys, which allow data to be
linked and accessed across multiple tables.
Relational Database
• Relational databases use Structured Query Language (SQL) to
manipulate and retrieve data. SQL allows users to insert,
update, delete, and query data within the database, and
supports a wide range of operations and functions for data
analysis and reporting.
Components of a
Relational Database
Tables
• Structured sets of data that organize
information into rows and columns.
• Each table represents a single entity, such
as a customer or a product, and contains
specific attributes or fields that describe
that entity.
Columns
• Also known as fields, are the vertical
components of a table that contain
specific types of data.
• Each column is associated with a data
type, such as text, number, or date, which
defines the type of data that can be stored
in that column.
Data Types
• INT - Used to store integer values (whole numbers) within a
specified range.
• FLOAT - Used to store floating-point numbers (numbers with a
decimal point).
• CHAR - Used to store fixed-length character strings (strings of
characters with a fixed length).
• VARCHAR - Used to store variable-length character strings
(strings of characters with a varying length).
• DATETIME - Used to store both date and time values.
Data Types
• BIT - Used to store Boolean values (true/false values).
• VARBINARY - Used to store variable-length binary data.
• TEXT - Used to store large amounts of text data.
• DECIMAL - Used to store decimal numbers with a fixed number
of digits before and after the decimal point.
• MONEY - Used to store currency values.
Rows
• Rows - also known as records, are the horizontal components of a table that represent individual instances
of an entity. Each row contains data that corresponds to the attributes or fields defined by the columns.
Primary and Foreign
Keys
Primary Keys - Unique identifiers that are used to uniquely
identify each row in a table. They ensure that each record is
unique and can be referenced and linked to other tables
within the database.
Foreign Keys - attributes in a table that are linked to the
primary key of another table. They are used to establish
relationships between tables, allowing data to be retrieved
and analyzed across multiple tables.
Database Management System
• A software system that allows users to store, organize, and
manage data in a database.
• It provides a way to manage the interactions between the
database and the applications that use it, allowing users to
create, modify, and retrieve data in a controlled and efficient
manner.
Database Management System
• The main components of a DBMS include:
• Data Definition Language (DDL) - used to define the structure of the
database and its components
• Data Manipulation Language (DML) - used to insert, update, and
delete data in the database, and the query language, which is used to
retrieve and analyze data.
• There are various types of DBMS available, including relational,
NoSQL, object-oriented, and hierarchical DBMS. Each type has
its own strengths and weaknesses and is suited for different use
cases and applications.
Database Management System
• There are various types of DBMS available, including relational,
NoSQL, object-oriented, and hierarchical DBMS. Each type has
its own strengths and weaknesses, and is suited for different
use cases and applications.
Structured Query Language (SQL)
• A programming language used to manage and manipulate
relational databases. SQL allows users to interact with
databases to create, modify, and retrieve data, as well as
perform various other tasks related to database management
and administration.
Structured Query Language (SQL)
• SQL syntax is straightforward and intuitive, with commands
such as SELECT, INSERT, UPDATE, and DELETE used to
perform common database operations. SQL also includes a
range of functions and operators for data analysis and
manipulation, as well as the ability to join tables together to
retrieve data across multiple tables.
Basic SQL Syntax
CREATE TABLE
Used to create a new table
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype
);
SELECT
Used to retrieve data from a table or multiple tables
SELECT column1, column2, column3
FROM table_name;
WHERE
Used to filter the data based on a condition
SELECT column1, column2
FROM table_name
WHERE column3 = 'value';
INSERT
Used to insert data into a table.
INSERT INTO table_name (column1, column2, column3)
VALUES ('value1', 'value2', 'value3');
UPDATE
Used to update data in a table
UPDATE table_name
SET column1 = 'new_value1', column2 = 'new_value2'
WHERE column3 = 'value';
DELETE
Used to delete data from a table
DELETE FROM table_name
WHERE column1 = 'value';
GROUP BY
Used to group the data based on a column
SELECT column1, COUNT(column2)
FROM table_name
GROUP BY column1;
ORDER BY
Used to order the data based on a column by ascending or
descending
SELECT column1, column2
FROM table_name
ORDER BY column1;
Practice (20 minutes)
• From the SalesLT.Customer, query all customer that has suffix
Jr.
• From the SalesLT.Customer, update the company name record
of Donald Blanton to UST Angelicum College
• From the SalesLT.Customer, delete the record of Ms. Erin
Hagens
• From the SalesLT.Customer, filter the data by the sales person
adventure-worksjillian0
Creating CRUD
Operations in Console
Application
(Create, Retrieve, Update and Delete)
app.config
• A configuration file that is used by .NET applications to store
application-specific settings and parameters.
• It is an XML file that contains key-value pairs, where the keys
are the names of the settings, and the values are the
corresponding values for those settings.
Data Manipulation ppt. for BSIT students
ConfigurationManager
• It is used to read configuration settings from various
configuration files such as app.config or web.config files
in .NET applications.
• Using the ConfigurationManager class, developers can
retrieve configuration settings such as connection strings,
application settings, and custom configuration sections defined
in the configuration file.
Data Manipulation ppt. for BSIT students
System.Data.SqlClient
• A namespace in the .NET Framework that provides a set of
classes for working with Microsoft SQL Server databases.
• The System.Data.SqlClient namespace includes classes such
as SqlConnection, SqlCommand, SqlDataReader, and
SqlDataAdapter.
• The SqlConnection class is used to establish a connection to a
SQL Server database, while the SqlCommand class is used to
execute SQL commands on the database.
Data Manipulation ppt. for BSIT students
“using” statement
• It is used to declare a code block that defines a scope in which
a certain resource, such as a file or a database connection, can
be used.
• The using statement is a convenient way to ensure that the
resource is properly and automatically disposed of when it is no
longer needed, even if an exception is thrown.
SqlConnection.Open
• Opens a database connection with the property settings
specified by the ConnectionString.
Object Relational Mapping (ORM)
• A programming technique that enables developers to work with
relational databases using an object-oriented programming
language, such as Java, C#, or Python.
• ORM tools provide a mapping layer between a database and an
object-oriented program, allowing developers to interact with the
database using objects, rather than writing SQL statements
directly.
Object Relational Mapping (ORM)
• This helps simplify the process of interacting with the database,
and allows developers to focus on the object-oriented design of
their code, rather than the details of database interactions.
Data Manipulation ppt. for BSIT students
Dapper ORM
• Dapper is an open-source, lightweight, and high-performance
object-relational mapping (ORM) framework for .NET
applications.
• It was developed by Stack Overflow, and its primary goal is to
provide a simple, flexible, and fast way to map database
records to objects in your code.
• It focuses on providing a lightweight and fast alternative that
can handle most common database operations without getting
in the way.
Dapper Features
• High performance
• Dapper is built with performance in mind, and it aims to be one of the
fastest ORM frameworks available for .NET.
• Easy-to-use
• Dapper's API is designed to be simple and straightforward, with
minimal overhead and a low learning curve.
• Flexible mapping
• Dapper supports a variety of mapping options, including automatic
mapping based on naming conventions, attribute-based mapping, and
manual mapping via custom code.
Dapper Features
• Raw SQL support
• Dapper allows you to execute raw SQL queries directly, giving you full
control over your database operations.
• Multiple database support
• Dapper works with a wide range of databases, including SQL Server,
Oracle, MySQL, PostgreSQL, SQLite, and more.
Data Manipulation ppt. for BSIT students
Repository Pattern
• A software design pattern that provides an abstraction layer
between the application and the data access layer. It is a
way to separate the code that accesses the database from the
business logic of the application.
Repository Pattern
• The repository pattern involves creating a repository class
that acts as a mediator between the application and the data
source. The repository class provides a clean interface that the
application code can use to retrieve, store, update, and delete
data, without having to know the details of how the data is
stored and accessed.
Data Manipulation ppt. for BSIT students
Ad

More Related Content

Similar to Data Manipulation ppt. for BSIT students (20)

SQL things ace series of the thing useful
SQL things ace series of the thing usefulSQL things ace series of the thing useful
SQL things ace series of the thing useful
avinash4210singh
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
MargaretMaryT
 
Introduction of Database
Introduction of Database Introduction of Database
Introduction of Database
PadmapriyaA6
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
Piyush sachdeva
 
Computer class of agriculture production 5.pptx
Computer class of agriculture production 5.pptxComputer class of agriculture production 5.pptx
Computer class of agriculture production 5.pptx
muddydevil2003
 
MODERN DATABASES (2).pptx in which modern types of data bases
MODERN DATABASES (2).pptx in which modern types of data basesMODERN DATABASES (2).pptx in which modern types of data bases
MODERN DATABASES (2).pptx in which modern types of data bases
lovepreet33653
 
People soft basics
People soft basicsPeople soft basics
People soft basics
technicalguru
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
Dr. Mazin Mohamed alkathiri
 
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
DATABASE MANAGEMENT SYSTEMS CS 3492.pptxDATABASE MANAGEMENT SYSTEMS CS 3492.pptx
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
venigkrish89
 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
VaradKadtan1
 
DBMS 1.pdf from computer application for business
DBMS 1.pdf from computer application for businessDBMS 1.pdf from computer application for business
DBMS 1.pdf from computer application for business
sudeshnachand
 
Operate Database Applicationidentify ntrk handtools.pptx
Operate Database Applicationidentify ntrk handtools.pptxOperate Database Applicationidentify ntrk handtools.pptx
Operate Database Applicationidentify ntrk handtools.pptx
edget1
 
SQL SERVER Training in Pune Slides
SQL SERVER Training in Pune SlidesSQL SERVER Training in Pune Slides
SQL SERVER Training in Pune Slides
enosislearningcom
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
Vibrant Technologies & Computers
 
RowanDay4.pptx
RowanDay4.pptxRowanDay4.pptx
RowanDay4.pptx
MattMarino13
 
Introduction to Database Management Systems: Structure, Applications, and Key...
Introduction to Database Management Systems: Structure, Applications, and Key...Introduction to Database Management Systems: Structure, Applications, and Key...
Introduction to Database Management Systems: Structure, Applications, and Key...
Mahmud Hasan Tanvir
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
Dbms Basics
Dbms BasicsDbms Basics
Dbms Basics
DR. Ram Kumar Pathak
 
MS ACCESS.pptx
MS ACCESS.pptxMS ACCESS.pptx
MS ACCESS.pptx
MattMarino13
 
SQL things ace series of the thing useful
SQL things ace series of the thing usefulSQL things ace series of the thing useful
SQL things ace series of the thing useful
avinash4210singh
 
Introduction of Database
Introduction of Database Introduction of Database
Introduction of Database
PadmapriyaA6
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
Piyush sachdeva
 
Computer class of agriculture production 5.pptx
Computer class of agriculture production 5.pptxComputer class of agriculture production 5.pptx
Computer class of agriculture production 5.pptx
muddydevil2003
 
MODERN DATABASES (2).pptx in which modern types of data bases
MODERN DATABASES (2).pptx in which modern types of data basesMODERN DATABASES (2).pptx in which modern types of data bases
MODERN DATABASES (2).pptx in which modern types of data bases
lovepreet33653
 
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
DATABASE MANAGEMENT SYSTEMS CS 3492.pptxDATABASE MANAGEMENT SYSTEMS CS 3492.pptx
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
venigkrish89
 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
VaradKadtan1
 
DBMS 1.pdf from computer application for business
DBMS 1.pdf from computer application for businessDBMS 1.pdf from computer application for business
DBMS 1.pdf from computer application for business
sudeshnachand
 
Operate Database Applicationidentify ntrk handtools.pptx
Operate Database Applicationidentify ntrk handtools.pptxOperate Database Applicationidentify ntrk handtools.pptx
Operate Database Applicationidentify ntrk handtools.pptx
edget1
 
SQL SERVER Training in Pune Slides
SQL SERVER Training in Pune SlidesSQL SERVER Training in Pune Slides
SQL SERVER Training in Pune Slides
enosislearningcom
 
Introduction to Database Management Systems: Structure, Applications, and Key...
Introduction to Database Management Systems: Structure, Applications, and Key...Introduction to Database Management Systems: Structure, Applications, and Key...
Introduction to Database Management Systems: Structure, Applications, and Key...
Mahmud Hasan Tanvir
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 

Recently uploaded (20)

Deloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit contextDeloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit context
Process mining Evangelist
 
Developing Security Orchestration, Automation, and Response Applications
Developing Security Orchestration, Automation, and Response ApplicationsDeveloping Security Orchestration, Automation, and Response Applications
Developing Security Orchestration, Automation, and Response Applications
VICTOR MAESTRE RAMIREZ
 
DPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdfDPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdf
inmishra17121973
 
Medical Dataset including visualizations
Medical Dataset including visualizationsMedical Dataset including visualizations
Medical Dataset including visualizations
vishrut8750588758
 
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjksPpt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
panchariyasahil
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
LLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bertLLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bert
ChadapornK
 
Molecular methods diagnostic and monitoring of infection - Repaired.pptx
Molecular methods diagnostic and monitoring of infection  -  Repaired.pptxMolecular methods diagnostic and monitoring of infection  -  Repaired.pptx
Molecular methods diagnostic and monitoring of infection - Repaired.pptx
7tzn7x5kky
 
03 Daniel 2-notes.ppt seminario escatologia
03 Daniel 2-notes.ppt seminario escatologia03 Daniel 2-notes.ppt seminario escatologia
03 Daniel 2-notes.ppt seminario escatologia
Alexander Romero Arosquipa
 
How to join illuminati Agent in uganda call+256776963507/0741506136
How to join illuminati Agent in uganda call+256776963507/0741506136How to join illuminati Agent in uganda call+256776963507/0741506136
How to join illuminati Agent in uganda call+256776963507/0741506136
illuminati Agent uganda call+256776963507/0741506136
 
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
ThanushsaranS
 
Thingyan is now a global treasure! See how people around the world are search...
Thingyan is now a global treasure! See how people around the world are search...Thingyan is now a global treasure! See how people around the world are search...
Thingyan is now a global treasure! See how people around the world are search...
Pixellion
 
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptxPerencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
PareaRusan
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Abodahab
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
Simran112433
 
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdfIAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
mcgardenlevi9
 
Deloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit contextDeloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit context
Process mining Evangelist
 
Developing Security Orchestration, Automation, and Response Applications
Developing Security Orchestration, Automation, and Response ApplicationsDeveloping Security Orchestration, Automation, and Response Applications
Developing Security Orchestration, Automation, and Response Applications
VICTOR MAESTRE RAMIREZ
 
DPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdfDPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdf
inmishra17121973
 
Medical Dataset including visualizations
Medical Dataset including visualizationsMedical Dataset including visualizations
Medical Dataset including visualizations
vishrut8750588758
 
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjksPpt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
panchariyasahil
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
LLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bertLLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bert
ChadapornK
 
Molecular methods diagnostic and monitoring of infection - Repaired.pptx
Molecular methods diagnostic and monitoring of infection  -  Repaired.pptxMolecular methods diagnostic and monitoring of infection  -  Repaired.pptx
Molecular methods diagnostic and monitoring of infection - Repaired.pptx
7tzn7x5kky
 
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
CTS EXCEPTIONSPrediction of Aluminium wire rod physical properties through AI...
ThanushsaranS
 
Thingyan is now a global treasure! See how people around the world are search...
Thingyan is now a global treasure! See how people around the world are search...Thingyan is now a global treasure! See how people around the world are search...
Thingyan is now a global treasure! See how people around the world are search...
Pixellion
 
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptxPerencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
PareaRusan
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Day 1 - Lab 1 Reconnaissance Scanning with NMAP, Vulnerability Assessment wit...
Abodahab
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
Simran112433
 
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdfIAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
mcgardenlevi9
 
Ad

Data Manipulation ppt. for BSIT students

  • 1. Data Manipulation April 16, 2024 Instr. John Oliver Lacap
  • 4. What is a database? • A structured collection of data that is organized in a way that allows for efficient storage, retrieval, and management of information. • It is a computerized system that enables users to store, manage, and access data according to specific requirements. • A database can contain various types of information, including text, images, videos, and numerical data.
  • 5. Importance of Database • Data Organization - Databases provide a structured and organized way to store, manage and retrieve data. This allows for efficient access and retrieval of the required data, while minimizing data redundancy and inconsistency. • Data Integrity - Databases use various techniques, such as validation rules, constraints, and referential integrity, to ensure that the data stored in them is accurate and consistent. This reduces the risk of data errors and inconsistencies, which can lead to incorrect decisions and wasted time and resources.
  • 6. Importance of Database • Scalability - Databases can handle large amounts of data and can scale to support increasing amounts of data over time. This is especially important for businesses that need to store and manage large volumes of data, such as customer information, sales data, and financial transactions. • Security - Databases provide various security features, such as user authentication, access control, and data encryption, to protect sensitive data from unauthorized access and ensure data privacy and confidentiality.
  • 7. Importance of Database • Efficiency - Databases provide optimized mechanisms for data retrieval and manipulation, which helps improve the efficiency of data processing and analysis. This can result in faster and more accurate decision-making and can improve overall business performance.
  • 8. Relational Database • A relational database is a type of database that organizes data into one or more tables with a predefined structure of columns and rows • The relationships between the tables are defined through keys, such as primary keys and foreign keys, which allow data to be linked and accessed across multiple tables.
  • 9. Relational Database • Relational databases use Structured Query Language (SQL) to manipulate and retrieve data. SQL allows users to insert, update, delete, and query data within the database, and supports a wide range of operations and functions for data analysis and reporting.
  • 11. Tables • Structured sets of data that organize information into rows and columns. • Each table represents a single entity, such as a customer or a product, and contains specific attributes or fields that describe that entity.
  • 12. Columns • Also known as fields, are the vertical components of a table that contain specific types of data. • Each column is associated with a data type, such as text, number, or date, which defines the type of data that can be stored in that column.
  • 13. Data Types • INT - Used to store integer values (whole numbers) within a specified range. • FLOAT - Used to store floating-point numbers (numbers with a decimal point). • CHAR - Used to store fixed-length character strings (strings of characters with a fixed length). • VARCHAR - Used to store variable-length character strings (strings of characters with a varying length). • DATETIME - Used to store both date and time values.
  • 14. Data Types • BIT - Used to store Boolean values (true/false values). • VARBINARY - Used to store variable-length binary data. • TEXT - Used to store large amounts of text data. • DECIMAL - Used to store decimal numbers with a fixed number of digits before and after the decimal point. • MONEY - Used to store currency values.
  • 15. Rows • Rows - also known as records, are the horizontal components of a table that represent individual instances of an entity. Each row contains data that corresponds to the attributes or fields defined by the columns.
  • 16. Primary and Foreign Keys Primary Keys - Unique identifiers that are used to uniquely identify each row in a table. They ensure that each record is unique and can be referenced and linked to other tables within the database. Foreign Keys - attributes in a table that are linked to the primary key of another table. They are used to establish relationships between tables, allowing data to be retrieved and analyzed across multiple tables.
  • 17. Database Management System • A software system that allows users to store, organize, and manage data in a database. • It provides a way to manage the interactions between the database and the applications that use it, allowing users to create, modify, and retrieve data in a controlled and efficient manner.
  • 18. Database Management System • The main components of a DBMS include: • Data Definition Language (DDL) - used to define the structure of the database and its components • Data Manipulation Language (DML) - used to insert, update, and delete data in the database, and the query language, which is used to retrieve and analyze data. • There are various types of DBMS available, including relational, NoSQL, object-oriented, and hierarchical DBMS. Each type has its own strengths and weaknesses and is suited for different use cases and applications.
  • 19. Database Management System • There are various types of DBMS available, including relational, NoSQL, object-oriented, and hierarchical DBMS. Each type has its own strengths and weaknesses, and is suited for different use cases and applications.
  • 20. Structured Query Language (SQL) • A programming language used to manage and manipulate relational databases. SQL allows users to interact with databases to create, modify, and retrieve data, as well as perform various other tasks related to database management and administration.
  • 21. Structured Query Language (SQL) • SQL syntax is straightforward and intuitive, with commands such as SELECT, INSERT, UPDATE, and DELETE used to perform common database operations. SQL also includes a range of functions and operators for data analysis and manipulation, as well as the ability to join tables together to retrieve data across multiple tables.
  • 23. CREATE TABLE Used to create a new table CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype );
  • 24. SELECT Used to retrieve data from a table or multiple tables SELECT column1, column2, column3 FROM table_name;
  • 25. WHERE Used to filter the data based on a condition SELECT column1, column2 FROM table_name WHERE column3 = 'value';
  • 26. INSERT Used to insert data into a table. INSERT INTO table_name (column1, column2, column3) VALUES ('value1', 'value2', 'value3');
  • 27. UPDATE Used to update data in a table UPDATE table_name SET column1 = 'new_value1', column2 = 'new_value2' WHERE column3 = 'value';
  • 28. DELETE Used to delete data from a table DELETE FROM table_name WHERE column1 = 'value';
  • 29. GROUP BY Used to group the data based on a column SELECT column1, COUNT(column2) FROM table_name GROUP BY column1;
  • 30. ORDER BY Used to order the data based on a column by ascending or descending SELECT column1, column2 FROM table_name ORDER BY column1;
  • 31. Practice (20 minutes) • From the SalesLT.Customer, query all customer that has suffix Jr. • From the SalesLT.Customer, update the company name record of Donald Blanton to UST Angelicum College • From the SalesLT.Customer, delete the record of Ms. Erin Hagens • From the SalesLT.Customer, filter the data by the sales person adventure-worksjillian0
  • 32. Creating CRUD Operations in Console Application (Create, Retrieve, Update and Delete)
  • 33. app.config • A configuration file that is used by .NET applications to store application-specific settings and parameters. • It is an XML file that contains key-value pairs, where the keys are the names of the settings, and the values are the corresponding values for those settings.
  • 35. ConfigurationManager • It is used to read configuration settings from various configuration files such as app.config or web.config files in .NET applications. • Using the ConfigurationManager class, developers can retrieve configuration settings such as connection strings, application settings, and custom configuration sections defined in the configuration file.
  • 37. System.Data.SqlClient • A namespace in the .NET Framework that provides a set of classes for working with Microsoft SQL Server databases. • The System.Data.SqlClient namespace includes classes such as SqlConnection, SqlCommand, SqlDataReader, and SqlDataAdapter. • The SqlConnection class is used to establish a connection to a SQL Server database, while the SqlCommand class is used to execute SQL commands on the database.
  • 39. “using” statement • It is used to declare a code block that defines a scope in which a certain resource, such as a file or a database connection, can be used. • The using statement is a convenient way to ensure that the resource is properly and automatically disposed of when it is no longer needed, even if an exception is thrown.
  • 40. SqlConnection.Open • Opens a database connection with the property settings specified by the ConnectionString.
  • 41. Object Relational Mapping (ORM) • A programming technique that enables developers to work with relational databases using an object-oriented programming language, such as Java, C#, or Python. • ORM tools provide a mapping layer between a database and an object-oriented program, allowing developers to interact with the database using objects, rather than writing SQL statements directly.
  • 42. Object Relational Mapping (ORM) • This helps simplify the process of interacting with the database, and allows developers to focus on the object-oriented design of their code, rather than the details of database interactions.
  • 44. Dapper ORM • Dapper is an open-source, lightweight, and high-performance object-relational mapping (ORM) framework for .NET applications. • It was developed by Stack Overflow, and its primary goal is to provide a simple, flexible, and fast way to map database records to objects in your code. • It focuses on providing a lightweight and fast alternative that can handle most common database operations without getting in the way.
  • 45. Dapper Features • High performance • Dapper is built with performance in mind, and it aims to be one of the fastest ORM frameworks available for .NET. • Easy-to-use • Dapper's API is designed to be simple and straightforward, with minimal overhead and a low learning curve. • Flexible mapping • Dapper supports a variety of mapping options, including automatic mapping based on naming conventions, attribute-based mapping, and manual mapping via custom code.
  • 46. Dapper Features • Raw SQL support • Dapper allows you to execute raw SQL queries directly, giving you full control over your database operations. • Multiple database support • Dapper works with a wide range of databases, including SQL Server, Oracle, MySQL, PostgreSQL, SQLite, and more.
  • 48. Repository Pattern • A software design pattern that provides an abstraction layer between the application and the data access layer. It is a way to separate the code that accesses the database from the business logic of the application.
  • 49. Repository Pattern • The repository pattern involves creating a repository class that acts as a mediator between the application and the data source. The repository class provides a clean interface that the application code can use to retrieve, store, update, and delete data, without having to know the details of how the data is stored and accessed.