Relationships in MS Access, Relational Databases and LookML

To create a relationship in MS Access, open the Database Tools tab, click Relationships, add the tables you want to connect, then drag the primary key from one table onto the matching foreign key in the other. In the Edit Relationships dialog, tick Enforce Referential Integrity and click Create. The whole process takes under two minutes.

Key Takeaways

  • A relationship in MS Access links two tables through matching key fields, keeping your data consistent and query-ready.
  • Relational databases organise data into tables connected by primary and foreign keys, eliminating redundancy.
  • One-to-many is the most common relationship type; many-to-many requires a junction table.
  • Referential integrity prevents orphan records, one of the most common data quality problems in small business databases.
  • LookML, Looker’s modelling layer, defines the same table relationships in code so every analyst in your organisation queries data the same way.

Relational Database Basics

A relational database stores data in structured tables, where each table represents one entity, such as customers, orders, or products. Tables connect to each other through shared key fields rather than duplicating data across rows. This design, formalised by Edgar Codd at IBM in 1970, underpins almost every production database system you will encounter, from MySQL and PostgreSQL to Microsoft SQL Server and Oracle.

The two most important concepts are the primary key and the foreign key. A primary key uniquely identifies every row in a table. CustomerID in a Customers table is a classic example. A foreign key in a related table, say OrderCustomerID in an Orders table, points back to that primary key, creating the link between the two entities.

Why does this matter in practice? Consider a retail company in Bengaluru tracking 50,000 orders. Without relational design, every order row would repeat the customer’s name, address, and phone number. One address change means updating thousands of rows, and errors creep in fast. With a relational design, you update the address once in the Customers table and every order automatically reflects it.

According to Statista (2024), relational databases hold roughly 60% of the global database market share, making this knowledge foundational for anyone pursuing a data career. Indian universities offering BCA, MCA, and BSc Computer Science programmes include relational database design as a core module, and MS Access is frequently the first hands-on tool students use. If you are exploring what a data career path looks like, the guide on how to become a data engineer is a practical starting point.

Creating a Relationship in MS Access

MS Access remains widely used in Indian SMEs, government offices, and university MIS departments because it wraps relational database power inside a desktop interface that does not require SQL knowledge to get started. Setting up a relationship in MS Access correctly from day one saves enormous pain later. Understanding how to create a relationship in MS Access is also a common topic in technical interviews for junior data roles.

Step-by-Step: How to Create a Relationship in MS Access

  1. Design your tables first. Each table needs a clearly defined primary key. In Access, set a field’s data type to AutoNumber to let Access generate unique IDs automatically.
  2. Open the Relationships window. Click the Database Tools tab on the ribbon, then click Relationships.
  3. Add your tables. In the Show Table dialog, select the tables you want to link and click Add, then close the dialog.
  4. Drag the key field. Click and drag the primary key field from the parent table onto the foreign key field in the child table. Access opens the Edit Relationships dialog.
  5. Enforce referential integrity. Tick the Enforce Referential Integrity checkbox. Optionally enable Cascade Update Related Fields and Cascade Delete Related Records depending on your business rules.
  6. Click Create. Access draws a line between the tables showing the relationship type, with 1 and infinity symbols for a one-to-many relationship in MS Access.

One common mistake beginners make when building a relationship in MS Access is trying to link fields with mismatched data types. If CustomerID in Customers is a Number (Long Integer) but CustomerID in Orders is a Short Text field, Access will refuse to create the relationship. Always confirm both fields share the same data type before you start dragging.

Another practical reality: many Access databases inherited from older systems have no relationships defined at all. Queries still run, but you get Cartesian products instead of meaningful joins. If you are preparing for interviews, this is exactly the kind of gotcha covered in our data analyst interview questions guide.

Referential Integrity in MS Access

Referential integrity is a rule that prevents a foreign key value from pointing to a row that does not exist in the parent table. Without it, you can delete a customer who still has open orders, leaving those order rows pointing at nothing. Access calls these orphan records, and they silently corrupt your reports.

When you enable referential integrity in a relationship in MS Access, Access enforces two constraints automatically: you cannot add a child record unless the parent exists, and you cannot delete a parent record that has children unless you have also enabled Cascade Delete. This is not just a checkbox exercise. It is the difference between a trustworthy database and one that produces subtly wrong totals every month.

Relationship Types in MS Access and Relational Databases

There are three core relationship types in relational databases. Understanding them helps you design schemas that scale and query efficiently, whether you are working in MS Access, MySQL, or an enterprise data warehouse.

One-to-One Relationship

One row in Table A corresponds to exactly one row in Table B. This is rare in practice. You would use it to split a wide table into two for performance or security reasons, for example, storing sensitive employee salary data in a separate table from general employee details. In a one-to-one relationship in MS Access, you enforce this by setting the foreign key field as the primary key of the child table.

One-to-Many Relationship

One row in the parent table links to many rows in the child table. This is by far the most common type. One customer can place many orders. One department can have many employees. One product category can contain many products. In a one-to-many relationship in MS Access, the join line shows a 1 on the parent side and an infinity symbol on the child side when referential integrity is enforced.

Many-to-Many Relationship

Many rows in Table A relate to many rows in Table B. Students and courses are the textbook example: one student enrols in many courses, and one course has many students. Relational databases cannot model this directly with just two tables. You need a junction table (also called a bridge or associative table) that holds the primary keys from both tables as foreign keys. In MS Access, a many-to-many relationship is resolved into two one-to-many relationships via this junction table.

Relationship Type Example MS Access Implementation Junction Table Needed?
One-to-One Employee and EmployeeSalary FK is also PK in child table No
One-to-Many Customer and Orders FK in child table references PK in parent; infinity symbol shown No
Many-to-Many Students and Courses Two one-to-many links via junction table Yes

Getting comfortable with these types is essential whether you are working in Access, MySQL, or an enterprise warehouse. The BSc Computer Science subjects and scope article covers where database design sits in a formal CS curriculum if you want the academic framing.

Modelling Relationships in LookML

LookML is Looker’s proprietary data modelling language. It defines how tables in your data warehouse relate to each other, what metrics mean, and which fields analysts can see. Instead of writing raw SQL joins every time someone builds a dashboard, your data team writes LookML once and every analyst in the organisation queries through it consistently.

According to Google Cloud (2023), Looker is used by over 3,000 organisations globally, and demand for LookML skills has grown alongside the broader analytics engineering movement. LinkedIn’s 2024 Jobs on the Rise report listed data analysts and analytics engineers among the fastest-growing roles in India, reinforcing why this skill set matters right now for Indian professionals targeting data careers.

Core LookML Concepts: Explores and Joins

In LookML, an Explore is the entry point for a query. It defines which base table you are starting from. A join inside an Explore defines how other tables connect to that base table, exactly like the relationships you build visually in MS Access, but expressed in code.

Here is what a simple LookML relationship looks like in plain terms. You have an orders Explore based on an orders table. You join a customers view to it using the foreign key customer_id, specifying type: left_outer and relationship: many_to_one because many orders belong to one customer. Every analyst who opens the Orders Explore in Looker automatically gets the customer fields available without writing a single line of SQL themselves.

Why LookML Beats Ad Hoc SQL for Teams

The real power of LookML is consistency. When a metric like net revenue is defined once in LookML, every dashboard, every report, and every answer from Looker uses the same calculation. Without this layer, different analysts write slightly different SQL, and finance and marketing end up with different revenue numbers in the same board meeting. That is a trust problem that damages data culture across the organisation.

If you are weighing where data modelling skills fit in your career, the comparison of data analyst vs data scientist roles is worth reading. For a broader view of what tooling looks like in production environments, check out the breakdown of top data science tools companies use.

LookML Relationship Types Mapped to Relational Concepts

LookML relationship: Value Equivalent DB Relationship Common Use Case Fan-Out Risk?
many_to_one One-to-Many (from child side) Orders joining to Customers Low
one_to_many One-to-Many (from parent side) Customer joining to Orders High — inflated aggregates
one_to_one One-to-One Employee joining to EmployeeProfile None
many_to_many Many-to-Many Rarely used; prefer junction table joins Very High

One practical tip from real analytics engineering work: always specify the relationship: parameter in LookML joins even though Looker does not always require it. Omitting it causes Looker to make assumptions about fan-out that lead to inflated aggregate counts. It is a silent bug that is very hard to spot once dashboards are in production.

If you are considering roles that use these skills daily, the jobs and salary after MCA guide has current figures for database and analytics roles in India. If you are earlier in your learning path, exploring 3.0 University’s online certification courses gives you a structured way to build these skills with industry recognition.

Frequently Asked Questions

How do I create a relationship in MS Access?

Open the Database Tools tab, click Relationships, and add the tables you want to link. Drag the primary key from the parent table to the matching foreign key field in the child table. In the Edit Relationships dialog that appears, tick Enforce Referential Integrity and click Create. Access draws a join line between the tables to confirm the relationship in MS Access has been created.

What is a relational database?

A relational database stores data in separate tables, each representing one entity, and connects them through shared key fields called primary keys and foreign keys. This design eliminates data duplication and makes it possible to query related data efficiently using SQL joins. MySQL, PostgreSQL, Oracle, and MS Access are all relational database systems.

What is a junction table in MS Access?

A junction table, also called a bridge or associative table, is used to resolve a many-to-many relationship in MS Access. Because Access cannot directly link two tables where both sides have multiple matching rows, you create a third table that holds the primary keys of both original tables as foreign keys. This converts one many-to-many relationship into two one-to-many relationships.

What is LookML?

LookML is Looker’s data modelling language, used to define how tables in a data warehouse relate to each other and what business metrics mean. It sits between raw SQL and the analyst, ensuring every team member queries data through the same consistent definitions. LookML uses Explores and joins to replicate relational database relationships in code.

What are the main relationship types in a relational database?

The three types are one-to-one, one-to-many, and many-to-many. One-to-many is the most common: one customer has many orders. Many-to-many relationships, like students and courses, require a junction table to resolve them into two one-to-many relationships. MS Access displays these visually in the Relationships window using 1 and infinity symbols.

Why is referential integrity important in MS Access?

Referential integrity ensures that a foreign key value always points to an existing row in the parent table, preventing orphan records. Without it, deleting a customer who still has orders leaves those order rows referencing nothing, silently corrupting reports and totals. Enabling referential integrity when you create a relationship in MS Access is one of the most important steps in building a trustworthy data model.

Building solid data skills pays off in more ways than one. Understanding how to model a relationship in MS Access, design a normalised schema, and translate that logic into LookML puts you ahead in analyst and analytics engineering roles. The same pattern-matching instinct you develop here, spotting how data entities connect and where joins break, transfers directly into security analytics, where SOC analysts filter log tables, join threat intelligence feeds, and build detection dashboards every single day.

  1. Open MS Access this week and build a three-table schema (Customers, Orders, Products) with enforced referential integrity. Run a query across all three tables and observe how the joins work.
  2. If you want to apply these data skills in a high-demand security context, explore the EC-Council Certified SOC Analyst course at 3.0 University.
  3. Browse the full 3.0 University online certification courses catalogue for a certification that matches where you want to go next.

Last updated: June 2025. Reviewed by the 3University editorial team.

We create, review, and maintain educational content covering Cybersecurity, Ethical Hacking, Artificial Intelligence, Blockchain, Web3, and emerging technologies.

Read More Articles