0% found this document useful (0 votes)
12 views1 page

SQL1

The document discusses databases and SQL. It defines key database concepts like tables, tuples, attributes, degrees, and cardinality. It also covers different types of keys in databases like primary keys, candidate keys, alternate keys, and foreign keys. An example table is provided to illustrate these key types. SQL is introduced as the standard language for querying and managing data in relational database management systems (RDBMS). SQL is divided into sublanguages for defining schema (DDL), manipulating data (DML), and querying data (DQL).

Uploaded by

blestrbhakt
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)
12 views1 page

SQL1

The document discusses databases and SQL. It defines key database concepts like tables, tuples, attributes, degrees, and cardinality. It also covers different types of keys in databases like primary keys, candidate keys, alternate keys, and foreign keys. An example table is provided to illustrate these key types. SQL is introduced as the standard language for querying and managing data in relational database management systems (RDBMS). SQL is divided into sublanguages for defining schema (DDL), manipulating data (DML), and querying data (DQL).

Uploaded by

blestrbhakt
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/ 1

Chapter - 6 & 7 Database and SQL

CJ Important Points :

Database: Co llection of logical units/ inter•related data such as 'table', 'index' etc.
Tnble : Co llection of Records & Fields.

Tuples: Rows ofn relntion (table) are known as Tuples.


Attribules : Columns of a Relation arc known as Attributes.
► Dcg,·ce : Number of Co lumns in a Relation.
► Cardinality : Number of Rows/Tuples in a Relation.
► A 11 the Databases c orne un d er Generation
. IV Language.
□ Keys:

Key is a Column. Types of Keys are :


( i) p rimary Key : It is a key which is ' unique' and 'not null'.
It is used to set relation among the
tables.
'Unique' : Cannot be duplicated 'Not Null' : Cannot be Empty
(ii) Candidate Key : Those keys which are 'candidate' to become a Primary Key are 'Candidate
keys'.

(iii) Alternate Key : It is a Candidate Key which is not a Primary Key .


(iv) Foreign Key : It is a key in another table which is having same data-type and size as that of
Primary Key in the Main or First table.

✓ TJ,e name of the Foreign Key can be different from the Primary Key.

Example:
Table Class II

Admn No. Roll No. Name Marks


1011 I Rahat 85
1083 2 lrfan 75
2011 3 Maya 63
1000 4 Sham 60
999 5 Zoya 92

In the above table, columns admn. No. and Roll no. have unique value . for each row, ·so both are
candidates to become Primary key hence ~oth of these columns are candidate keys. Out of these 2 we
can assign one as Primary key and other will become alternate key

Candidate keys : Admn No, Roll Nol


Primary Key : Roll No.
Alternate Key: Admn No.

► SQL: Structured Query Language:


. . ll DBMS and RDBMS. It is furthered divided into certain categories:
This language 1s for a
• DDL: Data Definition Language

DML : Data Manipulation Language



• DQL: Data Query Language

You might also like