Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
13 views
6 pages
Dbms 3
this is a program sheet of creating a data base using mysql
Uploaded by
learn.shwetankpandey
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save dbms 3 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
13 views
6 pages
Dbms 3
this is a program sheet of creating a data base using mysql
Uploaded by
learn.shwetankpandey
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save dbms 3 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
Shwetank Pandey, 2301420042 ,b.
tech cse
create database sp;
use sp;
create table Departement( Deptno int primary key
,Dname varchar(15) not null);
insert into Departement values
(40,"OPERATION");
SELECT * FROM Departement;
create table employee( empno int (4)primary key,
ename varchar(20) not null, job varchar(20),mgr
int(4), herdate Date ,sal int(10) ,comm int(7),
Deptno varchar(2) );
ALTER TABLE Departement
MODIFY COLUMN Deptno VARCHAR(2);
ALTER TABLE employee
CHANGE COLUMN herdate hiredate DATE;
ALTER TABLE employee
ADD CONSTRAINT fk_Deptno
FOREIGN KEY (Deptno)
REFERENCES Departement(Deptno);
TRUNCATE TABLE employee;
INSERT INTO employee (empno, ename, job,
mgr, hiredate, sal, comm, deptno) VALUE
(7788, 'SCOTT', 'ANALYST', 7566, '1982-12-09',
3000, NULL, '40'),
(7369, 'SMITH', 'CLERK', 7902, '1980-12-17', 800,
NULL, 20),
(7499, 'ALLEN', 'SALESMAN', 7698, '1981-02-20',
1600, 300, 30),
(7521, 'WARD', 'SALESMAN', 7698, '1981-02-22',
1250, 300, 30),
(7566, 'JONES', 'MANAGER', 7839, '1981-04-02',
2975, NULL, 20),
(7654, 'MARTIN', 'SALESMAN', 7698, '1981-09-
28', 1250, 1400, 30),
(7698, 'BLAKE', 'MANAGER', 7839, '1981-05-01',
2850, NULL, 30),
(7782, 'CLARK', 'MANAGER', 7839, '1981-06-09',
2450, NULL, 20),
(7839, 'KING', 'PRESIDENT', NULL, '1981-11-17',
5000, NULL, 20),
(7844, 'TURNER', 'SALESMAN', 7698, '1981-09-
08', 1500, 0, 30),
(7876, 'ADAMS', 'CLERK', 7788, '1983-01-12',
1100, NULL, 20),
(7900, 'JAMES', 'CLERK', 7698, '1981-12-03', 950,
NULL, 30),
(7902, 'FORD', 'ANALYST', 7566, '1981-12-03',
3000, NULL, 20),
(7934, 'MILLER', 'CLERK', 7782, '1982-01-23',
1300, NULL, 10);
select * from Departement;
select * from employee;
--------------------
select * from employee
where job = 'salesman' or comm>300;
select deptno from employee;
select distinct deptno from employee;
select sum(sal) as sumsalary from employee
where job = 'manager';
select min(sal ) as minsalary , max(sal) as maxsalary;
select count(empno) as empnocount from employee
where job= 'manager';
select count(empno) as empnocount, sum(sal) as
sumsalary
from employee where job= 'manager';
select deptno , count(empno) as countemp ,sum(sal) as
sumsalary
from employee
group by deptno;
select deptno , count(empno) as countemp ,sum(sal) as
sumsalary
from employee
group by deptno having count(empno)>1 order by
deptno;
select job,count(*) from employee group by job order by
count(*) desc;
select job, sum(sal),max(sal),min(Sal),avg(sal)
from employee group by job
having avg(sal)>1000;
select job,sum(sal) from employee group by job;
select deptno,count(empno) from employee
group by deptno;
SELECT job, COUNT(*) AS empn
FROM employee
GROUP BY job;
SELECT job, SUM(sal) AS total_salary
FROM employee
GROUP BY job;
SELECT deptno, COUNT(*) AS total_employees
FROM employee
GROUP BY deptno
HAVING COUNT(*) > 3;
SELECT deptno, MAX(sal) AS max_salary
FROM employee
GROUP BY deptno;
SELECT job, SUM(sal) AS total_salary
FROM employee
GROUP BY job
HAVING SUM(sal) > 40000;
SELECT job, COUNT(*) AS total_employees
FROM employee
GROUP BY job
HAVING COUNT(*) > 3;
You might also like
SQL Mastery Set 1 (110 Questions)
PDF
No ratings yet
SQL Mastery Set 1 (110 Questions)
7 pages
20 SQL Exercises For Practice: Table Structure and Schema
PDF
100% (5)
20 SQL Exercises For Practice: Table Structure and Schema
12 pages
SQL Queries: 200+ Queries to Challenge you.
From Everand
SQL Queries: 200+ Queries to Challenge you.
Swaroop Kallakuri
5/5 (2)
SAP Global Track and Trace: Event-to-Action Engine
PDF
No ratings yet
SAP Global Track and Trace: Event-to-Action Engine
23 pages
02 - OutSystems Overview PDF
PDF
100% (1)
02 - OutSystems Overview PDF
31 pages
SQL Excersise
PDF
No ratings yet
SQL Excersise
2 pages
Dbms 4
PDF
No ratings yet
Dbms 4
5 pages
IP - MySQL Practical File
PDF
No ratings yet
IP - MySQL Practical File
9 pages
IP - MySQL Practical File
PDF
No ratings yet
IP - MySQL Practical File
9 pages
Mysql
PDF
No ratings yet
Mysql
6 pages
SQL Commands Query
PDF
No ratings yet
SQL Commands Query
6 pages
Practise
PDF
No ratings yet
Practise
21 pages
Assignment-2 DBMS
PDF
No ratings yet
Assignment-2 DBMS
3 pages
Mysql Practice
PDF
No ratings yet
Mysql Practice
10 pages
Assignment-1 Dbms
PDF
No ratings yet
Assignment-1 Dbms
3 pages
Practical 1 DBMS
PDF
No ratings yet
Practical 1 DBMS
3 pages
Group by Having
PDF
No ratings yet
Group by Having
3 pages
SCHEMA1
PDF
No ratings yet
SCHEMA1
19 pages
SQL Learning Queries
PDF
No ratings yet
SQL Learning Queries
15 pages
Sampledatabase (1) - 6290872 - 2024 - 10 - 01 - 19 - 31
PDF
No ratings yet
Sampledatabase (1) - 6290872 - 2024 - 10 - 01 - 19 - 31
2 pages
SQL
PDF
No ratings yet
SQL
12 pages
Unit-3 SQL - Practical Demonstration
PDF
No ratings yet
Unit-3 SQL - Practical Demonstration
14 pages
Group by
PDF
No ratings yet
Group by
7 pages
SQL New Assignment 2
PDF
No ratings yet
SQL New Assignment 2
5 pages
Lab 4
PDF
No ratings yet
Lab 4
13 pages
Class XII - CS - Practical Programs 20 and 21
PDF
No ratings yet
Class XII - CS - Practical Programs 20 and 21
5 pages
Source Code Dbms
PDF
No ratings yet
Source Code Dbms
14 pages
9th Employee
PDF
No ratings yet
9th Employee
1 page
Sql-Task
PDF
No ratings yet
Sql-Task
2 pages
Mysql Practical File Assignment
PDF
No ratings yet
Mysql Practical File Assignment
6 pages
Dbms Answers All - Haam's Community
PDF
No ratings yet
Dbms Answers All - Haam's Community
55 pages
Dbms Final
PDF
No ratings yet
Dbms Final
25 pages
Queries
PDF
No ratings yet
Queries
4 pages
CrEmpDep New
PDF
No ratings yet
CrEmpDep New
1 page
SQL A
PDF
No ratings yet
SQL A
5 pages
Week 5
PDF
No ratings yet
Week 5
10 pages
SQL Practice
PDF
No ratings yet
SQL Practice
4 pages
Key and Forigen Key: 1. Create A Table and Specific The Primary
PDF
No ratings yet
Key and Forigen Key: 1. Create A Table and Specific The Primary
5 pages
Simple and Complex Queries
PDF
No ratings yet
Simple and Complex Queries
31 pages
Dbms
PDF
No ratings yet
Dbms
6 pages
Dbms
PDF
No ratings yet
Dbms
6 pages
Create Database Test
PDF
No ratings yet
Create Database Test
5 pages
Lab Assignment 3 DBMS
PDF
No ratings yet
Lab Assignment 3 DBMS
13 pages
Document
PDF
No ratings yet
Document
13 pages
All Labs
PDF
No ratings yet
All Labs
5 pages
Creating A DEPARTMENT Tables
PDF
No ratings yet
Creating A DEPARTMENT Tables
4 pages
MySQL5 With Answers
PDF
No ratings yet
MySQL5 With Answers
6 pages
SQL Empl Table
PDF
0% (1)
SQL Empl Table
2 pages
Create Table Employee
PDF
No ratings yet
Create Table Employee
2 pages
RDBMS1
PDF
No ratings yet
RDBMS1
7 pages
SQL
PDF
No ratings yet
SQL
53 pages
DBMS Assesment
PDF
No ratings yet
DBMS Assesment
4 pages
Test Answers SQL 18-02-2025
PDF
No ratings yet
Test Answers SQL 18-02-2025
2 pages
VMD Interview Quetions
PDF
No ratings yet
VMD Interview Quetions
5 pages
SQL Queries
PDF
No ratings yet
SQL Queries
10 pages
3rd Company
PDF
No ratings yet
3rd Company
2 pages
LiveSQL 1
PDF
No ratings yet
LiveSQL 1
2 pages
Emp Script Mysql
PDF
No ratings yet
Emp Script Mysql
1 page
Wa0014.
PDF
No ratings yet
Wa0014.
4 pages
Sql Plsql Oracle
From Everand
Sql Plsql Oracle
Andrew Igla
No ratings yet
Profound Python Data Science
From Everand
Profound Python Data Science
Onder Teker
No ratings yet
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet
Work Queues Guide
PDF
No ratings yet
Work Queues Guide
29 pages
Flyer AVEVA InTouchUnlimited
PDF
No ratings yet
Flyer AVEVA InTouchUnlimited
2 pages
Everything You Need To Know About Moving From Maximo EAM To Maximo Application Suite
PDF
No ratings yet
Everything You Need To Know About Moving From Maximo EAM To Maximo Application Suite
22 pages
Techzone 2014 Presentation Rundeck
PDF
No ratings yet
Techzone 2014 Presentation Rundeck
23 pages
Fellix CV Updated
PDF
No ratings yet
Fellix CV Updated
2 pages
DBMS Lab-1
PDF
No ratings yet
DBMS Lab-1
19 pages
Linux Commands For Managing Partitioning Troubleshooting
PDF
No ratings yet
Linux Commands For Managing Partitioning Troubleshooting
6 pages
Questions For Hyperion Planning Certification
PDF
No ratings yet
Questions For Hyperion Planning Certification
1 page
System Requirement Specification
PDF
No ratings yet
System Requirement Specification
38 pages
Sumit ABAP Fresher
PDF
No ratings yet
Sumit ABAP Fresher
3 pages
Exploring Cloud Infrastructures
PDF
No ratings yet
Exploring Cloud Infrastructures
74 pages
Downloading and Installing Python
PDF
No ratings yet
Downloading and Installing Python
20 pages
ASN
PDF
No ratings yet
ASN
5 pages
C4 Containers
PDF
No ratings yet
C4 Containers
22 pages
Final Unit 1
PDF
No ratings yet
Final Unit 1
150 pages
PM Debug Info
PDF
No ratings yet
PM Debug Info
275 pages
Topic1 - Introduction To Python
PDF
No ratings yet
Topic1 - Introduction To Python
10 pages
Data Analytics Using Caat Tool Idea
PDF
No ratings yet
Data Analytics Using Caat Tool Idea
33 pages
Title: - Develop Javascript To Use Decision Making and Looping Statements
PDF
No ratings yet
Title: - Develop Javascript To Use Decision Making and Looping Statements
8 pages
Amit Dbms File
PDF
No ratings yet
Amit Dbms File
25 pages
Swot Analysis & Turtle Diagram Purchasing
PDF
No ratings yet
Swot Analysis & Turtle Diagram Purchasing
2 pages
This Study Resource Was: For ($val 1 $val 100 $val+ 2) ($tem $val 2 )
PDF
No ratings yet
This Study Resource Was: For ($val 1 $val 100 $val+ 2) ($tem $val 2 )
7 pages
JTN002 - MinUnit - A Minimal Unit Testing Framework For C
PDF
No ratings yet
JTN002 - MinUnit - A Minimal Unit Testing Framework For C
2 pages
BB Mist 320 Chapter 2
PDF
No ratings yet
BB Mist 320 Chapter 2
39 pages
Install Node Red
PDF
No ratings yet
Install Node Red
10 pages
What Is Unit Testing?
PDF
No ratings yet
What Is Unit Testing?
8 pages
Redhat: Questions & Answers (Demo Version - Limited Content)
PDF
No ratings yet
Redhat: Questions & Answers (Demo Version - Limited Content)
7 pages
Tle Quiz
PDF
No ratings yet
Tle Quiz
4 pages