Page 255 - Information_Practice_Fliipbook_Class11
P. 255

5.   Domain Constraint: Domain Constraint allows you to specify a set of values that a particular attribute may take.
                For example, attribute Gender has a domain constraint ensuring that it may take only two values, either M or F.
                Similarly, we may constraint  attribute Salary to  take values within a reasonable range of numbers, say, between
                8000 and 100000.

            9.3 Structured Query Language (SQL)

            Structured Query Language (SQL) is used to create and manipulate relational databases. It is a high-level interactive
            language that allows users to specify what is required to be done in the form of queries. Unlike other high-level
            languages, we do not need to specify how the SQL operations are implemented.  Thus, SQL becomes an easy to learn
            database language, so it is widely used. It efficiently manages large databases, provides fast responses to the queries
            operating on data and facilitates an authentication mechanism that ensures the security of data.
            SQL (Structured Query Language) offers a plethora of advantages that make it a fundamental and indispensable tool
            for working with relational databases. Its simplicity and efficiency in data retrieval, management, and analysis make
            it a top choice for businesses and developers alike. SQL excels at data retrieval, allowing users to formulate complex
            queries to extract specific information from vast datasets quickly. It facilitates effective data management by enabling
            the addition, modification, and deletion of records with ease while also enforcing data integrity through constraints,
            ensuring the accuracy and consistency of stored information.



                  SQL: Most popular language for creating and manipulating relational databases.


            Based on their functionality, SQL operations are organised in two categories, DDL (Data Definition Language) and DML
            (Data Manipulation Language), as described below:
            1.  Data Definition Language (DDL): Data Definition Language (DDL) is used for describing database structure. It
                is used to  create and delete databases and  tables. The attributes of already existing tables can also be added,
                deleted or modified using DDL statements, also DDL commands. Some of the examples of DDL statements are
                CREATE TABLE, ALTER TABLE, DROP TABLE, and TRUNCATE. In this chapter, we will discuss these in
                detail.



                  DDL: Used for defining database attributes, their types, and constraints on attribute values.


            2.  Data Manipulation Language (DML): DML is used to retrieve and modify data. It includes statements that enable
                us to store and retrieve information from database tables and modify the already stored data in the database. SQL
                statements such as INSERT, SELECT, DELETE, and UPDATE are used for this purpose.


                  DML: Used to retrieve and modify data.




                   SQL also facilitates the creation of views containing the results produced by an SQL statement. Such saved results can
                   be used later.



            9.4 Data Types

            Attributes of a table describe the data that will be stored in the table. The data type indicates the domain of values for an
            attribute. A data type may be of one of the several permissible types.



                                                                Database Concepts and the Structured Query Language  241
   250   251   252   253   254   255   256   257   258   259   260