Dbms Unit III
Dbms Unit III
Dbms Unit III
Part-A
Basics of SQL:
SQL, pronounced "sequel" (or S-Q-L, if you prefer) is a
standard language for accessing and manipulating
databases.
What is SQL?
• SQL stands for Structured Query Language
• SQL lets you access and manipulate databases
• SQL became a standard of the American National
Standards Institute (ANSI) in 1986, and of the
International Organization for Standardization (ISO) in
1987.
Applications of SQL:
• SQL can execute queries against a database
• SQL can retrieve data from a database
• SQL can insert records in a database
• SQL can update records in a database
• SQL can delete records from a database
• SQL can create new databases
• SQL can create new tables in a database
• SQL can create stored procedures in a database
• SQL can create views in a database
• SQL can set permissions on tables, procedures, and views
DDL
• Data Definition Language (DDL) statements are used to define the database structure
or schema. Data Definition Language describes how the data should exist in the
database, therefore language statements like CREATE TABLE or ALTER TABLE
belong to the DDL. DDL is about "metadata".
• DDL includes commands such as CREATE, ALTER, and DROP statements.DDL are
used to CREATE, ALTER, OR DROP the database objects (Table, Views, Users).
• UNIQUE - Ensures that all values in a column are different. i.e. for a
particular column, all the rows should have unique values. We can have
more than one UNIQUE columns in a table.
CREATE TABLE Student ( ID int(6) NOT NULL UNIQUE, NAME
varchar(10), ADDRESS varchar(20) );