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

Homework 4 Introduction To SQL

Homework 4 focuses on SQL concepts related to 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 SQL statements for data extraction. The assignment aims to assess understanding of database structure and SQL querying techniques.

Uploaded by

avighna.seth
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)
6 views2 pages

Homework 4 Introduction To SQL

Homework 4 focuses on SQL concepts related to 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 SQL statements for data extraction. The assignment aims to assess understanding of database structure and SQL querying techniques.

Uploaded by

avighna.seth
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

Homework 4 Introduction to SQL

Unit 4 Exchanging data

Homework 4 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 4 Introduction to SQL
Unit 4 Exchanging data

(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