Professional Documents
Culture Documents
Advanced Database CA 2021
Advanced Database CA 2021
INSTRUCTIONS TO CANDIDATES
Before starting this Exam, create a folder on the desktop with the name
format: matricule-ADS201. E.g. SL19T201-ADS201
products
**product_id *product_name unit_price
PR01 White Rice 21000
PR02 ELENA Tomatoe 5400
PR03 Mayor-Vegetable oil 18000
PR04 SuperJus 3000
PR05 NIPE-Sardine 2500
orders
**SN customer_id product_id order_id quantity Order_date
1 C1507 PR02 CR01 10 2020-12-14
2 C1507 PR05 CR01 5 2020-12-14
3 C1507 PR01 CR01 10 2020-12-14
4 C1523 PR05 CR02 8 2020-12-16
5 C1523 PR03 CR03 4 2020-12-20
**=Primary Key; *=Unique;
b) Create a foreign key constraint for tb_orders.customer_id associating with tb_customers.customer_id.
c) Create a foreign key constraint for tb_orders.product_id associating with tb_products.product_id.
Dean of Studies (+237) 6 54 24 19 83 info@swissLinkedu.com Director: (+237) 6 79 89 48 92
d) Write query statements for the following situations: (NB: Copy each SQL statement into your answer booklet)
(i) inserts a customer from Bamenda whose name is EPIE BISSONG with customer_id C1558.
(ii) selects all customers whose names begin with the character “M”
(iii) changes the name of the customer with customer_id C1517 to ETA BISSONG BECKY
(iv) shows customer_id, customer_name, order_id, product_name, quantity, unit_price, amount
e) Export the database and put into your exam folder.
tb_orders
OrdNo OrdDate CusNo Product OrdCost
01110 2015/01/23 C890 Cement 340000
01111 2015/01/25 C213 Zinc 350000
02222 2015/02/12 C467 Rice 125000
02220 2015/03/15 C234 Cement 300000
03330 2015/01/28 C678 Wheat 275000
03331 2015/04/24 C123 Cement 175000
04444 2015/05/17 C456 Rice 100000
05555 2015/06/20 C890 Cement 450000
06666 2015/05/19 C213 Wine 180000
07777 2015/07/01 C234 Wine 540000
Write SQL statements to: (NB: Copy each SQL statement into your answer booklet)
a) List the customer number, the name (first and last) and the balance of customers who reside in Douala
b) List the order number, order date, order cost, customer first name and customer city for orders costing
more than 25000 and sent to Douala.
c) List the cities and regions where orders have been placed. Remove duplicates from the results
d) List the customer number, the name (first and last), the city and total order cost of customers who
reside in Limbe
e) Export the database and put into your exam folder.
<<END>>
Dean of Studies (+237) 6 54 24 19 83 info@swissLinkedu.com Director: (+237) 6 79 89 48 92