0% found this document useful (0 votes)
4 views1 page

SQL Employee Table Management Guide

The document outlines SQL commands for creating a table named 'emp' with various employee attributes, inserting multiple records, and selecting data based on salary criteria. It also includes an error message related to attempting to insert a record with a null 'id' value. Finally, there is a command to drop the 'emp' table.

Uploaded by

adityababar715
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

SQL Employee Table Management Guide

The document outlines SQL commands for creating a table named 'emp' with various employee attributes, inserting multiple records, and selecting data based on salary criteria. It also includes an error message related to attempting to insert a record with a null 'id' value. Finally, there is a command to drop the 'emp' table.

Uploaded by

adityababar715
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

use sy1_student_;

Create table emp(


id int primary key auto_increment,
ename varchar(100) not null,
email varchar(100),
phone bigint not null,
salary int not null,
city varchar(100) not null
);

insert into emp(ename, email, phone, salary, city) values ("rahul",


"rahul@[Link]", 897568978, 35000, "miraj"),
("akash", "akash@[Link]", 8955978985, 25000, "sangli"),
("sonu", "sonu@[Link]", 8478965897, 45000, "kavlapur"),
("nidhi", "nidhi@[Link]", 9751458789, 50000, "bisur"),
("tejas", "tejas@[Link]", 5456445978, 55000, "bisur");

select * from emp;

Drop table emp;

select id,ename, count(ename) from emp where salary >30000 group by city ;

MariaDB [db]> insert into emp(id, ename, email, phone,salary, city) values
(null,"leyona", "leyona@[Link]",880935000, 50000, "miraj");
ERROR 1048 (23000): Column 'id' cannot be null
MariaDB [db]>

You might also like