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
Emp Script Mysql
PDF
No ratings yet
Emp Script Mysql
1 page
Class XII - CS - Practical Programs 20 and 21
PDF
No ratings yet
Class XII - CS - Practical Programs 20 and 21
5 pages
Dbms 4
PDF
No ratings yet
Dbms 4
5 pages
Wa0014.
PDF
No ratings yet
Wa0014.
4 pages
Sampledatabase (1) - 6290872 - 2024 - 10 - 01 - 19 - 31
PDF
No ratings yet
Sampledatabase (1) - 6290872 - 2024 - 10 - 01 - 19 - 31
2 pages
9th Employee
PDF
No ratings yet
9th Employee
1 page
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
Lab Assignment 3 DBMS
PDF
No ratings yet
Lab Assignment 3 DBMS
13 pages
Create Table Employee
PDF
No ratings yet
Create Table Employee
2 pages
Queries
PDF
No ratings yet
Queries
4 pages
Lab 4
PDF
No ratings yet
Lab 4
13 pages
Assignment-1 Dbms
PDF
No ratings yet
Assignment-1 Dbms
3 pages
SQL Commands Query
PDF
No ratings yet
SQL Commands Query
6 pages
Sql-Task
PDF
No ratings yet
Sql-Task
2 pages
Document
PDF
No ratings yet
Document
13 pages
3rd Company
PDF
No ratings yet
3rd Company
2 pages
Assignment-2 DBMS
PDF
No ratings yet
Assignment-2 DBMS
3 pages
SQL Queries
PDF
No ratings yet
SQL Queries
10 pages
LiveSQL 1
PDF
No ratings yet
LiveSQL 1
2 pages
SQL Practice
PDF
No ratings yet
SQL Practice
4 pages
Week 5
PDF
No ratings yet
Week 5
10 pages
CrEmpDep New
PDF
No ratings yet
CrEmpDep New
1 page
SQL A
PDF
No ratings yet
SQL A
5 pages
RDBMS1
PDF
No ratings yet
RDBMS1
7 pages
SQL New Assignment 2
PDF
No ratings yet
SQL New Assignment 2
5 pages
SQL Empl Table
PDF
0% (1)
SQL Empl Table
2 pages
All Labs
PDF
No ratings yet
All Labs
5 pages
Unit-3 SQL - Practical Demonstration
PDF
No ratings yet
Unit-3 SQL - Practical Demonstration
14 pages
Source Code Dbms
PDF
No ratings yet
Source Code Dbms
14 pages
SQL
PDF
No ratings yet
SQL
12 pages
Group by Having
PDF
No ratings yet
Group by Having
3 pages
Practical 1 DBMS
PDF
No ratings yet
Practical 1 DBMS
3 pages
Mysql
PDF
No ratings yet
Mysql
6 pages
Create Database Test
PDF
No ratings yet
Create Database Test
5 pages
Practise
PDF
No ratings yet
Practise
21 pages
SCHEMA1
PDF
No ratings yet
SCHEMA1
19 pages
Dbms Final
PDF
No ratings yet
Dbms Final
25 pages
Mysql Practice
PDF
No ratings yet
Mysql Practice
10 pages
Effect of Tax Collection On Service Delivery in Uganda
PDF
No ratings yet
Effect of Tax Collection On Service Delivery in Uganda
24 pages
IP - MySQL Practical File
PDF
No ratings yet
IP - MySQL Practical File
9 pages
SQL Mastery Set 1 (110 Questions)
PDF
No ratings yet
SQL Mastery Set 1 (110 Questions)
7 pages
VMD Interview Quetions
PDF
No ratings yet
VMD Interview Quetions
5 pages
Simple and Complex Queries
PDF
No ratings yet
Simple and Complex Queries
31 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
Dbms
PDF
No ratings yet
Dbms
6 pages
Dbms
PDF
No ratings yet
Dbms
6 pages
20 SQL Exercises For Practice: Table Structure and Schema
PDF
100% (5)
20 SQL Exercises For Practice: Table Structure and Schema
12 pages
The Network Infrastructure
PDF
No ratings yet
The Network Infrastructure
87 pages
ARTICLE - 10 TimelessTests of Strategy
PDF
100% (1)
ARTICLE - 10 TimelessTests of Strategy
12 pages
Mysql Practical File Assignment
PDF
No ratings yet
Mysql Practical File Assignment
6 pages
SQL
PDF
No ratings yet
SQL
53 pages
IP - MySQL Practical File
PDF
No ratings yet
IP - MySQL Practical File
9 pages
Slides Marked As Extra Study Are Not As A Part of Syllabus. Those Are Provided For Add-On Knowledge
PDF
100% (2)
Slides Marked As Extra Study Are Not As A Part of Syllabus. Those Are Provided For Add-On Knowledge
60 pages
Creating A DEPARTMENT Tables
PDF
No ratings yet
Creating A DEPARTMENT Tables
4 pages
Success of Mang Inasal
PDF
70% (23)
Success of Mang Inasal
44 pages
Sts Midterm Review
PDF
No ratings yet
Sts Midterm Review
12 pages
Manual of GIS For ArcGIS Basic Section PDF
PDF
No ratings yet
Manual of GIS For ArcGIS Basic Section PDF
58 pages
Dbms Answers All - Haam's Community
PDF
No ratings yet
Dbms Answers All - Haam's Community
55 pages
SQL Excersise
PDF
No ratings yet
SQL Excersise
2 pages
Data Warehouse
PDF
100% (1)
Data Warehouse
12 pages
Mysql & SQL - Introduction: Course: Nosql
PDF
100% (1)
Mysql & SQL - Introduction: Course: Nosql
88 pages
Memory Management: William Stallings
PDF
No ratings yet
Memory Management: William Stallings
66 pages
Hadoop Hive - One
PDF
No ratings yet
Hadoop Hive - One
10 pages
MySQL5 With Answers
PDF
No ratings yet
MySQL5 With Answers
6 pages
Initializing SD Card
PDF
No ratings yet
Initializing SD Card
29 pages
Chapter 1 5 Complete.
PDF
No ratings yet
Chapter 1 5 Complete.
62 pages
Cloud and Big Data Presentation
PDF
No ratings yet
Cloud and Big Data Presentation
12 pages
It Pertains To The Restrictions Identified by The Researcher That May Affect The Outcome of The Study But Over Which He
PDF
100% (1)
It Pertains To The Restrictions Identified by The Researcher That May Affect The Outcome of The Study But Over Which He
9 pages
Chapter 6 Communication For Academic Purposes
PDF
No ratings yet
Chapter 6 Communication For Academic Purposes
22 pages
Type 1
PDF
No ratings yet
Type 1
26 pages
Oracle DBA Course Content
PDF
No ratings yet
Oracle DBA Course Content
8 pages
SQL Learning Queries
PDF
No ratings yet
SQL Learning Queries
15 pages
ClonezillaLiveRefCard en Flat 0.9.5
PDF
No ratings yet
ClonezillaLiveRefCard en Flat 0.9.5
3 pages
Open Elective III & IV List 2021-22
PDF
No ratings yet
Open Elective III & IV List 2021-22
6 pages
Chapter Iii True Experimental
PDF
No ratings yet
Chapter Iii True Experimental
15 pages
Data Mining: Business Intelligence
PDF
No ratings yet
Data Mining: Business Intelligence
68 pages
Railway PROJECT
PDF
No ratings yet
Railway PROJECT
13 pages
Relationships Between Entities in Entity Framework 6: One-to-One Relationship
PDF
No ratings yet
Relationships Between Entities in Entity Framework 6: One-to-One Relationship
1 page
Assignment03 HumanComputerInteraction JaweriaMukhtiar (023-21-0283) BSCS-VIII (F)
PDF
No ratings yet
Assignment03 HumanComputerInteraction JaweriaMukhtiar (023-21-0283) BSCS-VIII (F)
3 pages
Assignment Brief: Academic Year 2020-20
PDF
No ratings yet
Assignment Brief: Academic Year 2020-20
2 pages
Relational Data Base Management System
PDF
No ratings yet
Relational Data Base Management System
3 pages
Ilocossur Vigan
PDF
No ratings yet
Ilocossur Vigan
2 pages
SPA Group 20
PDF
No ratings yet
SPA Group 20
16 pages
Group by
PDF
No ratings yet
Group by
7 pages
SQL Queries: 200+ Queries to Challenge you.
From Everand
SQL Queries: 200+ Queries to Challenge you.
Swaroop Kallakuri
5/5 (2)
SQL Notes
PDF
No ratings yet
SQL Notes
58 pages
Sql Plsql Oracle
From Everand
Sql Plsql Oracle
Andrew Igla
No ratings yet
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet
Profound Python Data Science
From Everand
Profound Python Data Science
Onder Teker
No ratings yet