0% found this document useful (0 votes)
3 views14 pages

SQL Database Concepts and Implementation

Contains detailed notes for lesson 7 class 12

Uploaded by

chrisbinay.b
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)
3 views14 pages

SQL Database Concepts and Implementation

Contains detailed notes for lesson 7 class 12

Uploaded by

chrisbinay.b
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

1

Lesson – 7
Relational Database & SQL
• DATABASE CONCEPTS
• RELATIONAL DATABASE MODEL
• STRUCTURED QUERY LANGUAGE

Learning Objective : To understand & implement Database in SQL.


SYLLABUS 2

• Database concepts: introduction to database concepts and its need


• Relational data model: relation, attribute, tuple, domain, degree, cardinality,
keys (candidate key, primary key, alternate key, foreign key)
• Structured Query Language:
• Introduction, Data Definition Language and Data Manipulation Language,
• Data type (char(n), varchar(n), int, float, date),
• Constraints (not null, unique, primary key),
• create database, use database, show databases, drop database,
• show tables, create table, describe table, alter table (add & remove - an attribute, primary key), drop table,
• insert, delete, select, operators (mathematical, relational and logical), aliasing,
• distinct clause, where clause, in, between, order by,
• meaning of null, is null, is not null, like,
• update command, delete command,
• aggregate functions (max, min, avg, sum, count), group by, having clause,
• Joins: Cartesian product on two tables, equi-join and natural join

Learning Objective : To understand & implement Database in SQL.


3

Monday, 10.03.2025
DATABASE
• Database Concepts
• Introduction & Need for Database
• Relational Database Model
• Concept of domain, relation, tuple, attribute, degree, cardinality
• Key - primary key, candidate key, alternate key & foreign key

Learning Objective : To understand & implement Database in SQL. in SQL ; Interface Python with SQL.
4

Today we will discuss…..

• What is a Database?
• Why do we need a Database?
• What are the Types of Databases?
• What do you mean by Relational Database?
• Steps to install MySQL

Learning Objective : To understand & implement Database in SQL.


5

DATA – INFORMATION - DATABASE


• Data
• Raw facts and figures
• Information
• Processed Data
• Database
• Collection of related information.
• A logically organized collection of data (information) about an entity.
• Database is integrated as well as shared.
• Databases are persistent. ( Even if an application using the dB has terminated, it will be available for other applications)
• All files belonging to one organization will be treated as the database of that organization, School Database
• Some components of dB are : files, tables, records, fields

Learning Objective : To understand & implement Database in SQL.


6

DATABASE MANAGEMENT SYSTEM (DBMS)


• DBMS (Database Management System)
• A computer program designated to manage a database.
• It enables you to store, modify and extract information from a database.
• Eg:- ORACLE, SyBASE, SQL

Learning Objective : To understand & implement Database in SQL.


7
Need for a
Database
ADVANTAGES OF DATABASE
• Eliminates data redundancy ( Duplication of data is avoided)
• Provides data consistency (By Propagating Updates – the changes made to data are reflected automatically)
• Sharing of Data (same data may be shared among users for different purposes)
• Improves data integrity (By range checks , value matching to(Emp ID) , formats(Date))
• Enables privacy and security (ensured by access authorization checks)
• Improved backup and recovery system
• Enforces standardised database (Company / Industry/ National / International Standards are to be followed;
Standardization enables Data Migration)

Learning Objective : To understand & implement Database in SQL.


COMPONENTS OF A DATABASE
Any person who can Manages the database and
access the database is seeks to meet the needs of
called Database user the database users.

Processes executed by Collection of


the computer. related
information
DATA MODELS
Hierarchical data model Network data model Relational data model

This model uses a tree like structure to A network database is a collection of Data is stored in the form of tables in
represent relationship among nodes and links, such that any node which rows are instances and columns
records. can be linked to any other node as fields.
multiple times.
10

RELATIONAL DATABASE
• RELATIONAL DATABASE .
• A relational model consists of a collection of tables, each of which is assigned a unique
name, i.e., it represents the database as a collection of relations or tables
• The most popular data model as it is scientific and stable model than hierarchical or network
model.
• In this model, data is organized in two-dimensional tables called relations. The tables or
relations are related to each other.
• A relational database is based on this relational model developed by E.F. Codd.
• In this type of database, the data and relations between them are organized into tables, having
logically related records containing the same fields. The contents of a table or relation can be
permanently saved for future use. Thus, this model is simple and has all the properties and
capabilities required to process data with storage efficiency.

Learning Objective : To understand concept of Database


RELATIONAL DATA MODEL
• Domain : A pool of values from which actual value present in a given column are taken.
• Relation : A table having rows and columns.

• Attributes : Columns of a relation.


• Tuples : Rows of a relation.

• Degree : No of attributes(columns) in a table.


• Cardinality : No of tuples (rows) in a table.
• View : A (virtual) table that does not really exist , but is derived from one or more underlying
base tables.
• Primary Key : An attribute or a group of attributes which are used to distinguish records in a
relation.
13

• Columns (Attribute) : Degree CAD


• Rows (Tuples) : Cardinality RTC

Learning Objective : To understand & implement Database in SQL.


Relation : Student

Rollno Name Class Section Gender Address


14 Rohan 12 D M Dubai
45 Arpita 11 A F Sharjah
23 Kush 12 G M Dubai

What is the degree of this table? Degree – 6

Cardinality - 3
What is the cardinality of this table?

You might also like