1 Assume that a company database contains only the following
1) Assume that a company database contains only the following fields: item-id, item-type, customer-id, customer-city, order-date, price per unit, total sales.
Based on the given data, the total sales field
A)Should never be stored in a table
B)Should not be stored in a table because it can be calculated from existing data
C) Depends on the relationship in the database.
C) Must be stored in a table since it cannot be determined from existing data
2) Assume that you have a table which primary key is the product Name. the existing product names are ball, bat, glove, mask, shirt, shoe, tape, water bottle. You inter a new product named Sneaker into this table, and then close the table. Where will the newest product show up the next time that you open the table?
Assume that you have 3 tables names A, B, C. table B is the intersection between A and C- it is on the “many” side, while tables A and C care on the “One” side with B. the next 2 questions are based on this description.
3) Lookup field would likely be most appropriate for use in table: A OR B OR C?
Briefly explain your answer:
4) A certain number of records should be entered in table B in order to prove visually that the design is correct. What is the minimum number of records needed in table B?
Briefly explain your answer:
5) Assume that you have following 10 names in a table (commas are not part of the name): JONES, SPOTH, ASH, DUSTER, PASTOR, CONES, STONE, POST, DON, TORRE
Which of the above names will result from each query?
Criteria: like ”?o?”
Result:
Criteria: like ”*s*”
Result:
Write the exact syntax (expression) for each of the following question.
6) Create a new field that concatenates a person’s last, first, and middle names.
7) Create a new filed that contains a person’s new bank balance, totaling the initial deposit and calculated interest. Deposits under 7000 earn 3%; others earn 4%.
Solution
1.B)Should not be stored in a table because it can be calculated from existing data
2.Every table always in sorted manner according to primary field.So,the new entry Sneaker is arranged in table after the field shoe.
5. ? or _ wildchar for only one char representation ,so \"?o?\" pattern shows strings length 3chars with middle char must o. (No case senstivity)
result : DON
* or % wildchar for zero or more chars representation ,so \"*o*\" pattern shows strings varible length and char must with s in any where . (No case senstivity)
result : JONES, SPOTH, ASH, DUSTER, PASTOR, CONES, STONE, POST
6. SELECT CONCAT( `first_name`, `middle_name`,`last_name`) AS `Full_name` FROM `users`

