Relational Database
Relational Database
net/sql-server-administration/sql-server-system-
databases/
Relational Database
Each table contains data that describes exactly one entity.Because data about
different entities is stored in different tables, you may need to combine 2 or more
tables to answer a particular question.With an RDBMS you can relate the data in one
table to the data in another by using the foreign keys.A foreign key is a column or
a set of columns that refer to a primary key in the same table or another table.
A relational database can contain one or many tables.A table is the basic storage
structure of an RDBMS.
A foreign key is a column that defines how tables relate to each other.A foreign
key refers to a primary key or a unique key in the same table or in another table.
SQL Statements
Data retrieval
INSERT :- Enters new rows,changes existing rows, and removes unwanted rows from
tables in the database.Collectively known as data manipulation language (DML)
UPDATE
DELETE
MERGE
CREATE :- Sets up, changes, and removes data structures from tables.Collectively
known as data definition language (DDL)
ALTER
DROP
RENAME
TRUNCATE
COMMIT :- Manages the changes made by DML statements.Changes to the data can be
grouped together into logical transactions.
ROLLBACK
SAVEPOINT Transaction control
GRANT :- Gives or removes access rights to both the Oracle database and the
structures within it.Collectively known as data control language (DCL)
REVOKE
To extract data from the db, you need to use SQL SELECT statement.
Projection:- You can use the projection capability in SQL to choose the columns in
a table that you want returned by your query.
You can choose as few or as many columns of the table as you require.
Selection:- You can use the selection capability in SQL to choose the rows in a
table that you want returned by a query.
You can use various criteria to restrict the rows that you see.
Joining:- You can use the join capability in SQL to bring together data that is
stored in different tables by creating a link between them.
SELECT Statement
Keywords typically are entered in uppercase; all other words, such as table names
and columns, are entered in lowercase.