You are on page 1of 186

9.

Structured Query Language

SQL Command Essential Purpose of the command


Keyword(s)
CREATE TABLE To create tables
ALTER TABLE ADD /MODIFY To change the structure of tables
DDL

DROP TABLE
CREATE VIEW
DROP VIEW
INSERT
SELECT
DML

UPDATE
DELETE
Table 9.8: Summary of SQL command

Let us conclude
Structured Query Language is used to operate on relational database. MySQL is a
popular RDBMS package by which we can implement SQL commands. We have
used various DDL commands to perform operations related with the structure of
database. Constraints have been presented to ensure data validity and integrity in
database. We have also discussed different DML commands to perform operations
associated with the data contained in tables of a database. These operations include
insertion, retrieval, modification and deletion of data in tables. We have also
familiarized ourselves with nested queries and the concept of views. A good
understanding of this chapter is essential for your higher studies in the field of
computers.

Let us practice

1. The structure of a table is given to store the details of marks scored by students
in an examination.
Data Type Description
Register number Numeric A unique and essential data to identify a
student
Name String A maximum of 30 characters
Course String It can be Science, Commerce or
Humanities
Marks of six subjects Numeric each Six separate columns are required

307

You might also like