0% found this document useful (0 votes)
4 views2 pages

Database Lab Notes

The document outlines key concepts in database management, including Primary Keys, Foreign Keys, Candidate Keys, and Composite Keys, along with SQL and MS Access data types. It also covers SQL queries for data manipulation and relationships in MS Access, such as One-to-One and One-to-Many. Additionally, it discusses Use Case Diagrams, differentiating between implicit and explicit functions in the context of system interactions.

Uploaded by

huzaifaltaf605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Database Lab Notes

The document outlines key concepts in database management, including Primary Keys, Foreign Keys, Candidate Keys, and Composite Keys, along with SQL and MS Access data types. It also covers SQL queries for data manipulation and relationships in MS Access, such as One-to-One and One-to-Many. Additionally, it discusses Use Case Diagrams, differentiating between implicit and explicit functions in the context of system interactions.

Uploaded by

huzaifaltaf605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Database Lab Paper Important Topics

(Revised)
Primary Key
A unique identifier for each record in a table. Cannot be null, no duplicate values.
Example:
CREATE TABLE Students (
ID INT PRIMARY KEY,
Name VARCHAR(50)
);

Foreign Key
A field in one table that refers to the Primary Key of another table, creating a relationship.

Candidate Key
A column (or set) that can uniquely identify records. One becomes the Primary Key.

Composite Key
A combination of two or more columns used together as a Primary Key.

SQL Data Types


INT — Whole numbers
VARCHAR(n) — Variable-length text
CHAR(n) — Fixed-length text
DATE — Date values
FLOAT — Decimal numbers
BOOLEAN — True/False values

MS Access Data Types


Short Text — Text up to 255 characters
Long Text — Large text
Number — Numeric values
Date/Time — Dates
Currency — Monetary values
AutoNumber — Auto-incrementing number
Yes/No — Boolean

SQL Queries
CREATE TABLE — Create a table
INSERT INTO — Add new data
SELECT — Retrieve data
UPDATE — Change data
DELETE — Remove data

Relationships in MS Access
One-to-One — 1 record in Table A to 1 in Table B
One-to-Many — 1 record in Table A to many in Table B

Primary Key vs Unique Key


Primary Key — Only one per table, Cannot be NULL, Enforces uniqueness
Unique Key — Can have multiple, Can have one NULL, Enforces uniqueness

Use Case Diagram


A diagram showing how actors interact with a system via use cases (actions).
Elements:
- Actors
- Use Cases (ovals)
- System Boundary
- Relationships

Implicit Function (in Use Case)


A relationship understood by context but not directly shown on the diagram.

Explicit Function (in Use Case)


A relationship clearly shown in the diagram using lines/arrows.

You might also like