Cust

an anonymous user · August 06, 2022
--create database sadhna;
--use sadhna;
-- create a table
CREATE TABLE emp(eid integer(20) NOT NULL ,
  ename TEXT(100) NOT NULL,
  dept varchar(20) NOT NULL,
  salary INTEGER(20) not NULL, primary key(eid));
-- insert some values
INSERT INTO emp VALUES (1 ,'Ram', 'hr',10000)
,(2,'amit','mrkt',20000),(3,'rohan','hr',30000),
(4,'nitin','mrkt',40000);
INSERT INTO emp VALUES ( 5,'varun', 'it',50000);
--update emp set age='42' where id=1;
--delete FROM emp where id=3;
--delete from emp;
-- fetch some values
--SELECT * FROM emp;


--find name of a person whose salary is  maximum 
select max(salary) from emp;
Output
(Run the program to view its output)

Comments

Please sign up or log in to contribute to the discussion.