Answer the query using SQL. For each department that controls more than 3 projects, retrieve the department number and department name.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Answer the query using SQL.
For each department that controls more than 3 projects, retrieve the department number and
department name.
Transcribed Image Text:Answer the query using SQL. For each department that controls more than 3 projects, retrieve the department number and department name.
Expert Solution
Step 1

Introduction of DBMS:

A database is a collection of data that are used to produce useful information e.g. Department database may consist of Department information like Department Name, Department Number, Number of Projects, Department Floor, etc. DBMS(Database Management System) is a software to store and retrieve data. So to store department records we have to create a table, insert data into the table, etc. So DBMS is used for the structure of the database and manipulates the data in the database e.g. Oracle, SQL Server, My SQL, etc are DBMS software to maintain database and these databases mostly use SQL(Structured Query Language) language.

Step 2

SQL Query to create a table Department: 

CREATE TABLE Department(DepartmentName char(10), DepartmentNumber varchar(10),NumberOfProject int, DepartmentFloor varchar(5));

SQL Query to insert data into the table Department:

INSERT INTO Department VALUES('Science','Dept1',8,'2nd');
INSERT INTO Department VALUES('Mathematics','Dept2',5,'1st');
INSERT INTO Department VALUES('Computer','Dept3',4,'5th');
INSERT INTO Department VALUES('Finance','Dept4',2,'3rd');
INSERT INTO Department VALUES('Account','Dept5',3,'4th');

SQL Query to retrieve information of the table:

SELECT * FROM Department;

Computer Science homework question answer, step 2, image 1

 

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education