please answer properly.....
Answers
→CREATE :
•Creating table or defining the structure of a table.
create table one
{id int not null,
name char(25)}
Here, we created a table whose name is one and its columns are ID, NAME and the id is of not null type i.e, we can’t put null values in the ID column but we can put null values in the NAME column.
Example to demonstrate DESC:
Step 1: Defining structure of table i.e, Creating a table:
create table one
( id int not null,
name char(25),
city varchar2(25))
→UPDATE:
•The UPDATE statement in SQL is used to update the data of an existing table in database. We can update single columns as well as multiple columns using UPDATE statement as per our requirement.
Basic Syntax
UPDATE table_name SET column1 = value1, column2 = value2,...
WHERE condition;
table_name: name of the table
column1: name of first , second, third column....
value1: new value for first, second, third column....
condition: condition to select the rows for which the
values of columns needs to be updated.
NOTE: In the above query the SET statement is used to set new values to the particular column and the WHERE clause is used to select the rows for which the columns are needed to be updated. If we have not used the WHERE clause then the columns in all the rows will be updated. So the WHERE clause is used to choose the particular rows.
→INSERT :
•The INSERT INTO statement of SQL is used to insert a new row in a table. There are two ways of using INSERT INTO statement for inserting rows:
Only values: First method is to specify only the value of data to be inserted without the column names.
Syntax:
INSERT INTO table_name VALUES (value1, value2, value3,...);
table_name: name of the table.
value1, value2,.. : value of first column, second column,... for the new record
Column names and values both: In the second method we will specify both the columns which we want to fill and their corresponding values as shown below:
Syntax:
INSERT INTO table_name (column1, column2, column3,..) VALUES ( value1, value2, value3,..);
table_name: name of the table.
column1: name of first column, second column ...
value1, value2, value3 : value of first column, second column,... for the new record ).
→DELETE:
•The DELETE Statement in SQL is used to delete existing records from a table. We can delete a single record or multiple records depending on the condition we specify in the WHERE clause.
Basic Syntax:
DELETE FROM table_name WHERE some_condition;
table_name: name of the table
some_condition: condition to choose particular record.
Note: We can delete single as well as multiple records depending on the condition we provide in WHERE clause. If we omit the WHERE clause then all of the records will be deleted and the table will be empty.