The CREATE TABLE Statement Is Used To Create A Table in A Database
The CREATE TABLE Statement Is Used To Create A Table in A Database
The CREATE TABLE Statement Is Used To Create A Table in A Database
Table Created
Table created.
OUTPUT:-
1 Row Created.
1 Row Created.
1 Row Created.
1 Row Created.
OUTPUT:-
2|Page
2) Inserting data into table using another table
OUTPUT:-
Table altered.
OUTPUT:-
3|Page
2) Dropping a column of table
Table altered.
OUTPUT:-
3) Renaming a table
Table altered.
OUTPUT:-
4|Page
4) Deleting row from table
1 row deleted.
OUTPUT:-
SQL>desc org;
5|Page
OUTPUT:-
6) Deleting a table
SQL>drop company;
Table Dropped.
OUTPUT:-
Table altered.
6|Page
OUTPUT:-
7|Page
PROGRAM 4: UPDATING DATA VALUES IN A TABLE
1 row updated.
1 row updated.
1 row updated.
OUTPUT:-
8|Page
Syntax: update tablename set columname=value where columname=datavalue;
1 row updated.
OUTPUT:-
OUTPUT:-
9|Page
Syntax: select columnname from tablename;
OUTPUT:-
OUTPUT:-
10 | P a g e
Syntax: select DISTINCT * from tablename;
OUTPUT:-
OUTPUT:-
11 | P a g e
OUTPUT:-
a) Like Operator
The LIKE operator is used in a WHERE clause to search for a specified pattern in a
column.
OUTPUT:-
12 | P a g e
b) IN Operator
OUTPUT:-
c) BETWEEN operator
The BETWEEN operator is used in a WHERE clause to select a range of data between
two values.
Syntax: select * from tablename where columnname inbetween value1 and value2;
SQL> select * from org where salary between 10000 and 10001;
OUTPUT:-
OUTPUT:-
e) Concatenation Operator
OUTPUT:-
14 | P a g e
8) Joins in SQL
OUTPUT:-
15 | P a g e
b) Cartesian join
OUTPUT:-
16 | P a g e
c) Outer Join
OUTPUT:-
d) Self Join
OUTPUT:-
17 | P a g e