Cs Notes Database Concepts Class12
Cs Notes Database Concepts Class12
Relations: In relational data model, the data is organised into tables(in the form of rows and
columns) called relations.
Domain: A domain is the sets of values from which the actual values appearing in a given
column are drawn.
Primary Key: A column or set of columns that uniquely identifies a row within a table is
called primary key.
Candidate Key: Candidate keys are set of fields (columns with unique values) in the relation
that are eligible to act as a primary key.
Alternate Key: A candidate key that is not the primary key is called alternate key.
Date: DATE
Selection: Selection in relational algebra returns those tuples (records) in a relation that
fulfil a condition (Produce table containing subset of rows).
Projection: Projection in relational algebra returns those columns in a relation that given in
the attribute list (Produce table containing subset of columns).
Cartesian product: SQL joins are used to relate information in different tables. Cartesian
product returns a number of rows equal to number of rows in the first table multiply by
number of rows in the second table. At the same time, number of columns equal to number
of columns in the first table added by number of columns in the second table.
SELECT: The SELECT statement is used to select and display data from a database.
SELECT column1, column2, ... FROM table_name;
SELECT * FROM table_name;
SELECT column1, column2, ... FROM table_name WHERE condition;
DISTINCT: Distinct keyword eliminates duplicate rows from the result of a select statement.
SELECT DISTINCT column1, column2, ... FROM table_name;