-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab5.txt
94 lines (59 loc) · 2.17 KB
/
lab5.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
SQL> create table customer(id int,name varchar(10),age int,home_town varchar(10)
,salary int);
Table created.
SQL> insert into customer values(1,'Ramesh',32,'Ahmedabad',2000);
1 row created.
SQL> insert into customer values(2,'Khilan',25,'Delhi',1500);
1 row created.
SQL> insert into customer values(3,'Kaushik',23,'Kota',2000);
1 row created.
SQL> insert into customer values(4,'Chaitali',25,'Mumbai',6500);
1 row created.
SQL> insert into customer values(5,'Hardik',27,'Bhopal',8500);
1 row created.
SQL> insert into customer values(6,'Komal',22,'MP',4500);
1 row created.
SQL> insert into customer values(7,'Muffy',24,'Indore',10000);
1 row created.
SQL> insert into customer values(8,'Ramu',23,'Delhi',6000);
1 row created.
SQL> insert into customer values(9,'Rohit',24,'Ahmedabad',5000);
1 row created.
SQL> insert into customer values(10,'Shamil',23,'Mumbai',10000);
1 row created.
SQL> update customer set id=4 where name='Chaitali';
1 row updated.
SQL> select * from customer;
ID NAME AGE HOME_TOWN SALARY
---------- ---------- ---------- ---------- ----------
1 Ramesh 32 Ahmedabad 2000
2 Khilan 25 Delhi 1500
3 Kaushik 23 Kota 2000
4 Chaitali 25 Mumbai 6500
5 Hardik 27 Bhopal 8500
6 Komal 22 MP 4500
7 Muffy 24 Indore 10000
8 Ramu 23 Delhi 6000
9 Rohit 24 Ahmedabad 5000
10 Shamil 23 Mumbai 10000
10 rows selected.
SQL> select * from customer where id=4;
ID NAME AGE HOME_TOWN SALARY
---------- ---------- ---------- ---------- ----------
4 Chaitali 25 Mumbai 6500
SQL> select distinct(home_town) from customer;
HOME_TOWN
----------
Bhopal
Ahmedabad
Delhi
Kota
Mumbai
MP
Indore
7 rows selected.
SQL> select count(salary) from customer;
COUNT(SALARY)
-------------
10
SQL>