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.pdfStewart29UReesa
 
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.pdfaayushmaany2k14
 
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
 
Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Coit20247 ass1 requirementdba1 spec (1)
Coit20247 ass1 requirementdba1 spec (1)Sandeep Ratnam
 
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
 
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.pdfabc2232
 
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
 
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.docxBlakeSGMHemmingss
 
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)

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

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

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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.