0% found this document useful (0 votes)
24 views59 pages

Giyaz Ppts Dbms

Uploaded by

nallagattuchitti
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)
24 views59 pages

Giyaz Ppts Dbms

Uploaded by

nallagattuchitti
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/ 59

HISTORICAL PERSPECTIVE OF DBMS:

 From the earliest days of computer storing and manipulating data have been a
major application.

 Manipulating is the process of arranging data in order.

 1950s and early 1960s:


• Data processing using magnetic tapes for storage
• Tapes provide only sequential access
• Punched cards for input process.
• Data storage process consists of reading data from many tapes and writing data
to a new tape.

 Late 1960s and 1970s:


• Hard disks allow direct access to data
• Network and hierarchical data models in widespread use

 The first general purpose DBMS designed by ―Charles Bachman ‖at general
electric in 1960‘s was called ―Integrated Data Store‖.

 Charles Bachman is the first person to develop the IDS( Integrared Data
Store).which was based on network model.
 In the late 1960‘s IBM developed the ― Integrated Management Systems ―

 It was developed based on Hierarchical Data Model

 In 1970‘s the ― Relational Data Base model ― was developed by ― Edgar Codd ―
at IBM.

 Many of the data base models we use today are Relational based.

 In later 1980‘s IBM developed a language known as ― SQL ―

 SQL Stands for Structured Query Language.

 It was developed as a standard language for the queries by ISO and ANSI .

 ISO Stands for International Organization For Standardization.

 ANSI Stands for American National Standard Institute.


1980s:

 SQL becomes industry standard

 Parallel and distributed database systems

 Object-oriented database systems

1990s:

 Large decision support and data-mining applications

 Large multi-terabyte data warehouses

 Emergence of Web commerce

2000s:

 XML and XQuery standards

 Automated database administration


Purpose of Database Systems
 In the early days, database applications were built directly on top of file systems

 Drawbacks of using file systems to store data

• Multiple file formats, duplication of information in different files


Difficulty in accessing data

Need to write a new program to carry out each new task

 Data isolation — multiple files and formats

 Integrity problems

• Integrity constraints (e.g. account balance > 0) become ―buried‖ in

• Hard to add new constraints or change existing ones


 Atomicity problems , Data redundancy , Inconsistency , Data isolation.

Failures may leave database in an inconsistent state with partial updates


carried out

Example: Transfer of funds from one account to another should either complete
or not happen at all

 Security problems.

Database systems offer solutions to all the above problems.


File Systems:
 If you are using a computer , you are definitely using a file system

 File system comes with operating system

 File system is used to manage the data , dbms is also used to manage the data

 The main difference between these two are

 File systems are for short amount of data as well as Dbms will consists huge data

 File system : A collection of files which are stored in a hard disk

 File : A collection of records , where records contains fields, where field contains data

 For example : ENO ENAME SALARY


1 XYZ 10000 --------------RECORD1
2 ABC 20000 -------------RECORD2

 Fields are stored in directories.


Draw Backs of File Systems:
 Data Redundancy : The same data is duplicated at different locations.

 Data Inconsistency :Because of data redundancy , data inconsistency problem will occurs.
(no accurate data)

 Data Isolation : when data of a file cannot be mapped with the related data of other file

 Dependency on application program.

 Atomicity Issues : If the transaction involves two operations then we have to execute those
two operations at once in order to complete the transaction..

 Data security :
File system vs DBMS
FILE SYSTEM DBMS
 File system is a software that manages  DBMS is a software for managing the data
and organizes the files in a storage with in base
a computer
 There is no redundant data
 Redundant data can be present in a file
system
 It doesn't provide backup and recovery of  It provides backup and recovery of data if
data if it is lost it is lost
 There is no efficient query processing in a  Efficient query processing is there in DBMS
file system
 There is less data consistency in file
systems  There is more data consistency because of
the process of normalization
 It is less complex when compared to DBMS
 It has more complexity
 File system provides less security in
compared to DBMS  DBMS has more security Mechanisms

 It is less expensive than DBMS  It is higher cost than a file system.


Data Base Management System
Data : Raw facts that are recorded
example text , video , images.
Data base : Data base is a collection of related data . That represents some real
world entities or real world objects,that is if there is any change in a
real world entity then that changes should be reflected on database.
Data base is used to solve data base problems.

Data base management system:


 DBMS is a software which is used to manage the data base
 In DBMS data is stored in a centralized location.
 DBMS is a collection of interrelated data and set of program to access those data .
 Database systems are designed to manage large bodies of information
 Manipulating the database includes such functions has quering the database to retrieve the database
 Update the database to reflect changes in the real world.

 RDBMS : Relational Data Base Management System


Data will be stored in the form of tables or relations.
In RDBMS one table is related to another, that is why it is known as relational data base
management system
Applications of DataBase System
 Banking  Social media sites

 University and colleges  Credit card transactions

 Telecommunications  Military

 Finance  Railway reservation system

 Manufacturing  Library management system

 Online retailers

 Airline reservation system


Network…..client server
Rdbms…….
Concept…..dbms
Rdbms….model create table row column….row means tuple…record means tuple
Hierarichal……root
Constraints means rules
No duplication that is one type of constraint
Data conditions
Uniqueness is constraints
Advantages and disadvantages of DBMS
Advantages Of DBMS Disadvantages Of DBMS
 Memory size
 Minimized redundancy
 Cost
 Eliminating inconsistency
 Complexity
 Sharing of data
 Data loss
 Data security
 High impact of failure
 Backup and recovery
 Complexity of backup and recovery
DATA MODELS:
Data model: Data model is a collection of concepts to describe structure of a data base.

Data models are :

 Hierarchical data model


 Network data model
 Entity relation data model [E-R MODEL]
 Relational data model
 Object oriented data model

Hierarichal data model :

 it is a data model in which the data is organized in the form of TREE structure
 The structure represents information using parent – child relation ship
 Here each parent can have many children and child has only single parent.
 That is one to many relation ship

Advantages :

 It supports data sharing


 It provides data security
 Data independence
Disadvantages:

 complex implementation
 Difficult to manage
 Structured dependency
 It doesn‘t support many to many relationship

Network Data Model :

 In a network data model one parent can have several children and a child can have
many parent records.
 It follows GRAPH structure
 Network model is extension to hierarchical data model.

Advantages :

 The data can be accessed faster as compared to the hierarchical model.


 As there is a parent child relation ship so data integrity is present.
 Any change in parent record will reflected in the child record.

Disadvantages :

 As more and more relationships need to be handled the system might get complex
Entity relationship model:
It contains mainly three things
1.Entity
2.Attibutes
3.Relationships.
1.Entity :

 Any real world thing , any thing that has physical existence is called entity
Example : student , faculty,…

2.Attributes :

 Each attribute of a relation has a name


 The properties of entities are known as attributes.
 Ex: student is an entity.
Where student consists name ,roll no, marks these are known as attributes
 Ex : employee is an entity.
Emp no. Emp name , salary…………are the attributes

3.Reltionships:
 Relationship is manly use in order to connect two entities
1.one to one relationship 2. one to many relationship
3.many to one relationship 4.many to many relatioship
E-R Diagram for the Banking Enterprise
Features of ER Model:
 Graphical design for better understanding : It is very easy to understand so it can be
used by the developers
 Database design: This model helps the database designers to build the database
 ER Diagram :ER Diagram is used as a visual tool for representing the model.

Advantages of ER Model:

 ER Model is very easy to build.


 If we know the relationship between the attributes and entities we can easily build ER diagram
 Easy conversion to any model.
 This model can also be converted to any other model like network model, hierarchical model

Disadvantages of ER Model :

 Hidden Information: some information might be lost or hidden in ER Model.


Relational data model :

 Relational data model is the most widely used model.


 Relational model represents data as a collection of tables.
 All the information is stored in the form of rows and columns.
 So, the tables are also called relations in the relational model.
 Each row in the table is called ―TUPLE‖.
 Note that Attribute/Field/Column.., Tuple/Record/Row
 The features of relation models are TUPLES and ATTRIBUTES.

 STUDENT TABLE:----------RELATION NAME

ATTRIBUTES

ROLL NO NAME AGE PHONE NO.


10 MAHESH 20 1234567890
TUPLES
20 NARESH 19 1234567890
Advantages of Relational Model :

 Simple : This model is more simple as compared to the network and hierarchical model.

 Scalable : This model can be easily scaled as we can add as many rows and columns we want.

 Structural independence : we can make changes in database structure without changing


the way to access data.

Disadvantages of Relational model:

 For hiding the complexities and making things easier for the use this model requires more
powerful hardware computers and storage devices.
 As the relational model is very easy to design and use.

Object Oriented Data Model:

 In this model both the data and relationship are present in a single structure known as object.
 We can store audio ,video ,images ,etc in the database which is not possible in the Relational
model
 Although you can store audio and video in relational database , it is advised not to store in the
relational database.
 In this model, the attributes describe the properties of an object.
 Object that share similar characteristics are grouped in classes.
 Therefore, a class is a collection of similar objects model, two or more objects are
connected with the help of links.
 We use the link to relate objects.

For example:

EMPLOYEE DEPARTMENT
ATTRIBUTES ATTRIBUTES
NAME DEPT_ID
PHONE NO. DEPT_NAME
SALARY METHODS
DEPT_ID Change department
METHODS
Change number
 There are two data objects in the above example :

1.Employee
2.Department

 Each object data and relationship are contained in a single unit.


 The attributes are NAME,JOB.
 METHODS are used to perform the operation with the help of attributes.
 The two objects are connected through a common attribute DEPT_ID and communication
between these two will be done with the help of id.

Advantages:

 Semantic content is added


 Support for complex objects
 Inheritance promotes data integrity

Disadvantages :
 it is complex navigation system
 Slow development of standards
 High system overheads
 Slow transactions.
LEVELS OF ABSTRACTON :

 Data abstraction is the process of hiding unwanted or irrelevant details from the end user
 The database system consists of complicated data structures and relation.
 For users to access the data easily, these complications are kept hidden, and only the
relevant part of the database is made accessible to the users through the data abstraction.

 Mainly there are three level of abstraction of DBMS.

1.Physical (or) Internal level.


2.Logical (or) Conceptual level
3.View (or) External level

VIEW LEVEL
VIEW 1 ….
VIEW2 VIEW N

LOGICAL
LEVEL

PHYSICAL
LEVEL
Physical level:

 It is an lowest level of abstraction , that is for confidential and security purpose.


 Physical level tells us that how the data is stored
 This level is hidden by compiler from programmer.
 At this level the records can be described as block of storage (bytes,TB,GB).

Logical level:

 middle level describes what data is stored.


 Programmer works at this level.
 Data administrator use this level of abstraction to decide what information to keep
in a database.

View level :

 Highest level of abstraction.


 Describes only specific part of database
 At this level we have application programs which are accessed by user according to
data required.
Instances and Schemas :

Instances :

 The collection of information is stored in the database at a particular


movement is called an instance of the database.

(OR)
 The content of the database at a given point of time
 It is a dynamic value which keeps on changing.
ROLL NO NAME MARKS
 For ex: student table.
100 RAJU 90
101 RAMESH 85
102 MAHESH 95

This table contains 3 row i.e. instance of the table or instance of database
Schema :

 The overall design of the database is called the database schema.


 It is the logical structure of database.
 Schema will not be changed frequently.

 For ex: student table


in student table roll no, name , college is a structure and here it is known as schema.

 It is divided into three categories:

1.physical schema (Internal schema)


2. logical schema (conceptual schema)
3. view schema (External schema).

Database systems have several schemas, according to the level of abstraction.


 The physical schema describes the database design at the physical level
 The logical schema describes the database design at the logical level.
 A database may also have several schemas at the view level. some times
called subschemas, that describes different views of the database.
Data Independence:

 If we change data or data structure in the database it will not modify the user
level instructions.(or) the ability to change the schema at one level without
changing the schema at another level is known as data independence.

Types of data independence:


1.physical data independence
2. logical data independence.

Physical data independence :

 If we change the data in the database these changes will not reflect above
levels of logical and view level

Logical data independence :

 If we changes the description of data , data semantics, constraints and these


changes will not propagated to above and the below levels.
Structure of Database management system
 Database management system is a software that allows to access the data stored in a
Database and provides an easy and effective methods of :

 Defining the information


 Storing the information
 Manipulating the information
 Protecting the information from system crashes and thefts.
 Differentiating access permissions for different users.

 Note That: structure of Database management system is also referred as overall system structure
or Database Architecture but is different from the Tier Architecture of Database.

 The database system is divided into three components:

1.Query Processer
2. Storage Manager
3.Disk Storage
ER DIAGRAMS
 The entity relationship diagram explains the relationship among the entities present in the
Database.
 ER models are used to model real world objects like a person, a car, a company, and the
relation between these real world objects.
 ER diagrams are used to represent the E-R model in a database, which make them easy to
Convert into relations(Tables).
 ER diagrams require no technical knowledge and no hardware support
 These diagrams are very easy to understand and easy to create even for a naïve user.

Symbols used in ER Model:


 ER Model is used to , model the logical view of the system from a data perspective which
consists of these symbols.

 Rectangles : rectangles represent Entities in ER Model


 Ellipses : Ellipses represent Attributes in ER model
 Diamond : Diamonds represent Relationships among Entities.
 Lines : Lines represent Attributes to entities and Entity sets with other relationship types.
 Double Ellipse : Double Ellipses represent Multi-Valued Attributes.
 Double Rectangle : Double Rectangle represents a WEAK Entity.
FIGURES SYMBOLS REPRESENTS

RECTANGLE Entities in ER Model

Attributes in ER Model
ELLIPSE
Relationship Among
DIAMOND Attributes

LINES Attributes to Entities


and Entity sets with
other relationship types
DOUBLE ELLIPSE Multi-Valued Attributes

DOUBLE RECTANGLE Weak Entity

Symbols used in ER Model


Components of ER Diagram :

 ER Model consists of Entities , Attributes and Relationships among Entities in a


Data base System.

ER MODEL:

1.Entity.

 Strong Entity
 Weak Entity

2. Attributes.

 Key Attributes
 Composite Attributes
 Multivalued Attributes
 Derived Attributes
 Simple Attribute.
 Single Valued Attributes.
Relationship:

 One to One
 One to Many
 Many to One
 Many to Many

Entity :
An Entity may be an object with a physical existence – a particular person, car, house, or employee – or it may
be an object with a conceptual existence – a company, a job, or a university course.
Entity Set:
An Entity is an object of Entity Type and a set of all entities is called an entity set.
For Example, E1 is an entity having Entity Type Student and the set of all students is called Entity Set.
In ER diagram.
Entity Type is represented as:
1.Strong Entity:

 A Strong Entity is a type of entity that has a key Attribute.


 Strong Entity does not depend on other Entity in the Schema.
 It has a primary key, that helps in identifying it uniquely, and it is represented by a rectangle.
 These are called Strong Entity Types.

2. Weak Entity :

 An Entity type has a key attribute that uniquely identifies each entity in the entity set.
 But some entity type exists for which key attributes can‘t be defined.
 These are called Weak Entity types.

For Example:

 A company may store the information of dependents (Parents, Children, Spouse) of an Employee.
But the dependents don‘t have existed without the employee.

 So Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for Dependent,
which means it is Strong Entity Type.
 A weak entity type is represented by a Double Rectangle.
 The participation of weak entity types is always total.
 The relationship between the weak entity type and its identifying strong entity type is called
identifying relationship and it is represented by a double diamond.

Strong Entity and Weak Entity

Attributes:
 Attributes are the properties that define the entity type.
For example, RollNo, Name, DOB, Age, Address, and MobileNo are the attributes that define entity type Student.
 In ER diagram, the attribute is represented by an oval.
1. Key Attribute :

 The attribute which uniquely identifies each entity in the entity set is called the key attribute.
 For example, Roll_No will be unique for each student.
 In ER diagram, the key attribute is represented by an oval with underlying lines.

2. Composite Attribute :

 An attribute composed of many other attributes is called a composite attribute.


 For example, the Address attribute of the student Entity type consists of Street, City, State, and Country.
 In ER diagram, the composite attribute is represented by an oval comprising of ovals.
3. Multivalued Attribute:

 An attribute consisting of more than one value for a given entity.


 For example, PhoneNo (can be more than one for a given student).
 In ER diagram, a multivalued attribute is represented by a double oval.
4. Derived Attribute :

 An attribute that can be derived from other attributes of the entity type is known
as a derived attribute. e.g.; Age (can be derived from DOB).
 In ER diagram, the derived attribute is represented by a dashed oval.

The Complete Entity Type Student with its Attributes can be represented as:
Relationship Type and Relationship Set :

 A Relationship Type represents the association between entity types.


 For example, ‗Enrolled in‘ is a relationship type that exists between entity type Student and Course.
 In ER diagram, the relationship type is represented by a diamond and connecting the entities with lines.

 A set of relationships of the same type is known as a relationship set.


 The following relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as
registered in C3.

Relationship Set
Degree of a Relationship Set :
The number of different entity sets participating in a relationship set is called the degree of a relationship set.

1. Unary Relationship:
 When there is only ONE entity set participating in a relation,
the relationship is called a unary relationship.
 For example, one person is married to only one person.

2. Binary Relationship:
 When there are TWO entities set participating in a relationship, the relationship is called a
binary relationship.
 For example, a Student is enrolled in a Course.
1. One-to-One:
 When each entity in each entity set can take part only once in the relationship, the cardinality is one-to-one.
 Let us assume that a male can marry one female and a female can marry one male.
 So the relationship will be one-to-one.
 the total number of tables that can be used in this is 2.

 Using Sets, it can be represented as :


2. One-to-Many:

 In one-to-many mapping as well where each entity can be related to more than
one relationship and the total number of tables that can be used in this is 2.

Using sets, one-to-many cardinality can be represented as:


3. Many-to-One:

 When entities in one entity set can take part only once in the relationship set and entities in other
entity sets can take part more than once in the relationship set, cardinality is many to one.
 Let us assume that a student can take only one course but one course can be taken by many
students.
 It means that for one course there can be n students but for one student, there will be only one
course.

Using Sets, it can be represented as:


 In this case, each student is taking only 1 course but 1 course has been taken by many students
4. Many-to-Many:
 When entities in all entity sets can take part more than
once in the relationship cardinality is many to many.
 Let us assume that a student can take more than one course and one course can be taken
by many students.
 So the relationship will be many to many.

Using Sets, it can be represented as:


In this example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3, and S4.
So it is many-to-many relationships.
Generalization, Specialization and Aggregation in ER Model:

 Generalization, Specialization, and Aggregation in ER model are used for data abstraction.
 in which an abstraction mechanism is used to hide details of a set of objects.
 Some of the terms were added to the Enhanced ER Model,
 where some new concepts were added.

 These new concepts are:

1.Generalization:

 Generalization is the process of extracting common properties from a set of entities and
creating a generalized entity from it.
 It is a bottom-up approach in which two or more entities can be generalized to a higher-level entity
if they have some attributes in common.
 For Example, STUDENT and FACULTY can be generalized to a higher-level entity called PERSON as shown in Figure
In this case, common attributes like P_NAME, and P_ADD become part of a higher ENTITY (PERSON),
and specialized ATTRIBUTES like S_FEE become part of a specialized entity (STUDENT).
Generalization
Specialization:
 In specialization, an entity is divided into sub-entities based on its characteristics.
 It is a top-down approach where the higher-level entity is specialized into two or more lower-
level entities.
 For Example, an EMPLOYEE entity in an Employee management system can be specialized into
DEVELOPER, TESTER, etc. as shown in Figure 2.
 In this case, common attributes like E_NAME, E_SAL, etc. become part of a higher entity
(EMPLOYEE), and specialized attributes like TES_TYPE become part of a specialized entity
(TESTER).
Aggregation:
 An ER diagram is not capable of representing the relationship between an
entity and a relationship which may be required in some scenarios.

 In those cases, a relationship with its corresponding entities is aggregated into


a higher-level entity.

 Aggregation is an abstraction through which we can represent relationships as


higher-level entity sets.

 For Example, an Employee working on a project may require some machinery.

 So, REQUIRE relationship is needed between the relationship WORKS_FOR and


entity MACHINERY.

 Using aggregation, WORKS_FOR relationship with its entities EMPLOYEE and


PROJECT is aggregated into a single entity and relationship REQUIRE is created
between the aggregated entity and MACHINERY.
Frequently Asked Questions :

1. What are Generalization, Specialization, and Aggregation in ER Model?

Generalization is the higher level of understanding of data from lower levels of data whereas
Specialization is the process of defining one or more entities from present entities and Aggregation is the
process of combining two or more entities.

2. What is the purpose of the Generalization?

Generalization is simply gathering the common properties from entities and creating a generalized
concept from those extracted data. Generalization helps in improving the flexibility, and reusability of
the database.

3. Why is generalization important in the database?

Generalization is important in the database because it helps to gather important information so that it
becomes easier and faster for the user the analysis of data and it also helps in making decisions faster.
ORACLE :
 In database management system the user can interact with the database system
by using database language
 Here we are using oracle in that the mainly used components are
 SQL (Structured Query Language)
 PL/SQL (Procedural language / SQL Commands )
 SQL comprises mainly three languages :

 DDL (Data Definition Language )


 DML (Data Manipulation Language )
 DCL (Data Control Language )

DDL : DDL is used to define the data in the database


There are 5 commands in DDL
i. CREATE
ii. RENAME
iii. ALTER
iv. TRUNCATE
v. DROP
Rename :
SQL>rename employee to employee2;
TABLE CREATED
SQL>select * from emp2;
ALTER:
SQL>alter table tablename add columnname datatype;
SQL>alter table employee2 add employeeaddress varchar(20);
TABLE CREATED
TRUNCATE:
Truncate table tablename;
SQL>truncate table employee2;
TABLE TRUNCATED.
DROP:
DML :
It is used to manipulate the database table.

There are three commands :


1. INSERT
2. UPDATE
3. DELETE
4. SELECT
DCL :
DCL is used to provide the security to the database table along with the data

There are two commands :


1. GRANT (giving permission)
2. REVOKE (reject the permission )
Data types in SQL :
1.Number ----- for numeric data
2.Char --------- for fixed length character
3. Varchar ------ for variable length character
4. Date -------- for displaying date format in ―DD-MM-YY‖.
CREATE SYNTAX :

EXAMPLES:

Create table tablename


(<col1name><datatype1><size>,<column2name><datatype2><size>…………….);

SQL>Create table employee(eno number(4),ename char(20), salary number(5), comm number(4));


Table created

Note : To see the structure of database table ―desc‖ command is used.[desc---describe]

Describe syntax :
Describe<tablename>

SQL> desc employee;


INSERT:
Insert command is used to add the record in to a database table

Syntax:
SQL>insert into <tablename>values (<col1 value>,<col2 value>,<col3 value>…);

EXAMPLE:

SQL>insert into employee values(20,‘RAJU‘ , 1000,2000,3000);


1 row created
NOTE : by using insert command we can add no.of multiple records at the same time.

Syntax:
Insert into <tablename>values(<&col1>,<&col2>,<&col3>);

EXAMPLE:

SQL>insert into employee values (&eno,&ename,&salary,&dno,&comm);


1 row created.
ALTER SYNTAX:

Alter table tablename add columnname datatype:

SQL>Alter table college add collegeaddress varchar(30);


Table altered
SQL>desc college;……………..[desc for checking]

TRUNCATE SYNTAX :

Note: that using truncate only table record will be deleted, not a table.

Truncate table tablename;

SQL>truncate table college;


table truncated
SQL>desc college;
User creation :

Syntax: SQL>create user <name>identified by<password>;

 SQL>create user ramu identified by Ramesh;


user created.
 Grant connect,resource to ramu;
grant succeeded.
 SQL>connect ramu
Enter password :Ramesh
connected.

UPDATE command: it is used to update the data


Syntax: update <table name> set <colname> = <update> where <colname>=<reference date>;

Example:
SQL>select * from employee;
NAME ADDRESS
rahal Khammam
Kiran hyderabad

SQL>update employee set name=‗Rahul‘ where address=‗Khammam‘‘


SQL>select * from employee;
DELETE Command:
Syntax: 1.delete from <tablename>

2.delete from <table name> where conditional _statement;

Example:
SQL>select * from employee;

NAME ADDRESS
rahul Khammam
Kiran Hyderabad

SQL>delete from employee;

SQL>select * from employee;


2 rows deleted.

SQL>delete from employee where name=Rahul;


1 row deleted.
DROP SYNTAX:

Drop is used delete the table as well as records permanenetly.


Drop table tablename;
SQL>Drop table college;
SQL>desc college;
object college doesnot exist.

SELECT COMMAND:
It is used to retrieve the data from the database table

Syntax :select<col name>,<col name>,<col name>,


from<table name> where <condition>;
There are 3 clouses: 1.select
2.from
3.where
 ―Select‖ clouse is used to retrieve the use specified column names from the given database table
 ―from‖clouse is used to retrieve data from a database table which are given in the query
 ―where‖ clouse is used to specify the condition which is given in the query

You might also like