0% found this document useful (0 votes)
8 views2 pages

Databases Homework 3 Introduction to SQL

The document outlines Homework 3 for an Introduction to SQL course, focusing on a second-hand car dealer's database. It includes tasks such as writing entity descriptions, identifying primary and foreign keys, creating an entity relationship diagram, and writing various SQL statements for data extraction. Additionally, it requires an explanation of the Third Normal Form in relation to the Car database.

Uploaded by

Hamza Omar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Databases Homework 3 Introduction to SQL

The document outlines Homework 3 for an Introduction to SQL course, focusing on a second-hand car dealer's database. It includes tasks such as writing entity descriptions, identifying primary and foreign keys, creating an entity relationship diagram, and writing various SQL statements for data extraction. Additionally, it requires an explanation of the Third Normal Form in relation to the Car database.

Uploaded by

Hamza Omar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Homework 3 Introduction to SQL

Unit 11 Databases and software development

Homework 3 Introduction to SQL


1. A second-hand car dealer keeps a record of customers who have purchased cars.
The data held on each table includes the following fields:
Customer

Car

(a) Write the entity descriptions for the entities Customer and Car in the format:
Entity(attribute1, attribute2, ….) [2]

(b) Identify primary and foreign keys, where they exist, in both tables. [2]

(c) Draw an entity relationship diagram showing the relationship between


the two tables. [2]

1
Homework 3 Introduction to SQL
Unit 11 Databases and software development

(d) Write an SQL statement using keywords SELECT… FROM… WHERE…ORDER BY


to extract a list of the make, model, year registered and price of all 5-door cars costing
less than £2000, sequenced in descending order of price. [4]

(e) Write an SQL statement using keywords SELECT… FROM… WHERE…ORDER BY


to extract a list, sequenced by surname and initials, of customer IDs, surnames, initials
and email addresses of all customers who purchased cars between 2009 and 2011
inclusive, together with the make of car and price paid. [6]

(f) Write an SQL statement to extract all the details of cars


with make beginning with “V”.
[2]

(g) The Car database is in Third Normal Form. Explain what this means. [2]

Total 20 marks

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy