SlideShare a Scribd company logo
1 of 1
Download to read offline
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

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
 
1- Draw an entity relationship diagram (ERD) for the following situati.docx
1- Draw an entity relationship diagram (ERD) for the following situati.docx1- Draw an entity relationship diagram (ERD) for the following situati.docx
1- Draw an entity relationship diagram (ERD) for the following situati.docxDominic3YGRobertsz
 
DirectionsComplete the multimedia quiz, Motivational Dimensio.docx
DirectionsComplete the multimedia quiz, Motivational Dimensio.docxDirectionsComplete the multimedia quiz, Motivational Dimensio.docx
DirectionsComplete the multimedia quiz, Motivational Dimensio.docxlynettearnold46882
 
In Chapter 3, we learned about databases, including �data modeling�..pdf
In Chapter 3, we learned about databases, including �data modeling�..pdfIn Chapter 3, we learned about databases, including �data modeling�..pdf
In Chapter 3, we learned about databases, including �data modeling�..pdfsiva009113
 
Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Sandeep Ratnam
 
Expanded Entity Relationship Diagram LAB OVERVIEW.pdf
Expanded Entity Relationship Diagram LAB OVERVIEW.pdfExpanded Entity Relationship Diagram LAB OVERVIEW.pdf
Expanded Entity Relationship Diagram LAB OVERVIEW.pdfsdfghj21
 
An Open Message On All E Mail Users
An Open Message On All E Mail UsersAn Open Message On All E Mail Users
An Open Message On All E Mail UsersCheryl Viljoen
 
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdf
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdfQ.1 [70 points] Draw an ER diagram to maintain information about a .pdf
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdfssuser6254411
 
Maintenance of records and reports copy
Maintenance of records and reports   copyMaintenance of records and reports   copy
Maintenance of records and reports copySaurav Garg
 
Documenting And Reporting
Documenting And ReportingDocumenting And Reporting
Documenting And ReportingTosca Torres
 
Statistics basics
Statistics basicsStatistics basics
Statistics basicsdebmahuya
 
Statistics 1
Statistics 1Statistics 1
Statistics 1Saed Jama
 
9. Documentation, Recording and Reporting.pptx
9. Documentation, Recording and Reporting.pptx9. Documentation, Recording and Reporting.pptx
9. Documentation, Recording and Reporting.pptxAme Mehadi
 
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 4NICHOLAS RATEMO
 
INSTITUTIONAL RECORD AND REPORTS.pptx
INSTITUTIONAL RECORD AND REPORTS.pptxINSTITUTIONAL RECORD AND REPORTS.pptx
INSTITUTIONAL RECORD AND REPORTS.pptxvikaskushwaha86
 
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.docxstudywriters
 
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.docxherbertwilson5999
 
Nursing records & reports
Nursing records & reportsNursing records & reports
Nursing records & reportsjasleenbrar03
 
Introduction to Statistics.pptx
Introduction to Statistics.pptxIntroduction to Statistics.pptx
Introduction to Statistics.pptxJacobGil3
 

Similar to SQL practice questions for beginners (20)

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)
 
1- Draw an entity relationship diagram (ERD) for the following situati.docx
1- Draw an entity relationship diagram (ERD) for the following situati.docx1- Draw an entity relationship diagram (ERD) for the following situati.docx
1- Draw an entity relationship diagram (ERD) for the following situati.docx
 
DirectionsComplete the multimedia quiz, Motivational Dimensio.docx
DirectionsComplete the multimedia quiz, Motivational Dimensio.docxDirectionsComplete the multimedia quiz, Motivational Dimensio.docx
DirectionsComplete the multimedia quiz, Motivational Dimensio.docx
 
In Chapter 3, we learned about databases, including �data modeling�..pdf
In Chapter 3, we learned about databases, including �data modeling�..pdfIn Chapter 3, we learned about databases, including �data modeling�..pdf
In Chapter 3, we learned about databases, including �data modeling�..pdf
 
Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)
 
Expanded Entity Relationship Diagram LAB OVERVIEW.pdf
Expanded Entity Relationship Diagram LAB OVERVIEW.pdfExpanded Entity Relationship Diagram LAB OVERVIEW.pdf
Expanded Entity Relationship Diagram LAB OVERVIEW.pdf
 
An Open Message On All E Mail Users
An Open Message On All E Mail UsersAn Open Message On All E Mail Users
An Open Message On All E Mail Users
 
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdf
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdfQ.1 [70 points] Draw an ER diagram to maintain information about a .pdf
Q.1 [70 points] Draw an ER diagram to maintain information about a .pdf
 
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
 
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
 
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

Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions setMohd Tousif
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to DatabasesMohd Tousif
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An ExampleMohd Tousif
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) ModelMohd Tousif
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set Mohd Tousif
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Mohd Tousif
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL) Mohd Tousif
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureMohd Tousif
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2Mohd Tousif
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorialMohd Tousif
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Mohd Tousif
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xpMohd 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

Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 

Recently uploaded (20)

Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 

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.