0% found this document useful (0 votes)
6 views3 pages

???? ? (???????? ? ???

The document provides an overview of databases, highlighting their advantages such as data integrity, security, and redundancy elimination. It explains the relational data model, including key concepts like domains, relations, and keys, as well as the role of SQL in managing databases. Additionally, it covers SQL commands, data types, and functions used for data manipulation and definition.

Uploaded by

blackevil9103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

???? ? (???????? ? ???

The document provides an overview of databases, highlighting their advantages such as data integrity, security, and redundancy elimination. It explains the relational data model, including key concepts like domains, relations, and keys, as well as the role of SQL in managing databases. Additionally, it covers SQL commands, data types, and functions used for data manipulation and definition.

Uploaded by

blackevil9103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit VI: Database and SQL

Database and its Advantages


A database is an organized collection of data, generally stored and accessed
electronically from a computer system. Databases are designed to support the storage,
retrieval, and modification of data.

Advantages of Databases

● Data Integrity: Ensures data accuracy and consistency over its entire
life-cycle.
● Data Security: Protects data from unauthorized access and breaches.
● Data Redundancy Elimination: Minimizes data duplication, saving
storage space.
● Data Sharing: Allows multiple users to access data simultaneously.
● Data Backup and Recovery: Provides mechanisms to back up data and
restore it in case of data loss.

Relational Data Model


The relational data model represents data in tables, also known as relations. Each
table consists of rows (tuples) and columns (attributes). This model is based on set
theory and predicate logic.

Concepts in Relational Data Model


● Domain: The set of permissible values for a given attribute.
● Relation: A table with columns and rows.
● Attribute: A column in a table, representing a data field.
● Tuple: A row in a table, representing a single record.
● Candidate Key: An attribute or a set of attributes that can uniquely
identify a tuple in a relation.
● Primary Key: A candidate key that is chosen as the unique identifier for
tuples in a relation.</ li>

www.jkbosenotes.in
● Alternate Key: A candidate key that is not chosen as the primary key.

SQL and its Advantages


SQL (Structured Query Language) is a standard programming language used to
manage and manipulate relational databases.

Advantages of SQL

● Easy to Learn and Use: SQL uses simple syntax which is easy to
understand.
● High Speed: SQL queries can retrieve large amounts of data quickly and
efficiently.
● Standardized Language: SQL is an ANSI and ISO standard, ensuring
consistent usage across different systems.
● Versatile: SQL can be used to query, insert, update, and delete data in a
database.
● Interactive Language: SQL can be used interactively to communicate
with the database.

Data Types in SQL


● NUMBER: Used to store numerical values. Example: INTEGER, FLOAT.
● CHAR: Used to store fixed-length character strings. Example: CHAR(10).
● DATE: Used to store date and time values. Example: DATE, TIMESTAMP.

Data Definition Language (DDL) and Data


Manipulation Language (DML)
DDL (Data Definition Language) is used to define the database structure or schema.

DML (Data Manipulation Language) is used for managing data within schema
objects.

www.jkbosenotes.in
SQL Commands

DDL Commands

● CREATE: Creates a new table or database.


● DROP: Deletes a table or database.
● ALTER: Modifies an existing database object, like a table.

DML Commands

● SELECT: Retrieves data from one or more tables.


● INSERT: Adds new data into a table.
● UPDATE: Modifies existing data in a table.
● DELETE: Removes data from a table.

SQL Functions
● SUM(): Returns the sum of a numeric column.
● AVG(): Returns the average value of a numeric column.
● COUNT(): Returns the number of rows that match a specified criteria.
● MIN(): Returns the smallest value of a selected column.
● MAX(): Returns the largest value of a selected column.

www.jkbosenotes.in

You might also like