Task For BD02
Task For BD02
The CLIENT table includes information about the clients: client identifier,
identification card, name, surnames, register date, email, mobile phone,
nationality.
The VISIT table includes information about scheduled visits of clients to the
properties: visit identifier, visit date and hour (only one field for date and hour),
agent name, property, client identifier.
EXERCISE 2
We are going to modify the tables created in the first exercise.
1. Create a pool field in the PROPERTY table. Its domain is C (community) and P
(private).
Establish the following constraints:
2. The price field must be equal to or greater than 100.000€.
3. The register date must be later than year 2000.
4. A visit cannot be inserted unless the hour of visit is between 9 and 15.
5. Remove the previous constraint about the visit date.
6. Delete the email column of the CLIENT table.
7. Two clients cannot have the same identification card.
8. Change the VISIT table primary key for thevisit date and client fields.
9. We want to ensure that every visit has only ONE client (that is, two clients can
visit the same property only at different time). Create a unique index to validate
that.
10. Rename CLIENT table for BUYER.
11. Remove the VISIT table.
12. Create a user with your name and a password. Give SELECT and INSERT
privileges on the PROPERTY table to that user.
Recommendations.
You will be using some new operators. Remember in the “Elementos del Lenguaje.
Normas de escritura” section you have the most common operators.
Useful information:
MySQL 8.0 operators
Submission rules.
Once the task is done, you will create a single document, the document should have the
answer of the exercises inside. The delivery of the document will be done through the
platform and the file document must be PDF named as follows:
Surname1_surname2_name_SIGxx_Task
Make sure the name does not contain the letter ñ, accents, or any other special
characters. For example, the student Begoña Sánchez Mañas for the second unit of the
subject BD, should name this task as...
sanchez_manas_begona_BD02_Task