• Home
  • Textbooks
  • Computer science with Mathematica: theory and practice for science, mathematics, and engineering
  • Databases

Computer science with Mathematica: theory and practice for science, mathematics, and engineering

Roman Maeder

Chapter 13

Databases - all with Video Answers

Educators


Chapter Questions

02:01

Problem 1

The database of classical music recordings used in this chapter is available for your own exercises.
(Table Cant Copy)
Some standard queries of the form report [name] are predefined. Here, for example, is the code that produced the report:
report[ allrecords ] :=
Module $[\{$ rel $\}$,
rel $=$ records;
rel $=$ Join $[$ rel, recordings $]$;
rel $=\operatorname{Join}[\mathrm{rel}$, works ];
rel = Join [ rel, composers ];
rel = Projection $[$ rel,
\{recordTitle, label, recordNumber,
composerName, workTitle\} ];
Report [rel, 3, 1]
]
The data entry command DataEntry is defined also in Music.m. After entering new data, you can write the modified database to the file music.db using save. A backup copy of the old file is first put into music.db.bak.

AG
Ankit Gupta
Numerade Educator

Problem 2

Find entities, attributes, and relationships for a simple address database. Develop the corresponding layout of relations. Which attributes can be used as keys? Provide for the entry of optional information, such as phone and fax number(s), occupation, and so on. Test your design by solving the following problems with it:
1. Print a list of all persons having the same address.
2. Make entries for father and son having the same first and last names and living at the same address.
3. Change of name at marriage.
4. Addresses in various countries, for example:
MathConsult Dr. R. Mäder
Samstagernstraße 58a
8832 Wollerau
Switzerland
Tel: +4116874051, Fax: +4116874054

Check back soon!