Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
One of the mast powerful features of the SQL SELECT COMMAND is known as a sub query or nested query. This feature enables as to ask complex questions that initial retrieving different types of data from different sources. SQL is also more than a query language. It can be used to create the entire database. SQL also has powerful commands to alter the data. Two key points will help we learn hew to use sub queries. i) SQL was design to work with sets of data avoid thinking in terms of individual rows. ii) We can start nested queries into their separate parts & deal with the part individually. Sub query with ANY & ALL. The ANY & ALL operators combine comparison of numbers with subsets. In the preceding section, the IN operator compared a value to a list of items in a set - however, the comparison was based on equality. The test item had to exactly match an entity in the list. The ANY & all operators work with less than (<) or greater than (>) & compare the test value to a list of values.
c) ALTER:
The DDL ALTER command can be used for the following changes to any table. i) To add new column. ii) To add new integrity constraints. iii) To modify existing columns. To expand length.
To change default. To decrease length but all values in the column must be null. To change data type but all values in the column must be null.
v) UPDATE COMMAND:To UPDATE rows in the table, we use update command as follows. Syntax 1: UPDATE <table-Name> SET <field-Name >=value Syntax 2: UPDATE <table name> SET<field name>=value; WHERE <FIELD Name>=value;