CT10 - Practical - Up To 17th March
CT10 - Practical - Up To 17th March
Create Command----
create table abcd ( eid number (7), empname varchar2(30), ecity varchar2(30) );
describe CT10Info;
10-03-2022
Insert Commands-- insert the rows/data into table.
insert into ct10info values (101, 'Yusuf', 9787878787, 80000, 'Pune', 'Bcom');
*= All rows/data/records
Yusuf
yusuf
YUSUF
YusuF
All above names are different as table data will be case sentsitive.
12-03- 2022
insert into ct10info values (101, 'Yusuf', 9787878787, 80000, 'Pune', 'Bcom');
insert into ct10info (eid, esal,ename) values( 146,850000,'null'); it will accept 'null' the ename value
as actul name.
insert into ct10info (eid, esal,ename) values( 147,850000,''); --it will accept '' the ename values as
unknown value
is null keyword---
It is used to identify null values from perticular column and display its resp. records from table.
select * from ct10info where edept = '';------ it will not display null values... we will use is null
keyword.
Actual query
select * from ct10info where edept is null;---It will dipslay null values from edept column
select * from ct10info where ename= 'null';---It will display rows who havong ename = 'null'...i.e
'null' is a string
Q. How to display null values from perticular column?--- Using is null keyword.
Update Command
Q. How to update salary with 120000 from table whose ename is 'Gaurav'.------Capgemini 3+years
Interview Quest.
update ct10info set esal= 120000 where ename ='Gaurav';
update ct10info
update ct10info
update ct10info
update emp
where ename='Sachin'
set esal=80000
How to update esal with 125000 and eadd with 'Newyork' whose eid is 105
update ct10info
where eid=105;
Right Ans
update ct10info
update ct10info
set esal= is null ya fir (null) ya fir 'null' -- these all comes under wrong syntaxes.
UPDATE CT10INFO
Delete Command-- It deletes/removes rows from table with respect to given condition.
Is null keyword----It is used to identify null values from perticular column and display its resp.
records from table.
update employee11
set eincent=2000
delete esal from ct10info where eid=101; -----This is wrong query to delete single column value.
update ct10info
update ct10info
SQL Operators-----
Arithmatic
Compariosn
Logical
Concatanition
Like
+, -, *, /
How to select total columns from table with addition of two columns?