Nepal Oil Corporation2075 BSQuestion 5 of 5
Answer the following:
10 marks
Question source
- Exam year
- 2075 BS / 2018 AD
- Level
- Level 4 (Prabidhik, Bibidh, Sahayak – Computer)
- Paper
- Section B – Subjective
- Section
- Section B: Subjective
Model answer
a) Primary key vs Foreign key (consistent terminology):
| Basis | Primary Key | Foreign Key |
|---|---|---|
| Role | Uniquely identifies own table | Links to another table's PK |
| Rules | UNIQUE, never NULL, one per table | May repeat, may be NULL |
| Example | Depot.DepotID (D01 Biratnagar) | Stock.DepotID pointing to Depot |
Stock(D01, Petrol, 5000L) with D99 is rejected if D99 has no depot — referential integrity.
b) DBMS with example:
A DBMS (MS-Access, MySQL, Oracle) stores, manages and retrieves databases with security and queries. Example: NOC fuel-stock DB — tables Depot, Stock, Dealer linked by IDs; forms for entry, SELECT Depot, SUM(Qty) WHERE Fuel='Petrol' for head-office report, roles (clerk enters, manager approves), backup after daily closing. Replaces scattered Excel sheets with one consistent, queryable source.