SlideShare a Scribd company logo
1 of 1
1. Draw an ER Diagram for the following scenario: A university consists of a number of
departments. Each department offers several courses. A number of modules make up each
course. Students enrols in a particular course and take modules towards the completion of
that course. Each module is taught by a lecturer from the appropriate department, and
each lecturer tutors a group of students.
2. Draw an ER Diagram for the following scenario : We want to represent information about
products in a database. Each product has a description, a price and a supplier. Suppliers
have addresses, phone numbers, and names. Each address is made up of a street address,
a city, and a postcode.
3. Draw an ER Diagram for the following scenario : A database will be made to store
information about patients in a hospital. On arrival, each patient’s personal details (name,
address, and telephone number) are recorded where possible, and they are given an
admission number. They are then assigned to a particular ward (Accident and Emergency,
Cardiology, Oncology, etc.). In each ward there are a number of doctors and nurses. A
patient will be treated by one doctor and several nurses over the course of their stay, and
each doctor and nurse may be involved with several patients at any given time.
4. Draw an ER Diagram for the following scenario: The company you work for wants to
digitize their time cards. You have been asked to design the database for submitting and
approving time cards. Draw the database ER diagram with the following information:
A timecard should have hours worked and date submitted
Each timecard is associated with exactly one employee
Each timecard should have a unique id
Each timecard has a status: it is either approved, not approved, or pending
Each employee has a unique id
Each employee has a name and address.
Each employee submits a time card every pay period. i.e. In 1 year, they will submit multiple time
cards
Each employee either has direct deposit or physical check as their method of payment
Each employee is associated with exactly one manager
Each manager has a unique id and a name
Each manager is in charge of multiple employees
Each manager approves time cards for multiple employees
5. There exists a database of people who take measurements of trees in various locations. A
person may take measurements of multiple trees, and each tree may be measured multiple
times throughout a number of days. For each and every tree we need to collect
information about to what species does it belong to, what are the latitude and longitude of
the tree. We also need to maintain an identification number for each and every tree.
Whoever the person taking the measurements of the tree , that persons name,unique
identification number,address and role need to be maintained. Whatever the
measurements taken need to maintained separately with the details of what the diameter
and height of the tree , when exactly the measurement has been taken. For each and
measurement taken we have to maintain a record. We also need to correlate with who is
the person who has taken the measurement. Depict an ER diagram for the above scenario.

More Related Content

Similar to SQL practice questions for beginners

Need help with this ASAP- This is Database systems- Please draw out th.pdf
Need help with this ASAP- This is Database systems- Please draw out th.pdfNeed help with this ASAP- This is Database systems- Please draw out th.pdf
Need help with this ASAP- This is Database systems- Please draw out th.pdf
Stewart29UReesa
 
Case 2 Study the following case study and All answer questi.pdf
Case 2 Study the following case study and All answer questi.pdfCase 2 Study the following case study and All answer questi.pdf
Case 2 Study the following case study and All answer questi.pdf
aayushmaany2k14
 
Class lecture notes # 2 (statistics for research)
Class lecture notes # 2 (statistics for research)Class lecture notes # 2 (statistics for research)
Class lecture notes # 2 (statistics for research)
Harve Abella
 
Documenting And Reporting
Documenting And ReportingDocumenting And Reporting
Documenting And Reporting
Tosca Torres
 
Draw an EER diagram according to the notations discussed in class to a.pdf
Draw an EER diagram according to the notations discussed in class to a.pdfDraw an EER diagram according to the notations discussed in class to a.pdf
Draw an EER diagram according to the notations discussed in class to a.pdf
abc2232
 
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
NICHOLAS RATEMO
 
Draw an EER diagram according to the notations discussed in class to a.docx
Draw an EER diagram according to the notations discussed in class to a.docxDraw an EER diagram according to the notations discussed in class to a.docx
Draw an EER diagram according to the notations discussed in class to a.docx
BlakeSGMHemmingss
 
Health care facilities treat many types of For.docx
Health care facilities treat many types of For.docxHealth care facilities treat many types of For.docx
Health care facilities treat many types of For.docx
studywriters
 
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docxPART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
herbertwilson5999
 

Similar to SQL practice questions for beginners (20)

Introduction To Database Design.pptx
Introduction To Database Design.pptxIntroduction To Database Design.pptx
Introduction To Database Design.pptx
 
Need help with this ASAP- This is Database systems- Please draw out th.pdf
Need help with this ASAP- This is Database systems- Please draw out th.pdfNeed help with this ASAP- This is Database systems- Please draw out th.pdf
Need help with this ASAP- This is Database systems- Please draw out th.pdf
 
Documenting and reporting
Documenting and reportingDocumenting and reporting
Documenting and reporting
 
Case 2 Study the following case study and All answer questi.pdf
Case 2 Study the following case study and All answer questi.pdfCase 2 Study the following case study and All answer questi.pdf
Case 2 Study the following case study and All answer questi.pdf
 
Class lecture notes # 2 (statistics for research)
Class lecture notes # 2 (statistics for research)Class lecture notes # 2 (statistics for research)
Class lecture notes # 2 (statistics for research)
 
Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)
 
Maintenance of records and reports copy
Maintenance of records and reports   copyMaintenance of records and reports   copy
Maintenance of records and reports copy
 
Documenting And Reporting
Documenting And ReportingDocumenting And Reporting
Documenting And Reporting
 
Statistics basics
Statistics basicsStatistics basics
Statistics basics
 
Statistics 1
Statistics 1Statistics 1
Statistics 1
 
9. Documentation, Recording and Reporting.pptx
9. Documentation, Recording and Reporting.pptx9. Documentation, Recording and Reporting.pptx
9. Documentation, Recording and Reporting.pptx
 
Draw an EER diagram according to the notations discussed in class to a.pdf
Draw an EER diagram according to the notations discussed in class to a.pdfDraw an EER diagram according to the notations discussed in class to a.pdf
Draw an EER diagram according to the notations discussed in class to a.pdf
 
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4
 
Funding for Standing Frames
Funding for Standing FramesFunding for Standing Frames
Funding for Standing Frames
 
INSTITUTIONAL RECORD AND REPORTS.pptx
INSTITUTIONAL RECORD AND REPORTS.pptxINSTITUTIONAL RECORD AND REPORTS.pptx
INSTITUTIONAL RECORD AND REPORTS.pptx
 
Draw an EER diagram according to the notations discussed in class to a.docx
Draw an EER diagram according to the notations discussed in class to a.docxDraw an EER diagram according to the notations discussed in class to a.docx
Draw an EER diagram according to the notations discussed in class to a.docx
 
Health care facilities treat many types of For.docx
Health care facilities treat many types of For.docxHealth care facilities treat many types of For.docx
Health care facilities treat many types of For.docx
 
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docxPART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
PART IHCA270 Health Care Finance PART I - Contractual AllowanceBa.docx
 
Nursing records & reports
Nursing records & reportsNursing records & reports
Nursing records & reports
 
Introduction to Statistics.pptx
Introduction to Statistics.pptxIntroduction to Statistics.pptx
Introduction to Statistics.pptx
 

More from Mohd Tousif

System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
Mohd Tousif
 

More from Mohd Tousif (20)

Sql commands
Sql commandsSql commands
Sql commands
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions set
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to Databases
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An Example
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) Model
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and Architecture
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorial
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)
 
Sql commands
Sql commandsSql commands
Sql commands
 
Virtual box
Virtual boxVirtual box
Virtual box
 
Deadlock
DeadlockDeadlock
Deadlock
 
Algorithm o.s.
Algorithm o.s.Algorithm o.s.
Algorithm o.s.
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
 
Ipc
IpcIpc
Ipc
 

Recently uploaded

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

SQL practice questions for beginners

  • 1. 1. Draw an ER Diagram for the following scenario: A university consists of a number of departments. Each department offers several courses. A number of modules make up each course. Students enrols in a particular course and take modules towards the completion of that course. Each module is taught by a lecturer from the appropriate department, and each lecturer tutors a group of students. 2. Draw an ER Diagram for the following scenario : We want to represent information about products in a database. Each product has a description, a price and a supplier. Suppliers have addresses, phone numbers, and names. Each address is made up of a street address, a city, and a postcode. 3. Draw an ER Diagram for the following scenario : A database will be made to store information about patients in a hospital. On arrival, each patient’s personal details (name, address, and telephone number) are recorded where possible, and they are given an admission number. They are then assigned to a particular ward (Accident and Emergency, Cardiology, Oncology, etc.). In each ward there are a number of doctors and nurses. A patient will be treated by one doctor and several nurses over the course of their stay, and each doctor and nurse may be involved with several patients at any given time. 4. Draw an ER Diagram for the following scenario: The company you work for wants to digitize their time cards. You have been asked to design the database for submitting and approving time cards. Draw the database ER diagram with the following information: A timecard should have hours worked and date submitted Each timecard is associated with exactly one employee Each timecard should have a unique id Each timecard has a status: it is either approved, not approved, or pending Each employee has a unique id Each employee has a name and address. Each employee submits a time card every pay period. i.e. In 1 year, they will submit multiple time cards Each employee either has direct deposit or physical check as their method of payment Each employee is associated with exactly one manager Each manager has a unique id and a name Each manager is in charge of multiple employees Each manager approves time cards for multiple employees 5. There exists a database of people who take measurements of trees in various locations. A person may take measurements of multiple trees, and each tree may be measured multiple times throughout a number of days. For each and every tree we need to collect information about to what species does it belong to, what are the latitude and longitude of the tree. We also need to maintain an identification number for each and every tree. Whoever the person taking the measurements of the tree , that persons name,unique identification number,address and role need to be maintained. Whatever the measurements taken need to maintained separately with the details of what the diameter and height of the tree , when exactly the measurement has been taken. For each and measurement taken we have to maintain a record. We also need to correlate with who is the person who has taken the measurement. Depict an ER diagram for the above scenario.